home_widget.dart 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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. parameter1: _model.zoekOpen,
  180. ),
  181. );
  182. }),
  183. ),
  184. Expanded(
  185. child: Column(
  186. children: [
  187. Align(
  188. alignment: Alignment(0.0, 0),
  189. child: TabBar(
  190. isScrollable: true,
  191. tabAlignment: TabAlignment.center,
  192. labelColor: FlutterFlowTheme.of(context).primaryText,
  193. unselectedLabelColor:
  194. FlutterFlowTheme.of(context).secondaryText,
  195. labelStyle:
  196. FlutterFlowTheme.of(context).titleMedium.override(
  197. font: GoogleFonts.roboto(
  198. fontWeight: FlutterFlowTheme.of(context)
  199. .titleMedium
  200. .fontWeight,
  201. fontStyle: FlutterFlowTheme.of(context)
  202. .titleMedium
  203. .fontStyle,
  204. ),
  205. letterSpacing: 0.0,
  206. fontWeight: FlutterFlowTheme.of(context)
  207. .titleMedium
  208. .fontWeight,
  209. fontStyle: FlutterFlowTheme.of(context)
  210. .titleMedium
  211. .fontStyle,
  212. ),
  213. unselectedLabelStyle:
  214. FlutterFlowTheme.of(context).titleMedium.override(
  215. font: GoogleFonts.roboto(
  216. fontWeight: FlutterFlowTheme.of(context)
  217. .titleMedium
  218. .fontWeight,
  219. fontStyle: FlutterFlowTheme.of(context)
  220. .titleMedium
  221. .fontStyle,
  222. ),
  223. letterSpacing: 0.0,
  224. fontWeight: FlutterFlowTheme.of(context)
  225. .titleMedium
  226. .fontWeight,
  227. fontStyle: FlutterFlowTheme.of(context)
  228. .titleMedium
  229. .fontStyle,
  230. ),
  231. indicatorColor: FlutterFlowTheme.of(context).secondary,
  232. tabs: [
  233. Tab(
  234. text: FFLocalizations.of(context).getText(
  235. 'eor4c9rz' /* Uitgaan */,
  236. ),
  237. ),
  238. Tab(
  239. text: FFLocalizations.of(context).getText(
  240. 'mx7sn4ne' /* Activiteiten */,
  241. ),
  242. ),
  243. Tab(
  244. text: FFLocalizations.of(context).getText(
  245. 'e6xyyt74' /* Cultuur & Info */,
  246. ),
  247. ),
  248. Tab(
  249. text: FFLocalizations.of(context).getText(
  250. 'uxy2nfok' /* Films */,
  251. ),
  252. ),
  253. Tab(
  254. text: FFLocalizations.of(context).getText(
  255. 'lx77xfrn' /* Jeugd */,
  256. ),
  257. ),
  258. ],
  259. controller: _model.tabBarController,
  260. onTap: (i) async {
  261. [
  262. () async {},
  263. () async {
  264. _model.tabActiviteitenGeladen = true;
  265. safeSetState(() {});
  266. },
  267. () async {
  268. _model.tabCultuurGeladen = true;
  269. safeSetState(() {});
  270. },
  271. () async {
  272. _model.tabFilmsGeladen = true;
  273. safeSetState(() {});
  274. },
  275. () async {
  276. _model.tabJeugdGeladen = true;
  277. safeSetState(() {});
  278. }
  279. ][i]();
  280. },
  281. ),
  282. ),
  283. Expanded(
  284. child: TabBarView(
  285. controller: _model.tabBarController,
  286. children: [
  287. Column(
  288. mainAxisSize: MainAxisSize.max,
  289. children: [
  290. Expanded(
  291. child: wrapWithModel(
  292. model: _model
  293. .homeUitgaantabelKaartComponentModel1,
  294. updateCallback: () => safeSetState(() {}),
  295. child: Builder(builder: (_) {
  296. return DebugFlutterFlowModelContext(
  297. rootModel: _model.rootModel,
  298. child:
  299. HomeUitgaantabelKaartComponentWidget(
  300. key: ValueKey(FFAppState().datumFilter),
  301. displayid: 'services_3',
  302. datumVan: functions.filterDatumVan(
  303. FFAppState().datumFilter),
  304. datumTot: functions.filterDatumTot(
  305. FFAppState().datumFilter),
  306. zoekterm: FFAppState().zoekterm,
  307. ),
  308. );
  309. }),
  310. ),
  311. ),
  312. ],
  313. ),
  314. Builder(
  315. builder: (context) {
  316. if (_model.tabActiviteitenGeladen) {
  317. return Column(
  318. mainAxisSize: MainAxisSize.max,
  319. children: [
  320. Expanded(
  321. child: wrapWithModel(
  322. model: _model
  323. .homeUitgaantabelKaartComponentModel2,
  324. updateCallback: () =>
  325. safeSetState(() {}),
  326. child: Builder(builder: (_) {
  327. return DebugFlutterFlowModelContext(
  328. rootModel: _model.rootModel,
  329. child:
  330. HomeUitgaantabelKaartComponentWidget(
  331. key: ValueKey(
  332. FFAppState().datumFilter),
  333. displayid: 'services_4',
  334. datumVan:
  335. functions.filterDatumVan(
  336. FFAppState().datumFilter),
  337. datumTot:
  338. functions.filterDatumTot(
  339. FFAppState().datumFilter),
  340. zoekterm: FFAppState().zoekterm,
  341. ),
  342. );
  343. }),
  344. ),
  345. ),
  346. ],
  347. );
  348. } else {
  349. return Container(
  350. width: 100.0,
  351. height: 100.0,
  352. decoration: BoxDecoration(
  353. color: FlutterFlowTheme.of(context)
  354. .secondaryBackground,
  355. ),
  356. );
  357. }
  358. },
  359. ),
  360. Builder(
  361. builder: (context) {
  362. if (_model.tabCultuurGeladen) {
  363. return Column(
  364. mainAxisSize: MainAxisSize.max,
  365. children: [
  366. Expanded(
  367. child: wrapWithModel(
  368. model: _model
  369. .homeUitgaantabelKaartComponentModel3,
  370. updateCallback: () =>
  371. safeSetState(() {}),
  372. child: Builder(builder: (_) {
  373. return DebugFlutterFlowModelContext(
  374. rootModel: _model.rootModel,
  375. child:
  376. HomeUitgaantabelKaartComponentWidget(
  377. key: ValueKey(
  378. FFAppState().datumFilter),
  379. displayid: 'services_5',
  380. datumVan:
  381. functions.filterDatumVan(
  382. FFAppState().datumFilter),
  383. datumTot:
  384. functions.filterDatumTot(
  385. FFAppState().datumFilter),
  386. zoekterm: FFAppState().zoekterm,
  387. ),
  388. );
  389. }),
  390. ),
  391. ),
  392. ],
  393. );
  394. } else {
  395. return Container(
  396. width: 100.0,
  397. height: 100.0,
  398. decoration: BoxDecoration(
  399. color: FlutterFlowTheme.of(context)
  400. .secondaryBackground,
  401. ),
  402. );
  403. }
  404. },
  405. ),
  406. Builder(
  407. builder: (context) {
  408. if (_model.tabFilmsGeladen) {
  409. return Column(
  410. mainAxisSize: MainAxisSize.max,
  411. children: [
  412. Expanded(
  413. child: wrapWithModel(
  414. model: _model
  415. .homeUitgaantabelKaartComponentModel4,
  416. updateCallback: () =>
  417. safeSetState(() {}),
  418. child: Builder(builder: (_) {
  419. return DebugFlutterFlowModelContext(
  420. rootModel: _model.rootModel,
  421. child:
  422. HomeUitgaantabelKaartComponentWidget(
  423. key: ValueKey(
  424. FFAppState().datumFilter),
  425. displayid: 'services_6',
  426. datumVan:
  427. functions.filterDatumVan(
  428. FFAppState().datumFilter),
  429. datumTot:
  430. functions.filterDatumTot(
  431. FFAppState().datumFilter),
  432. zoekterm: FFAppState().zoekterm,
  433. ),
  434. );
  435. }),
  436. ),
  437. ),
  438. ],
  439. );
  440. } else {
  441. return Container(
  442. width: 100.0,
  443. height: 100.0,
  444. decoration: BoxDecoration(
  445. color: FlutterFlowTheme.of(context)
  446. .secondaryBackground,
  447. ),
  448. );
  449. }
  450. },
  451. ),
  452. Builder(
  453. builder: (context) {
  454. if (_model.tabJeugdGeladen) {
  455. return Column(
  456. mainAxisSize: MainAxisSize.max,
  457. children: [
  458. Expanded(
  459. child: wrapWithModel(
  460. model: _model
  461. .homeUitgaantabelKaartComponentModel5,
  462. updateCallback: () =>
  463. safeSetState(() {}),
  464. child: Builder(builder: (_) {
  465. return DebugFlutterFlowModelContext(
  466. rootModel: _model.rootModel,
  467. child:
  468. HomeUitgaantabelKaartComponentWidget(
  469. key: ValueKey(
  470. FFAppState().datumFilter),
  471. displayid: 'services_7',
  472. datumVan:
  473. functions.filterDatumVan(
  474. FFAppState().datumFilter),
  475. datumTot:
  476. functions.filterDatumTot(
  477. FFAppState().datumFilter),
  478. zoekterm: FFAppState().zoekterm,
  479. ),
  480. );
  481. }),
  482. ),
  483. ),
  484. ],
  485. );
  486. } else {
  487. return Container(
  488. width: 100.0,
  489. height: 100.0,
  490. decoration: BoxDecoration(
  491. color: FlutterFlowTheme.of(context)
  492. .secondaryBackground,
  493. ),
  494. );
  495. }
  496. },
  497. ),
  498. ],
  499. ),
  500. ),
  501. ],
  502. ),
  503. ),
  504. ],
  505. ),
  506. ),
  507. ),
  508. );
  509. }
  510. }