header_buttons_component_widget.dart 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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 '/custom_code/widgets/index.dart' as custom_widgets;
  7. import '/flutter_flow/custom_functions.dart' as functions;
  8. import '/index.dart';
  9. import 'package:aligned_tooltip/aligned_tooltip.dart';
  10. import 'package:flutter/material.dart';
  11. import 'package:flutter_spinkit/flutter_spinkit.dart';
  12. import 'package:google_fonts/google_fonts.dart';
  13. import 'package:provider/provider.dart';
  14. import 'header_buttons_component_model.dart';
  15. export 'header_buttons_component_model.dart';
  16. /// Standaard header-knoppen (drawer + terug) voor herbruik op alle pagina's
  17. class HeaderButtonsComponentWidget extends StatefulWidget {
  18. const HeaderButtonsComponentWidget({
  19. super.key,
  20. bool? showBackButton,
  21. this.landelijk,
  22. this.plaatsId,
  23. }) : this.showBackButton = showBackButton ?? true;
  24. final bool showBackButton;
  25. final bool? landelijk;
  26. final String? plaatsId;
  27. @override
  28. State<HeaderButtonsComponentWidget> createState() =>
  29. _HeaderButtonsComponentWidgetState();
  30. }
  31. class _HeaderButtonsComponentWidgetState
  32. extends State<HeaderButtonsComponentWidget> with RouteAware {
  33. late HeaderButtonsComponentModel _model;
  34. @override
  35. void setState(VoidCallback callback) {
  36. super.setState(callback);
  37. _model.onUpdate();
  38. }
  39. @override
  40. void initState() {
  41. super.initState();
  42. _model = createModel(context, () => HeaderButtonsComponentModel());
  43. }
  44. @override
  45. void dispose() {
  46. routeObserver.unsubscribe(this);
  47. _model.maybeDispose();
  48. super.dispose();
  49. }
  50. @override
  51. void didUpdateWidget(HeaderButtonsComponentWidget oldWidget) {
  52. super.didUpdateWidget(oldWidget);
  53. _model.widget = widget;
  54. }
  55. @override
  56. void didChangeDependencies() {
  57. super.didChangeDependencies();
  58. final route = DebugModalRoute.of(context);
  59. if (route != null) {
  60. routeObserver.subscribe(this, route);
  61. }
  62. debugLogGlobalProperty(context);
  63. }
  64. @override
  65. void didPopNext() {
  66. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  67. setState(() => _model.isRouteVisible = true);
  68. debugLogWidgetClass(_model);
  69. }
  70. }
  71. @override
  72. void didPush() {
  73. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  74. setState(() => _model.isRouteVisible = true);
  75. debugLogWidgetClass(_model);
  76. }
  77. }
  78. @override
  79. void didPop() {
  80. _model.isRouteVisible = false;
  81. }
  82. @override
  83. void didPushNext() {
  84. _model.isRouteVisible = false;
  85. }
  86. @override
  87. Widget build(BuildContext context) {
  88. DebugFlutterFlowModelContext.maybeOf(context)
  89. ?.parentModelCallback
  90. ?.call(_model);
  91. context.watch<FFAppState>();
  92. return Align(
  93. alignment: AlignmentDirectional(0.0, 0.0),
  94. child: Padding(
  95. padding: EdgeInsetsDirectional.fromSTEB(0.0, 28.0, 0.0, 0.0),
  96. child: Wrap(
  97. spacing: 0.0,
  98. runSpacing: 0.0,
  99. alignment: WrapAlignment.start,
  100. crossAxisAlignment: WrapCrossAlignment.center,
  101. direction: Axis.horizontal,
  102. runAlignment: WrapAlignment.start,
  103. verticalDirection: VerticalDirection.down,
  104. clipBehavior: Clip.none,
  105. children: [
  106. AlignedTooltip(
  107. content: Padding(
  108. padding: EdgeInsets.all(4.0),
  109. child: Text(
  110. FFLocalizations.of(context).getText(
  111. '17msrach' /* Menu openen */,
  112. ),
  113. style: FlutterFlowTheme.of(context).bodyLarge.override(
  114. font: GoogleFonts.roboto(
  115. fontWeight:
  116. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  117. fontStyle:
  118. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  119. ),
  120. letterSpacing: 0.0,
  121. fontWeight:
  122. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  123. fontStyle:
  124. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  125. ),
  126. ),
  127. ),
  128. offset: 4.0,
  129. preferredDirection: AxisDirection.down,
  130. borderRadius: BorderRadius.circular(8.0),
  131. backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
  132. elevation: 4.0,
  133. tailBaseWidth: 24.0,
  134. tailLength: 12.0,
  135. waitDuration: Duration(milliseconds: 100),
  136. showDuration: Duration(milliseconds: 1500),
  137. triggerMode: TooltipTriggerMode.tap,
  138. child: FlutterFlowIconButton(
  139. borderRadius: 8.0,
  140. buttonSize: 40.0,
  141. fillColor: FlutterFlowTheme.of(context).secondary,
  142. icon: Icon(
  143. Icons.dehaze_outlined,
  144. color: FlutterFlowTheme.of(context).info,
  145. size: 24.0,
  146. ),
  147. onPressed: () async {
  148. Scaffold.of(context).openDrawer();
  149. },
  150. ),
  151. ),
  152. if (widget!.showBackButton == true)
  153. AlignedTooltip(
  154. content: Padding(
  155. padding: EdgeInsets.all(4.0),
  156. child: Text(
  157. FFLocalizations.of(context).getText(
  158. 'jc7ha6d8' /* Terug */,
  159. ),
  160. style: FlutterFlowTheme.of(context).bodyLarge.override(
  161. font: GoogleFonts.roboto(
  162. fontWeight: FlutterFlowTheme.of(context)
  163. .bodyLarge
  164. .fontWeight,
  165. fontStyle: FlutterFlowTheme.of(context)
  166. .bodyLarge
  167. .fontStyle,
  168. ),
  169. letterSpacing: 0.0,
  170. fontWeight:
  171. FlutterFlowTheme.of(context).bodyLarge.fontWeight,
  172. fontStyle:
  173. FlutterFlowTheme.of(context).bodyLarge.fontStyle,
  174. ),
  175. ),
  176. ),
  177. offset: 4.0,
  178. preferredDirection: AxisDirection.down,
  179. borderRadius: BorderRadius.circular(8.0),
  180. backgroundColor:
  181. FlutterFlowTheme.of(context).secondaryBackground,
  182. elevation: 4.0,
  183. tailBaseWidth: 24.0,
  184. tailLength: 12.0,
  185. waitDuration: Duration(milliseconds: 100),
  186. showDuration: Duration(milliseconds: 1500),
  187. triggerMode: TooltipTriggerMode.tap,
  188. child: Padding(
  189. padding: EdgeInsetsDirectional.fromSTEB(4.0, 0.0, 0.0, 0.0),
  190. child: FlutterFlowIconButton(
  191. borderColor: Color(0x00FF0000),
  192. borderRadius: 8.0,
  193. borderWidth: 1.0,
  194. buttonSize: 50.0,
  195. fillColor: FlutterFlowTheme.of(context).secondary,
  196. icon: Icon(
  197. Icons.arrow_back_outlined,
  198. color: Colors.white,
  199. size: 30.0,
  200. ),
  201. onPressed: () async {
  202. context.pop();
  203. },
  204. ),
  205. ),
  206. ),
  207. Column(
  208. mainAxisSize: MainAxisSize.min,
  209. children: [
  210. ClipRRect(
  211. borderRadius: BorderRadius.circular(8.0),
  212. child: Image.asset(
  213. 'assets/images/logo800px.png',
  214. width: 150.0,
  215. height: 22.0,
  216. fit: BoxFit.contain,
  217. ),
  218. ),
  219. InkWell(
  220. splashColor: Colors.transparent,
  221. focusColor: Colors.transparent,
  222. hoverColor: Colors.transparent,
  223. highlightColor: Colors.transparent,
  224. onTap: () async {
  225. context.pushNamed(SelectprovinciegemeenteWidget.routeName);
  226. },
  227. child: Text(
  228. functions.headerLocatie(
  229. widget!.landelijk,
  230. widget!.plaatsId,
  231. FFAppState().provincieSelectId,
  232. FFAppState().provincieSelectName,
  233. FFAppState().gemeenteSelectNaam),
  234. style: FlutterFlowTheme.of(context).bodyMedium.override(
  235. font: GoogleFonts.roboto(
  236. fontWeight: FlutterFlowTheme.of(context)
  237. .bodyMedium
  238. .fontWeight,
  239. fontStyle: FlutterFlowTheme.of(context)
  240. .bodyMedium
  241. .fontStyle,
  242. ),
  243. color: FlutterFlowTheme.of(context).secondary,
  244. letterSpacing: 0.0,
  245. fontWeight: FlutterFlowTheme.of(context)
  246. .bodyMedium
  247. .fontWeight,
  248. fontStyle:
  249. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  250. ),
  251. ),
  252. ),
  253. ],
  254. ),
  255. Container(
  256. width: 2.0,
  257. height: 2.0,
  258. child: custom_widgets.VerbindingsBanner(
  259. width: 2.0,
  260. height: 2.0,
  261. ),
  262. ),
  263. ],
  264. ),
  265. ),
  266. );
  267. }
  268. }