home_copy_widget.dart 29 KB

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