home_widget.dart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. import '/components/header_buttons_component_widget.dart';
  2. import '/flutter_flow/flutter_flow_icon_button.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/uitgaantabel_kaart_component/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 'home_model.dart';
  15. export 'home_model.dart';
  16. class HomeWidget extends StatefulWidget {
  17. const HomeWidget({super.key});
  18. static String routeName = 'home';
  19. static String routePath = '/home';
  20. @override
  21. State<HomeWidget> createState() => _HomeWidgetState();
  22. }
  23. class _HomeWidgetState extends State<HomeWidget>
  24. with TickerProviderStateMixin, RouteAware {
  25. late HomeModel _model;
  26. final scaffoldKey = GlobalKey<ScaffoldState>();
  27. @override
  28. void initState() {
  29. super.initState();
  30. _model = createModel(context, () => HomeModel());
  31. _model.tabBarController = TabController(
  32. vsync: this,
  33. length: 5,
  34. initialIndex: 0,
  35. )
  36. ..addListener(() => safeSetState(() {}))
  37. ..addListener(() {
  38. debugLogWidgetClass(_model);
  39. });
  40. }
  41. @override
  42. void dispose() {
  43. routeObserver.unsubscribe(this);
  44. _model.dispose();
  45. super.dispose();
  46. }
  47. @override
  48. void didUpdateWidget(HomeWidget oldWidget) {
  49. super.didUpdateWidget(oldWidget);
  50. _model.widget = widget;
  51. }
  52. @override
  53. void didChangeDependencies() {
  54. super.didChangeDependencies();
  55. final route = DebugModalRoute.of(context);
  56. if (route != null) {
  57. routeObserver.subscribe(this, route);
  58. }
  59. debugLogGlobalProperty(context);
  60. }
  61. @override
  62. void didPopNext() {
  63. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  64. setState(() => _model.isRouteVisible = true);
  65. debugLogWidgetClass(_model);
  66. }
  67. }
  68. @override
  69. void didPush() {
  70. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  71. setState(() => _model.isRouteVisible = true);
  72. debugLogWidgetClass(_model);
  73. }
  74. }
  75. @override
  76. void didPop() {
  77. _model.isRouteVisible = false;
  78. }
  79. @override
  80. void didPushNext() {
  81. _model.isRouteVisible = false;
  82. }
  83. @override
  84. Widget build(BuildContext context) {
  85. DebugFlutterFlowModelContext.maybeOf(context)
  86. ?.parentModelCallback
  87. ?.call(_model);
  88. context.watch<FFAppState>();
  89. return GestureDetector(
  90. onTap: () {
  91. FocusScope.of(context).unfocus();
  92. FocusManager.instance.primaryFocus?.unfocus();
  93. },
  94. child: Scaffold(
  95. key: scaffoldKey,
  96. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  97. drawer: Drawer(
  98. elevation: 16.0,
  99. child: wrapWithModel(
  100. model: _model.drawerComponentModel,
  101. updateCallback: () => safeSetState(() {}),
  102. child: Builder(builder: (_) {
  103. return DebugFlutterFlowModelContext(
  104. rootModel: _model.rootModel,
  105. child: DrawerComponentWidget(),
  106. );
  107. }),
  108. ),
  109. ),
  110. appBar: PreferredSize(
  111. preferredSize: Size.fromHeight(80.0),
  112. child: AppBar(
  113. backgroundColor: FlutterFlowTheme.of(context).info,
  114. iconTheme: IconThemeData(color: Color(0xFFB12727)),
  115. automaticallyImplyLeading: false,
  116. actions: [],
  117. flexibleSpace: FlexibleSpaceBar(
  118. title: Align(
  119. alignment: AlignmentDirectional(0.0, 0.0),
  120. child: Row(
  121. mainAxisSize: MainAxisSize.max,
  122. children: [
  123. FlutterFlowIconButton(
  124. borderRadius: 8.0,
  125. buttonSize: 40.0,
  126. fillColor: Color(0xFFB50808),
  127. icon: Icon(
  128. Icons.dehaze_outlined,
  129. color: FlutterFlowTheme.of(context).info,
  130. size: 24.0,
  131. ),
  132. onPressed: () async {
  133. scaffoldKey.currentState!.openDrawer();
  134. },
  135. ),
  136. Padding(
  137. padding:
  138. EdgeInsetsDirectional.fromSTEB(4.0, 0.0, 0.0, 0.0),
  139. child: FlutterFlowIconButton(
  140. borderColor: Color(0x00FF0000),
  141. borderRadius: 30.0,
  142. borderWidth: 1.0,
  143. buttonSize: 50.0,
  144. fillColor: Color(0xFFB50808),
  145. icon: Icon(
  146. Icons.arrow_back_outlined,
  147. color: Colors.white,
  148. size: 30.0,
  149. ),
  150. onPressed: () async {
  151. context.pop();
  152. },
  153. ),
  154. ),
  155. ],
  156. ),
  157. ),
  158. background: wrapWithModel(
  159. model: _model.headerButtonsComponentModel,
  160. updateCallback: () => safeSetState(() {}),
  161. child: Builder(builder: (_) {
  162. return DebugFlutterFlowModelContext(
  163. rootModel: _model.rootModel,
  164. child: HeaderButtonsComponentWidget(),
  165. );
  166. }),
  167. ),
  168. centerTitle: true,
  169. expandedTitleScale: 1.0,
  170. ),
  171. bottom: PreferredSize(
  172. preferredSize: Size.fromHeight(70.0),
  173. child: Container(),
  174. ),
  175. toolbarHeight: MediaQuery.sizeOf(context).height * 0.25,
  176. elevation: 2.0,
  177. ),
  178. ),
  179. body: SafeArea(
  180. top: true,
  181. child: Column(
  182. mainAxisSize: MainAxisSize.max,
  183. children: [
  184. Material(
  185. color: Colors.transparent,
  186. elevation: 2.0,
  187. child: Container(
  188. height: 250.0,
  189. decoration: BoxDecoration(
  190. color: Color(0xFFF5A2A2),
  191. border: Border.all(
  192. color: Color(0xFFCAC3C3),
  193. width: 2.0,
  194. ),
  195. ),
  196. child: wrapWithModel(
  197. model: _model.pUitgaanSliderComponentModel,
  198. updateCallback: () => safeSetState(() {}),
  199. child: Builder(builder: (_) {
  200. return DebugFlutterFlowModelContext(
  201. rootModel: _model.rootModel,
  202. child: PUitgaanSliderComponentWidget(
  203. displayid: 'services_1',
  204. ),
  205. );
  206. }),
  207. ),
  208. ),
  209. ),
  210. Expanded(
  211. child: Column(
  212. children: [
  213. Align(
  214. alignment: Alignment(0.0, 0),
  215. child: TabBar(
  216. labelColor: FlutterFlowTheme.of(context).primaryText,
  217. unselectedLabelColor:
  218. FlutterFlowTheme.of(context).secondaryText,
  219. labelStyle:
  220. FlutterFlowTheme.of(context).titleMedium.override(
  221. font: GoogleFonts.interTight(
  222. fontWeight: FlutterFlowTheme.of(context)
  223. .titleMedium
  224. .fontWeight,
  225. fontStyle: FlutterFlowTheme.of(context)
  226. .titleMedium
  227. .fontStyle,
  228. ),
  229. letterSpacing: 0.0,
  230. fontWeight: FlutterFlowTheme.of(context)
  231. .titleMedium
  232. .fontWeight,
  233. fontStyle: FlutterFlowTheme.of(context)
  234. .titleMedium
  235. .fontStyle,
  236. ),
  237. unselectedLabelStyle:
  238. FlutterFlowTheme.of(context).titleMedium.override(
  239. font: GoogleFonts.interTight(
  240. fontWeight: FlutterFlowTheme.of(context)
  241. .titleMedium
  242. .fontWeight,
  243. fontStyle: FlutterFlowTheme.of(context)
  244. .titleMedium
  245. .fontStyle,
  246. ),
  247. letterSpacing: 0.0,
  248. fontWeight: FlutterFlowTheme.of(context)
  249. .titleMedium
  250. .fontWeight,
  251. fontStyle: FlutterFlowTheme.of(context)
  252. .titleMedium
  253. .fontStyle,
  254. ),
  255. indicatorColor: FlutterFlowTheme.of(context).primary,
  256. tabs: [
  257. Tab(
  258. text: FFLocalizations.of(context).getText(
  259. 'eor4c9rz' /* Uitgaan */,
  260. ),
  261. ),
  262. Tab(
  263. text: FFLocalizations.of(context).getText(
  264. 'mx7sn4ne' /* Activiteiten */,
  265. ),
  266. ),
  267. Tab(
  268. text: FFLocalizations.of(context).getText(
  269. 'e6xyyt74' /* Cultuur */,
  270. ),
  271. ),
  272. Tab(
  273. text: FFLocalizations.of(context).getText(
  274. 'uxy2nfok' /* Films */,
  275. ),
  276. ),
  277. Tab(
  278. text: FFLocalizations.of(context).getText(
  279. 'lx77xfrn' /* Jeugd */,
  280. ),
  281. ),
  282. ],
  283. controller: _model.tabBarController,
  284. onTap: (i) async {
  285. [
  286. () async {},
  287. () async {},
  288. () async {},
  289. () async {},
  290. () async {}
  291. ][i]();
  292. },
  293. ),
  294. ),
  295. Expanded(
  296. child: TabBarView(
  297. controller: _model.tabBarController,
  298. children: [
  299. Column(
  300. mainAxisSize: MainAxisSize.max,
  301. children: [
  302. Expanded(
  303. child: wrapWithModel(
  304. model: _model.uitgaantabelKaartComponentModel,
  305. updateCallback: () => safeSetState(() {}),
  306. child: Builder(builder: (_) {
  307. return DebugFlutterFlowModelContext(
  308. rootModel: _model.rootModel,
  309. child: UitgaantabelKaartComponentWidget(
  310. towndid: FFAppState().gemeenteSelectId,
  311. displayid: valueOrDefault<String>(
  312. '',
  313. 'services_3',
  314. ),
  315. ),
  316. );
  317. }),
  318. ),
  319. ),
  320. ],
  321. ),
  322. Column(
  323. mainAxisSize: MainAxisSize.max,
  324. children: [],
  325. ),
  326. Column(
  327. mainAxisSize: MainAxisSize.max,
  328. children: [],
  329. ),
  330. Column(
  331. mainAxisSize: MainAxisSize.max,
  332. children: [],
  333. ),
  334. Column(
  335. mainAxisSize: MainAxisSize.max,
  336. children: [],
  337. ),
  338. ],
  339. ),
  340. ),
  341. ],
  342. ),
  343. ),
  344. ],
  345. ),
  346. ),
  347. ),
  348. );
  349. }
  350. }