p_uitgaan_page_widget.dart 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. import '/components/header_buttons_component_widget.dart';
  2. import '/flutter_flow/flutter_flow_ad_banner.dart';
  3. import '/flutter_flow/flutter_flow_theme.dart';
  4. import '/flutter_flow/flutter_flow_util.dart';
  5. import '/flutter_flow/flutter_flow_widgets.dart';
  6. import '/shared/drawer_component/drawer_component_widget.dart';
  7. import '/uitgaanspaginas/p_uitgaan_slider_component/p_uitgaan_slider_component_widget.dart';
  8. import '/uitgaanspaginas/p_uitgaantabel_kaart_component/p_uitgaantabel_kaart_component_widget.dart';
  9. import 'dart:ui';
  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 'p_uitgaan_page_model.dart';
  15. export 'p_uitgaan_page_model.dart';
  16. class PUitgaanPageWidget extends StatefulWidget {
  17. const PUitgaanPageWidget({
  18. super.key,
  19. required this.plaats,
  20. required this.services,
  21. });
  22. final String? plaats;
  23. final String? services;
  24. static String routeName = 'PUitgaanPage';
  25. static String routePath = '/pUitgaanPage';
  26. @override
  27. State<PUitgaanPageWidget> createState() => _PUitgaanPageWidgetState();
  28. }
  29. class _PUitgaanPageWidgetState extends State<PUitgaanPageWidget>
  30. with RouteAware {
  31. late PUitgaanPageModel _model;
  32. final scaffoldKey = GlobalKey<ScaffoldState>();
  33. @override
  34. void initState() {
  35. super.initState();
  36. _model = createModel(context, () => PUitgaanPageModel());
  37. }
  38. @override
  39. void dispose() {
  40. routeObserver.unsubscribe(this);
  41. _model.dispose();
  42. super.dispose();
  43. }
  44. @override
  45. void didUpdateWidget(PUitgaanPageWidget oldWidget) {
  46. super.didUpdateWidget(oldWidget);
  47. _model.widget = widget;
  48. }
  49. @override
  50. void didChangeDependencies() {
  51. super.didChangeDependencies();
  52. final route = DebugModalRoute.of(context);
  53. if (route != null) {
  54. routeObserver.subscribe(this, route);
  55. }
  56. debugLogGlobalProperty(context);
  57. }
  58. @override
  59. void didPopNext() {
  60. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  61. setState(() => _model.isRouteVisible = true);
  62. debugLogWidgetClass(_model);
  63. }
  64. }
  65. @override
  66. void didPush() {
  67. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  68. setState(() => _model.isRouteVisible = true);
  69. debugLogWidgetClass(_model);
  70. }
  71. }
  72. @override
  73. void didPop() {
  74. _model.isRouteVisible = false;
  75. }
  76. @override
  77. void didPushNext() {
  78. _model.isRouteVisible = false;
  79. }
  80. @override
  81. Widget build(BuildContext context) {
  82. DebugFlutterFlowModelContext.maybeOf(context)
  83. ?.parentModelCallback
  84. ?.call(_model);
  85. return GestureDetector(
  86. onTap: () {
  87. FocusScope.of(context).unfocus();
  88. FocusManager.instance.primaryFocus?.unfocus();
  89. },
  90. child: Scaffold(
  91. key: scaffoldKey,
  92. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  93. drawer: Drawer(
  94. elevation: 16.0,
  95. child: wrapWithModel(
  96. model: _model.drawerComponentModel,
  97. updateCallback: () => safeSetState(() {}),
  98. child: Builder(builder: (_) {
  99. return DebugFlutterFlowModelContext(
  100. rootModel: _model.rootModel,
  101. child: DrawerComponentWidget(),
  102. );
  103. }),
  104. ),
  105. ),
  106. appBar: PreferredSize(
  107. preferredSize: Size.fromHeight(80.0),
  108. child: AppBar(
  109. backgroundColor: FlutterFlowTheme.of(context).info,
  110. iconTheme: IconThemeData(color: Color(0xFFB12727)),
  111. automaticallyImplyLeading: false,
  112. actions: [],
  113. flexibleSpace: FlexibleSpaceBar(
  114. title: Align(
  115. alignment: AlignmentDirectional(0.0, 0.0),
  116. child: wrapWithModel(
  117. model: _model.headerButtonsComponentModel,
  118. updateCallback: () => safeSetState(() {}),
  119. child: Builder(builder: (_) {
  120. return DebugFlutterFlowModelContext(
  121. rootModel: _model.rootModel,
  122. child: HeaderButtonsComponentWidget(),
  123. );
  124. }),
  125. ),
  126. ),
  127. background: Align(
  128. alignment: AlignmentDirectional(0.0, 0.0),
  129. child: Padding(
  130. padding: EdgeInsetsDirectional.fromSTEB(60.0, 0.0, 5.0, 0.0),
  131. child: ClipRRect(
  132. borderRadius: BorderRadius.circular(8.0),
  133. child: Image.asset(
  134. 'assets/images/logo800px.png',
  135. width: () {
  136. if (MediaQuery.sizeOf(context).width <
  137. kBreakpointSmall) {
  138. return 200.0;
  139. } else if (MediaQuery.sizeOf(context).width <
  140. kBreakpointMedium) {
  141. return 250.0;
  142. } else if (MediaQuery.sizeOf(context).width <
  143. kBreakpointLarge) {
  144. return 350.0;
  145. } else {
  146. return 400.0;
  147. }
  148. }(),
  149. fit: BoxFit.fitWidth,
  150. ),
  151. ),
  152. ),
  153. ),
  154. centerTitle: true,
  155. expandedTitleScale: 1.0,
  156. ),
  157. bottom: PreferredSize(
  158. preferredSize: Size.fromHeight(70.0),
  159. child: Container(),
  160. ),
  161. toolbarHeight: MediaQuery.sizeOf(context).height * 0.25,
  162. elevation: 2.0,
  163. ),
  164. ),
  165. body: SingleChildScrollView(
  166. child: Column(
  167. mainAxisSize: MainAxisSize.max,
  168. children: [
  169. wrapWithModel(
  170. model: _model.pUitgaanSliderComponentModel,
  171. updateCallback: () => safeSetState(() {}),
  172. child: Builder(builder: (_) {
  173. return DebugFlutterFlowModelContext(
  174. rootModel: _model.rootModel,
  175. child: PUitgaanSliderComponentWidget(
  176. townid: widget!.plaats,
  177. displayid: widget!.services,
  178. ),
  179. );
  180. }),
  181. ),
  182. Padding(
  183. padding: EdgeInsetsDirectional.fromSTEB(0.0, 15.0, 0.0, 0.0),
  184. child: FlutterFlowAdBanner(
  185. showsTestAd: true,
  186. iOSAdUnitID: 'ca-app-pub-2431417692812232/5511582981',
  187. androidAdUnitID: 'ca-app-pub-2431417692812232/6657143691',
  188. ),
  189. ),
  190. Container(
  191. decoration: BoxDecoration(),
  192. child: wrapWithModel(
  193. model: _model.pUitgaantabelKaartComponentModel,
  194. updateCallback: () => safeSetState(() {}),
  195. child: Builder(builder: (_) {
  196. return DebugFlutterFlowModelContext(
  197. rootModel: _model.rootModel,
  198. child: PUitgaantabelKaartComponentWidget(
  199. towndid: widget!.plaats!,
  200. displayid: widget!.services!,
  201. ),
  202. );
  203. }),
  204. ),
  205. ),
  206. ],
  207. ),
  208. ),
  209. ),
  210. );
  211. }
  212. }