header_buttons_component_widget.dart 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. import '/flutter_flow/flutter_flow_icon_button.dart';
  2. import '/flutter_flow/flutter_flow_theme.dart';
  3. import '/flutter_flow/flutter_flow_util.dart';
  4. import '/flutter_flow/flutter_flow_widgets.dart';
  5. import 'dart:ui';
  6. import 'package:aligned_tooltip/aligned_tooltip.dart';
  7. import 'package:flutter/material.dart';
  8. import 'package:flutter_spinkit/flutter_spinkit.dart';
  9. import 'package:google_fonts/google_fonts.dart';
  10. import 'package:provider/provider.dart';
  11. import 'header_buttons_component_model.dart';
  12. export 'header_buttons_component_model.dart';
  13. /// Standaard header-knoppen (drawer + terug) voor herbruik op alle pagina's
  14. class HeaderButtonsComponentWidget extends StatefulWidget {
  15. const HeaderButtonsComponentWidget({super.key});
  16. @override
  17. State<HeaderButtonsComponentWidget> createState() =>
  18. _HeaderButtonsComponentWidgetState();
  19. }
  20. class _HeaderButtonsComponentWidgetState
  21. extends State<HeaderButtonsComponentWidget> with RouteAware {
  22. late HeaderButtonsComponentModel _model;
  23. @override
  24. void setState(VoidCallback callback) {
  25. super.setState(callback);
  26. _model.onUpdate();
  27. }
  28. @override
  29. void initState() {
  30. super.initState();
  31. _model = createModel(context, () => HeaderButtonsComponentModel());
  32. }
  33. @override
  34. void dispose() {
  35. routeObserver.unsubscribe(this);
  36. _model.maybeDispose();
  37. super.dispose();
  38. }
  39. @override
  40. void didUpdateWidget(HeaderButtonsComponentWidget oldWidget) {
  41. super.didUpdateWidget(oldWidget);
  42. _model.widget = widget;
  43. }
  44. @override
  45. void didChangeDependencies() {
  46. super.didChangeDependencies();
  47. final route = DebugModalRoute.of(context);
  48. if (route != null) {
  49. routeObserver.subscribe(this, route);
  50. }
  51. debugLogGlobalProperty(context);
  52. }
  53. @override
  54. void didPopNext() {
  55. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  56. setState(() => _model.isRouteVisible = true);
  57. debugLogWidgetClass(_model);
  58. }
  59. }
  60. @override
  61. void didPush() {
  62. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  63. setState(() => _model.isRouteVisible = true);
  64. debugLogWidgetClass(_model);
  65. }
  66. }
  67. @override
  68. void didPop() {
  69. _model.isRouteVisible = false;
  70. }
  71. @override
  72. void didPushNext() {
  73. _model.isRouteVisible = false;
  74. }
  75. @override
  76. Widget build(BuildContext context) {
  77. DebugFlutterFlowModelContext.maybeOf(context)
  78. ?.parentModelCallback
  79. ?.call(_model);
  80. context.watch<FFAppState>();
  81. return Align(
  82. alignment: AlignmentDirectional(0.0, 0.0),
  83. child: Row(
  84. mainAxisSize: MainAxisSize.max,
  85. children: [
  86. AlignedTooltip(
  87. content: Padding(
  88. padding: EdgeInsets.all(4.0),
  89. child: Text(
  90. FFLocalizations.of(context).getText(
  91. '17msrach' /* Menu openen */,
  92. ),
  93. style: FlutterFlowTheme.of(context).bodyLarge.override(
  94. font: GoogleFonts.inter(
  95. fontWeight:
  96. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  97. fontStyle:
  98. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  99. ),
  100. letterSpacing: 0.0,
  101. fontWeight:
  102. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  103. fontStyle:
  104. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  105. ),
  106. ),
  107. ),
  108. offset: 4.0,
  109. preferredDirection: AxisDirection.down,
  110. borderRadius: BorderRadius.circular(8.0),
  111. backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
  112. elevation: 4.0,
  113. tailBaseWidth: 24.0,
  114. tailLength: 12.0,
  115. waitDuration: Duration(milliseconds: 100),
  116. showDuration: Duration(milliseconds: 1500),
  117. triggerMode: TooltipTriggerMode.tap,
  118. child: FlutterFlowIconButton(
  119. borderRadius: 8.0,
  120. buttonSize: 40.0,
  121. fillColor: Color(0xFFB50808),
  122. icon: Icon(
  123. Icons.dehaze_outlined,
  124. color: FlutterFlowTheme.of(context).info,
  125. size: 24.0,
  126. ),
  127. onPressed: () async {
  128. Scaffold.of(context).openDrawer();
  129. },
  130. ),
  131. ),
  132. AlignedTooltip(
  133. content: Padding(
  134. padding: EdgeInsets.all(4.0),
  135. child: Text(
  136. FFLocalizations.of(context).getText(
  137. 'f8ay39rg' /* Terug */,
  138. ),
  139. style: FlutterFlowTheme.of(context).bodyLarge.override(
  140. font: GoogleFonts.inter(
  141. fontWeight:
  142. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  143. fontStyle:
  144. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  145. ),
  146. letterSpacing: 0.0,
  147. fontWeight:
  148. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  149. fontStyle:
  150. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  151. ),
  152. ),
  153. ),
  154. offset: 4.0,
  155. preferredDirection: AxisDirection.down,
  156. borderRadius: BorderRadius.circular(8.0),
  157. backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
  158. elevation: 4.0,
  159. tailBaseWidth: 24.0,
  160. tailLength: 12.0,
  161. waitDuration: Duration(milliseconds: 100),
  162. showDuration: Duration(milliseconds: 1500),
  163. triggerMode: TooltipTriggerMode.tap,
  164. child: Padding(
  165. padding: EdgeInsetsDirectional.fromSTEB(4.0, 0.0, 0.0, 0.0),
  166. child: FlutterFlowIconButton(
  167. borderColor: Color(0x00FF0000),
  168. borderRadius: 30.0,
  169. borderWidth: 1.0,
  170. buttonSize: 50.0,
  171. fillColor: Color(0xFFB50808),
  172. icon: Icon(
  173. Icons.arrow_back_outlined,
  174. color: Colors.white,
  175. size: 30.0,
  176. ),
  177. onPressed: () async {
  178. context.pop();
  179. },
  180. ),
  181. ),
  182. ),
  183. Flexible(
  184. child: Text(
  185. FFAppState().gemeenteSelectNaam != null &&
  186. FFAppState().gemeenteSelectNaam != ''
  187. ? FFAppState().gemeenteSelectNaam
  188. : FFAppState().provincieSelectName,
  189. style: FlutterFlowTheme.of(context).bodyMedium.override(
  190. font: GoogleFonts.inter(
  191. fontWeight:
  192. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  193. fontStyle:
  194. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  195. ),
  196. letterSpacing: 0.0,
  197. fontWeight:
  198. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  199. fontStyle:
  200. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  201. ),
  202. ),
  203. ),
  204. ],
  205. ),
  206. );
  207. }
  208. }