home_widget.dart 19 KB

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