home_widget.dart 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. import '/components/header_buttons_component_widget.dart';
  2. import '/flutter_flow/flutter_flow_choice_chips.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 '/flutter_flow/form_field_controller.dart';
  7. import '/shared/drawer_component/drawer_component_widget.dart';
  8. import '/uitgaanspaginas/home_uitgaan_slider_component/home_uitgaan_slider_component_widget.dart';
  9. import '/uitgaanspaginas/home_uitgaantabel_kaart_component/home_uitgaantabel_kaart_component_widget.dart';
  10. import 'dart:ui';
  11. import '/flutter_flow/custom_functions.dart' as functions;
  12. import 'package:flutter/material.dart';
  13. import 'package:flutter_spinkit/flutter_spinkit.dart';
  14. import 'package:google_fonts/google_fonts.dart';
  15. import 'package:provider/provider.dart';
  16. import 'home_model.dart';
  17. export 'home_model.dart';
  18. class HomeWidget extends StatefulWidget {
  19. const HomeWidget({super.key});
  20. static String routeName = 'home';
  21. static String routePath = '/home';
  22. @override
  23. State<HomeWidget> createState() => _HomeWidgetState();
  24. }
  25. class _HomeWidgetState extends State<HomeWidget>
  26. with TickerProviderStateMixin, RouteAware {
  27. late HomeModel _model;
  28. final scaffoldKey = GlobalKey<ScaffoldState>();
  29. @override
  30. void initState() {
  31. super.initState();
  32. _model = createModel(context, () => HomeModel());
  33. _model.tabBarController = TabController(
  34. vsync: this,
  35. length: 5,
  36. initialIndex: 0,
  37. )
  38. ..addListener(() => safeSetState(() {}))
  39. ..addListener(() {
  40. debugLogWidgetClass(_model);
  41. });
  42. }
  43. @override
  44. void dispose() {
  45. routeObserver.unsubscribe(this);
  46. _model.dispose();
  47. super.dispose();
  48. }
  49. @override
  50. void didUpdateWidget(HomeWidget oldWidget) {
  51. super.didUpdateWidget(oldWidget);
  52. _model.widget = widget;
  53. }
  54. @override
  55. void didChangeDependencies() {
  56. super.didChangeDependencies();
  57. final route = DebugModalRoute.of(context);
  58. if (route != null) {
  59. routeObserver.subscribe(this, route);
  60. }
  61. debugLogGlobalProperty(context);
  62. }
  63. @override
  64. void didPopNext() {
  65. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  66. setState(() => _model.isRouteVisible = true);
  67. debugLogWidgetClass(_model);
  68. }
  69. }
  70. @override
  71. void didPush() {
  72. if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
  73. setState(() => _model.isRouteVisible = true);
  74. debugLogWidgetClass(_model);
  75. }
  76. }
  77. @override
  78. void didPop() {
  79. _model.isRouteVisible = false;
  80. }
  81. @override
  82. void didPushNext() {
  83. _model.isRouteVisible = false;
  84. }
  85. @override
  86. Widget build(BuildContext context) {
  87. DebugFlutterFlowModelContext.maybeOf(context)
  88. ?.parentModelCallback
  89. ?.call(_model);
  90. context.watch<FFAppState>();
  91. return GestureDetector(
  92. onTap: () {
  93. FocusScope.of(context).unfocus();
  94. FocusManager.instance.primaryFocus?.unfocus();
  95. },
  96. child: Scaffold(
  97. key: scaffoldKey,
  98. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  99. drawer: Drawer(
  100. elevation: 16.0,
  101. child: wrapWithModel(
  102. model: _model.drawerComponentModel,
  103. updateCallback: () => safeSetState(() {}),
  104. child: Builder(builder: (_) {
  105. return DebugFlutterFlowModelContext(
  106. rootModel: _model.rootModel,
  107. child: DrawerComponentWidget(),
  108. );
  109. }),
  110. ),
  111. ),
  112. appBar: PreferredSize(
  113. preferredSize: Size.fromHeight(50.0),
  114. child: AppBar(
  115. backgroundColor: FlutterFlowTheme.of(context).primaryText,
  116. iconTheme:
  117. IconThemeData(color: FlutterFlowTheme.of(context).secondary),
  118. automaticallyImplyLeading: false,
  119. actions: [],
  120. flexibleSpace: FlexibleSpaceBar(
  121. background: wrapWithModel(
  122. model: _model.headerButtonsComponentModel,
  123. updateCallback: () => safeSetState(() {}),
  124. child: Builder(builder: (_) {
  125. return DebugFlutterFlowModelContext(
  126. rootModel: _model.rootModel,
  127. child: HeaderButtonsComponentWidget(
  128. showBackButton: false,
  129. ),
  130. );
  131. }),
  132. ),
  133. centerTitle: true,
  134. expandedTitleScale: 1.0,
  135. ),
  136. bottom: PreferredSize(
  137. preferredSize: Size.fromHeight(70.0),
  138. child: Container(),
  139. ),
  140. toolbarHeight: MediaQuery.sizeOf(context).height * 0.25,
  141. elevation: 2.0,
  142. ),
  143. ),
  144. body: SafeArea(
  145. top: true,
  146. child: Column(
  147. mainAxisSize: MainAxisSize.max,
  148. children: [
  149. Material(
  150. color: Colors.transparent,
  151. elevation: 0.0,
  152. child: Container(
  153. height: 250.0,
  154. decoration: BoxDecoration(),
  155. child: wrapWithModel(
  156. model: _model.homeUitgaanSliderComponentModel,
  157. updateCallback: () => safeSetState(() {}),
  158. child: Builder(builder: (_) {
  159. return DebugFlutterFlowModelContext(
  160. rootModel: _model.rootModel,
  161. child: HomeUitgaanSliderComponentWidget(
  162. displayid: 'services_1',
  163. ),
  164. );
  165. }),
  166. ),
  167. ),
  168. ),
  169. FlutterFlowChoiceChips(
  170. options: [
  171. ChipData(FFLocalizations.of(context).getText(
  172. '8khvlnye' /* Alles */,
  173. )),
  174. ChipData(FFLocalizations.of(context).getText(
  175. 'iov8u1yi' /* Vandaag */,
  176. )),
  177. ChipData(FFLocalizations.of(context).getText(
  178. 'gco4jgol' /* Dit weekend */,
  179. )),
  180. ChipData(FFLocalizations.of(context).getText(
  181. 'h6ou1q9q' /* Deze week */,
  182. ))
  183. ],
  184. onChanged: (val) async {
  185. safeSetState(
  186. () => _model.choiceChipsValue = val?.firstOrNull);
  187. FFAppState().datumFilter = _model.choiceChipsValue!;
  188. safeSetState(() {});
  189. },
  190. selectedChipStyle: ChipStyle(
  191. backgroundColor: FlutterFlowTheme.of(context).primary,
  192. textStyle: FlutterFlowTheme.of(context).bodyMedium.override(
  193. font: GoogleFonts.roboto(
  194. fontWeight: FlutterFlowTheme.of(context)
  195. .bodyMedium
  196. .fontWeight,
  197. fontStyle:
  198. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  199. ),
  200. color: FlutterFlowTheme.of(context).info,
  201. letterSpacing: 0.0,
  202. fontWeight:
  203. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  204. fontStyle:
  205. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  206. ),
  207. iconColor: FlutterFlowTheme.of(context).info,
  208. iconSize: 16.0,
  209. elevation: 0.0,
  210. borderRadius: BorderRadius.circular(8.0),
  211. ),
  212. unselectedChipStyle: ChipStyle(
  213. backgroundColor:
  214. FlutterFlowTheme.of(context).secondaryBackground,
  215. textStyle: FlutterFlowTheme.of(context).bodyMedium.override(
  216. font: GoogleFonts.roboto(
  217. fontWeight: FlutterFlowTheme.of(context)
  218. .bodyMedium
  219. .fontWeight,
  220. fontStyle:
  221. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  222. ),
  223. color: FlutterFlowTheme.of(context).secondaryText,
  224. letterSpacing: 0.0,
  225. fontWeight:
  226. FlutterFlowTheme.of(context).bodyMedium.fontWeight,
  227. fontStyle:
  228. FlutterFlowTheme.of(context).bodyMedium.fontStyle,
  229. ),
  230. iconColor: FlutterFlowTheme.of(context).secondaryText,
  231. iconSize: 16.0,
  232. elevation: 0.0,
  233. borderRadius: BorderRadius.circular(8.0),
  234. ),
  235. chipSpacing: 8.0,
  236. rowSpacing: 8.0,
  237. multiselect: false,
  238. initialized: _model.choiceChipsValue != null,
  239. alignment: WrapAlignment.start,
  240. controller: _model.choiceChipsValueController ??=
  241. FormFieldController<List<String>>(
  242. [
  243. FFLocalizations.of(context).getText(
  244. 'g09d1fb5' /* Alles */,
  245. )
  246. ],
  247. ),
  248. wrapped: true,
  249. ),
  250. Expanded(
  251. child: Column(
  252. children: [
  253. Align(
  254. alignment: Alignment(0.0, 0),
  255. child: TabBar(
  256. isScrollable: true,
  257. tabAlignment: TabAlignment.center,
  258. labelColor: FlutterFlowTheme.of(context).primaryText,
  259. unselectedLabelColor:
  260. FlutterFlowTheme.of(context).secondaryText,
  261. labelStyle:
  262. FlutterFlowTheme.of(context).titleMedium.override(
  263. font: GoogleFonts.roboto(
  264. fontWeight: FlutterFlowTheme.of(context)
  265. .titleMedium
  266. .fontWeight,
  267. fontStyle: FlutterFlowTheme.of(context)
  268. .titleMedium
  269. .fontStyle,
  270. ),
  271. letterSpacing: 0.0,
  272. fontWeight: FlutterFlowTheme.of(context)
  273. .titleMedium
  274. .fontWeight,
  275. fontStyle: FlutterFlowTheme.of(context)
  276. .titleMedium
  277. .fontStyle,
  278. ),
  279. unselectedLabelStyle:
  280. FlutterFlowTheme.of(context).titleMedium.override(
  281. font: GoogleFonts.roboto(
  282. fontWeight: FlutterFlowTheme.of(context)
  283. .titleMedium
  284. .fontWeight,
  285. fontStyle: FlutterFlowTheme.of(context)
  286. .titleMedium
  287. .fontStyle,
  288. ),
  289. letterSpacing: 0.0,
  290. fontWeight: FlutterFlowTheme.of(context)
  291. .titleMedium
  292. .fontWeight,
  293. fontStyle: FlutterFlowTheme.of(context)
  294. .titleMedium
  295. .fontStyle,
  296. ),
  297. indicatorColor: FlutterFlowTheme.of(context).secondary,
  298. tabs: [
  299. Tab(
  300. text: FFLocalizations.of(context).getText(
  301. 'eor4c9rz' /* Uitgaan */,
  302. ),
  303. ),
  304. Tab(
  305. text: FFLocalizations.of(context).getText(
  306. 'mx7sn4ne' /* Activiteiten */,
  307. ),
  308. ),
  309. Tab(
  310. text: FFLocalizations.of(context).getText(
  311. 'e6xyyt74' /* Cultuur & Info */,
  312. ),
  313. ),
  314. Tab(
  315. text: FFLocalizations.of(context).getText(
  316. 'uxy2nfok' /* Films */,
  317. ),
  318. ),
  319. Tab(
  320. text: FFLocalizations.of(context).getText(
  321. 'lx77xfrn' /* Jeugd */,
  322. ),
  323. ),
  324. ],
  325. controller: _model.tabBarController,
  326. onTap: (i) async {
  327. [
  328. () async {},
  329. () async {
  330. _model.tabActiviteitenGeladen = true;
  331. safeSetState(() {});
  332. },
  333. () async {
  334. _model.tabCultuurGeladen = true;
  335. safeSetState(() {});
  336. },
  337. () async {
  338. _model.tabFilmsGeladen = true;
  339. safeSetState(() {});
  340. },
  341. () async {
  342. _model.tabJeugdGeladen = true;
  343. safeSetState(() {});
  344. }
  345. ][i]();
  346. },
  347. ),
  348. ),
  349. Expanded(
  350. child: TabBarView(
  351. controller: _model.tabBarController,
  352. children: [
  353. Column(
  354. mainAxisSize: MainAxisSize.max,
  355. children: [
  356. Expanded(
  357. child: wrapWithModel(
  358. model: _model
  359. .homeUitgaantabelKaartComponentModel1,
  360. updateCallback: () => safeSetState(() {}),
  361. child: Builder(builder: (_) {
  362. return DebugFlutterFlowModelContext(
  363. rootModel: _model.rootModel,
  364. child:
  365. HomeUitgaantabelKaartComponentWidget(
  366. key: ValueKey(FFAppState().datumFilter),
  367. displayid: 'services_3',
  368. datumVan: functions.filterDatumVan(
  369. FFAppState().datumFilter),
  370. datumTot: functions.filterDatumTot(
  371. FFAppState().datumFilter),
  372. ),
  373. );
  374. }),
  375. ),
  376. ),
  377. ],
  378. ),
  379. Builder(
  380. builder: (context) {
  381. if (_model.tabActiviteitenGeladen) {
  382. return Column(
  383. mainAxisSize: MainAxisSize.max,
  384. children: [
  385. Expanded(
  386. child: wrapWithModel(
  387. model: _model
  388. .homeUitgaantabelKaartComponentModel2,
  389. updateCallback: () =>
  390. safeSetState(() {}),
  391. child: Builder(builder: (_) {
  392. return DebugFlutterFlowModelContext(
  393. rootModel: _model.rootModel,
  394. child:
  395. HomeUitgaantabelKaartComponentWidget(
  396. key: ValueKey(
  397. FFAppState().datumFilter),
  398. displayid: 'services_4',
  399. datumVan:
  400. functions.filterDatumVan(
  401. FFAppState().datumFilter),
  402. datumTot:
  403. functions.filterDatumTot(
  404. FFAppState().datumFilter),
  405. ),
  406. );
  407. }),
  408. ),
  409. ),
  410. ],
  411. );
  412. } else {
  413. return Container(
  414. width: 100.0,
  415. height: 100.0,
  416. decoration: BoxDecoration(
  417. color: FlutterFlowTheme.of(context)
  418. .secondaryBackground,
  419. ),
  420. );
  421. }
  422. },
  423. ),
  424. Builder(
  425. builder: (context) {
  426. if (_model.tabCultuurGeladen) {
  427. return Column(
  428. mainAxisSize: MainAxisSize.max,
  429. children: [
  430. Expanded(
  431. child: wrapWithModel(
  432. model: _model
  433. .homeUitgaantabelKaartComponentModel3,
  434. updateCallback: () =>
  435. safeSetState(() {}),
  436. child: Builder(builder: (_) {
  437. return DebugFlutterFlowModelContext(
  438. rootModel: _model.rootModel,
  439. child:
  440. HomeUitgaantabelKaartComponentWidget(
  441. key: ValueKey(
  442. FFAppState().datumFilter),
  443. displayid: 'services_5',
  444. datumVan:
  445. functions.filterDatumVan(
  446. FFAppState().datumFilter),
  447. datumTot:
  448. functions.filterDatumTot(
  449. FFAppState().datumFilter),
  450. ),
  451. );
  452. }),
  453. ),
  454. ),
  455. ],
  456. );
  457. } else {
  458. return Container(
  459. width: 100.0,
  460. height: 100.0,
  461. decoration: BoxDecoration(
  462. color: FlutterFlowTheme.of(context)
  463. .secondaryBackground,
  464. ),
  465. );
  466. }
  467. },
  468. ),
  469. Builder(
  470. builder: (context) {
  471. if (_model.tabFilmsGeladen) {
  472. return Column(
  473. mainAxisSize: MainAxisSize.max,
  474. children: [
  475. Expanded(
  476. child: wrapWithModel(
  477. model: _model
  478. .homeUitgaantabelKaartComponentModel4,
  479. updateCallback: () =>
  480. safeSetState(() {}),
  481. child: Builder(builder: (_) {
  482. return DebugFlutterFlowModelContext(
  483. rootModel: _model.rootModel,
  484. child:
  485. HomeUitgaantabelKaartComponentWidget(
  486. key: ValueKey(
  487. FFAppState().datumFilter),
  488. displayid: 'services_6',
  489. datumVan:
  490. functions.filterDatumVan(
  491. FFAppState().datumFilter),
  492. datumTot:
  493. functions.filterDatumTot(
  494. FFAppState().datumFilter),
  495. ),
  496. );
  497. }),
  498. ),
  499. ),
  500. ],
  501. );
  502. } else {
  503. return Container(
  504. width: 100.0,
  505. height: 100.0,
  506. decoration: BoxDecoration(
  507. color: FlutterFlowTheme.of(context)
  508. .secondaryBackground,
  509. ),
  510. );
  511. }
  512. },
  513. ),
  514. Builder(
  515. builder: (context) {
  516. if (_model.tabJeugdGeladen) {
  517. return Column(
  518. mainAxisSize: MainAxisSize.max,
  519. children: [
  520. Expanded(
  521. child: wrapWithModel(
  522. model: _model
  523. .homeUitgaantabelKaartComponentModel5,
  524. updateCallback: () =>
  525. safeSetState(() {}),
  526. child: Builder(builder: (_) {
  527. return DebugFlutterFlowModelContext(
  528. rootModel: _model.rootModel,
  529. child:
  530. HomeUitgaantabelKaartComponentWidget(
  531. key: ValueKey(
  532. FFAppState().datumFilter),
  533. displayid: 'services_7',
  534. datumVan:
  535. functions.filterDatumVan(
  536. FFAppState().datumFilter),
  537. datumTot:
  538. functions.filterDatumTot(
  539. FFAppState().datumFilter),
  540. ),
  541. );
  542. }),
  543. ),
  544. ),
  545. ],
  546. );
  547. } else {
  548. return Container(
  549. width: 100.0,
  550. height: 100.0,
  551. decoration: BoxDecoration(
  552. color: FlutterFlowTheme.of(context)
  553. .secondaryBackground,
  554. ),
  555. );
  556. }
  557. },
  558. ),
  559. ],
  560. ),
  561. ),
  562. ],
  563. ),
  564. ),
  565. ],
  566. ),
  567. ),
  568. ),
  569. );
  570. }
  571. }