home_widget.dart 23 KB

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