home_widget.dart 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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/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 '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. return GestureDetector(
  89. onTap: () {
  90. FocusScope.of(context).unfocus();
  91. FocusManager.instance.primaryFocus?.unfocus();
  92. },
  93. child: Scaffold(
  94. key: scaffoldKey,
  95. backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  96. drawer: Drawer(
  97. elevation: 16.0,
  98. child: wrapWithModel(
  99. model: _model.drawerComponentModel,
  100. updateCallback: () => safeSetState(() {}),
  101. child: Builder(builder: (_) {
  102. return DebugFlutterFlowModelContext(
  103. rootModel: _model.rootModel,
  104. child: DrawerComponentWidget(),
  105. );
  106. }),
  107. ),
  108. ),
  109. appBar: PreferredSize(
  110. preferredSize: Size.fromHeight(50.0),
  111. child: AppBar(
  112. backgroundColor: Color(0xFF3E454C),
  113. iconTheme:
  114. IconThemeData(color: FlutterFlowTheme.of(context).secondary),
  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: FlutterFlowTheme.of(context).secondary,
  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. ],
  137. ),
  138. ),
  139. background: wrapWithModel(
  140. model: _model.headerButtonsComponentModel,
  141. updateCallback: () => safeSetState(() {}),
  142. child: Builder(builder: (_) {
  143. return DebugFlutterFlowModelContext(
  144. rootModel: _model.rootModel,
  145. child: HeaderButtonsComponentWidget(
  146. showBackButton: false,
  147. ),
  148. );
  149. }),
  150. ),
  151. centerTitle: true,
  152. expandedTitleScale: 1.0,
  153. ),
  154. bottom: PreferredSize(
  155. preferredSize: Size.fromHeight(70.0),
  156. child: Container(),
  157. ),
  158. toolbarHeight: MediaQuery.sizeOf(context).height * 0.25,
  159. elevation: 2.0,
  160. ),
  161. ),
  162. body: SafeArea(
  163. top: true,
  164. child: Column(
  165. mainAxisSize: MainAxisSize.max,
  166. children: [
  167. Material(
  168. color: Colors.transparent,
  169. elevation: 2.0,
  170. child: Container(
  171. height: 250.0,
  172. decoration: BoxDecoration(
  173. border: Border.all(
  174. width: 0.0,
  175. ),
  176. ),
  177. child: wrapWithModel(
  178. model: _model.homeUitgaanSliderComponentModel,
  179. updateCallback: () => safeSetState(() {}),
  180. child: Builder(builder: (_) {
  181. return DebugFlutterFlowModelContext(
  182. rootModel: _model.rootModel,
  183. child: HomeUitgaanSliderComponentWidget(
  184. displayid: 'services_1',
  185. ),
  186. );
  187. }),
  188. ),
  189. ),
  190. ),
  191. Expanded(
  192. child: Column(
  193. children: [
  194. Align(
  195. alignment: Alignment(0.0, 0),
  196. child: TabBar(
  197. isScrollable: true,
  198. tabAlignment: TabAlignment.center,
  199. labelColor: FlutterFlowTheme.of(context).primaryText,
  200. unselectedLabelColor:
  201. FlutterFlowTheme.of(context).secondaryText,
  202. labelStyle:
  203. FlutterFlowTheme.of(context).titleMedium.override(
  204. font: GoogleFonts.roboto(
  205. fontWeight: FlutterFlowTheme.of(context)
  206. .titleMedium
  207. .fontWeight,
  208. fontStyle: FlutterFlowTheme.of(context)
  209. .titleMedium
  210. .fontStyle,
  211. ),
  212. letterSpacing: 0.0,
  213. fontWeight: FlutterFlowTheme.of(context)
  214. .titleMedium
  215. .fontWeight,
  216. fontStyle: FlutterFlowTheme.of(context)
  217. .titleMedium
  218. .fontStyle,
  219. ),
  220. unselectedLabelStyle:
  221. FlutterFlowTheme.of(context).titleMedium.override(
  222. font: GoogleFonts.roboto(
  223. fontWeight: FlutterFlowTheme.of(context)
  224. .titleMedium
  225. .fontWeight,
  226. fontStyle: FlutterFlowTheme.of(context)
  227. .titleMedium
  228. .fontStyle,
  229. ),
  230. letterSpacing: 0.0,
  231. fontWeight: FlutterFlowTheme.of(context)
  232. .titleMedium
  233. .fontWeight,
  234. fontStyle: FlutterFlowTheme.of(context)
  235. .titleMedium
  236. .fontStyle,
  237. ),
  238. indicatorColor: FlutterFlowTheme.of(context).secondary,
  239. tabs: [
  240. Tab(
  241. text: FFLocalizations.of(context).getText(
  242. 'eor4c9rz' /* Uitgaan */,
  243. ),
  244. ),
  245. Tab(
  246. text: FFLocalizations.of(context).getText(
  247. 'mx7sn4ne' /* Activiteiten */,
  248. ),
  249. ),
  250. Tab(
  251. text: FFLocalizations.of(context).getText(
  252. 'e6xyyt74' /* Cultuur */,
  253. ),
  254. ),
  255. Tab(
  256. text: FFLocalizations.of(context).getText(
  257. 'uxy2nfok' /* Films */,
  258. ),
  259. ),
  260. Tab(
  261. text: FFLocalizations.of(context).getText(
  262. 'lx77xfrn' /* Jeugd */,
  263. ),
  264. ),
  265. ],
  266. controller: _model.tabBarController,
  267. onTap: (i) async {
  268. [
  269. () async {},
  270. () async {
  271. _model.tabActiviteitenGeladen = true;
  272. safeSetState(() {});
  273. },
  274. () async {
  275. _model.tabCultuurGeladen = true;
  276. safeSetState(() {});
  277. },
  278. () async {
  279. _model.tabFilmsGeladen = true;
  280. safeSetState(() {});
  281. },
  282. () async {
  283. _model.tabJeugdGeladen = true;
  284. safeSetState(() {});
  285. }
  286. ][i]();
  287. },
  288. ),
  289. ),
  290. Expanded(
  291. child: TabBarView(
  292. controller: _model.tabBarController,
  293. children: [
  294. SingleChildScrollView(
  295. child: Column(
  296. mainAxisSize: MainAxisSize.max,
  297. children: [
  298. wrapWithModel(
  299. model: _model
  300. .homeUitgaantabelKaartComponentModel1,
  301. updateCallback: () => safeSetState(() {}),
  302. child: Builder(builder: (_) {
  303. return DebugFlutterFlowModelContext(
  304. rootModel: _model.rootModel,
  305. child:
  306. HomeUitgaantabelKaartComponentWidget(
  307. displayid: 'services_3',
  308. ),
  309. );
  310. }),
  311. ),
  312. ],
  313. ),
  314. ),
  315. Builder(
  316. builder: (context) {
  317. if (_model.tabActiviteitenGeladen) {
  318. return SingleChildScrollView(
  319. child: Column(
  320. mainAxisSize: MainAxisSize.max,
  321. children: [
  322. wrapWithModel(
  323. model: _model
  324. .homeUitgaantabelKaartComponentModel2,
  325. updateCallback: () =>
  326. safeSetState(() {}),
  327. child: Builder(builder: (_) {
  328. return DebugFlutterFlowModelContext(
  329. rootModel: _model.rootModel,
  330. child:
  331. HomeUitgaantabelKaartComponentWidget(
  332. displayid: 'services_4',
  333. ),
  334. );
  335. }),
  336. ),
  337. ],
  338. ),
  339. );
  340. } else {
  341. return Container(
  342. width: 100.0,
  343. height: 100.0,
  344. decoration: BoxDecoration(
  345. color: FlutterFlowTheme.of(context)
  346. .secondaryBackground,
  347. ),
  348. );
  349. }
  350. },
  351. ),
  352. Builder(
  353. builder: (context) {
  354. if (_model.tabCultuurGeladen) {
  355. return SingleChildScrollView(
  356. child: Column(
  357. mainAxisSize: MainAxisSize.max,
  358. children: [
  359. wrapWithModel(
  360. model: _model
  361. .homeUitgaantabelKaartComponentModel3,
  362. updateCallback: () =>
  363. safeSetState(() {}),
  364. child: Builder(builder: (_) {
  365. return DebugFlutterFlowModelContext(
  366. rootModel: _model.rootModel,
  367. child:
  368. HomeUitgaantabelKaartComponentWidget(
  369. displayid: 'services_5',
  370. ),
  371. );
  372. }),
  373. ),
  374. ],
  375. ),
  376. );
  377. } else {
  378. return Container(
  379. width: 100.0,
  380. height: 100.0,
  381. decoration: BoxDecoration(
  382. color: FlutterFlowTheme.of(context)
  383. .secondaryBackground,
  384. ),
  385. );
  386. }
  387. },
  388. ),
  389. Builder(
  390. builder: (context) {
  391. if (_model.tabFilmsGeladen) {
  392. return SingleChildScrollView(
  393. child: Column(
  394. mainAxisSize: MainAxisSize.max,
  395. children: [
  396. wrapWithModel(
  397. model: _model
  398. .homeUitgaantabelKaartComponentModel4,
  399. updateCallback: () =>
  400. safeSetState(() {}),
  401. child: Builder(builder: (_) {
  402. return DebugFlutterFlowModelContext(
  403. rootModel: _model.rootModel,
  404. child:
  405. HomeUitgaantabelKaartComponentWidget(
  406. displayid: 'services_6',
  407. ),
  408. );
  409. }),
  410. ),
  411. ],
  412. ),
  413. );
  414. } else {
  415. return Container(
  416. width: 100.0,
  417. height: 100.0,
  418. decoration: BoxDecoration(
  419. color: FlutterFlowTheme.of(context)
  420. .secondaryBackground,
  421. ),
  422. );
  423. }
  424. },
  425. ),
  426. Builder(
  427. builder: (context) {
  428. if (_model.tabJeugdGeladen) {
  429. return SingleChildScrollView(
  430. child: Column(
  431. mainAxisSize: MainAxisSize.max,
  432. children: [
  433. wrapWithModel(
  434. model: _model
  435. .homeUitgaantabelKaartComponentModel5,
  436. updateCallback: () =>
  437. safeSetState(() {}),
  438. child: Builder(builder: (_) {
  439. return DebugFlutterFlowModelContext(
  440. rootModel: _model.rootModel,
  441. child:
  442. HomeUitgaantabelKaartComponentWidget(
  443. displayid: 'services_7',
  444. ),
  445. );
  446. }),
  447. ),
  448. ],
  449. ),
  450. );
  451. } else {
  452. return Container(
  453. width: 100.0,
  454. height: 100.0,
  455. decoration: BoxDecoration(
  456. color: FlutterFlowTheme.of(context)
  457. .secondaryBackground,
  458. ),
  459. );
  460. }
  461. },
  462. ),
  463. ],
  464. ),
  465. ),
  466. ],
  467. ),
  468. ),
  469. ],
  470. ),
  471. ),
  472. ),
  473. );
  474. }
  475. }