home_widget.dart 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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: 2.0,
  148. child: Container(
  149. height: 250.0,
  150. decoration: BoxDecoration(
  151. border: Border.all(
  152. width: 0.0,
  153. ),
  154. ),
  155. child: wrapWithModel(
  156. model: _model.homeUitgaanSliderComponentModel,
  157. updateCallback: () => safeSetState(() {}),
  158. child: Builder(builder: (_) {
  159. return DebugFlutterFlowModelContext(
  160. rootModel: _model.rootModel,
  161. child: HomeUitgaanSliderComponentWidget(
  162. displayid: 'services_1',
  163. ),
  164. );
  165. }),
  166. ),
  167. ),
  168. ),
  169. Expanded(
  170. child: Column(
  171. children: [
  172. Align(
  173. alignment: Alignment(0.0, 0),
  174. child: TabBar(
  175. isScrollable: true,
  176. tabAlignment: TabAlignment.center,
  177. labelColor: FlutterFlowTheme.of(context).primaryText,
  178. unselectedLabelColor:
  179. FlutterFlowTheme.of(context).secondaryText,
  180. labelStyle:
  181. FlutterFlowTheme.of(context).titleMedium.override(
  182. font: GoogleFonts.roboto(
  183. fontWeight: FlutterFlowTheme.of(context)
  184. .titleMedium
  185. .fontWeight,
  186. fontStyle: FlutterFlowTheme.of(context)
  187. .titleMedium
  188. .fontStyle,
  189. ),
  190. letterSpacing: 0.0,
  191. fontWeight: FlutterFlowTheme.of(context)
  192. .titleMedium
  193. .fontWeight,
  194. fontStyle: FlutterFlowTheme.of(context)
  195. .titleMedium
  196. .fontStyle,
  197. ),
  198. unselectedLabelStyle:
  199. FlutterFlowTheme.of(context).titleMedium.override(
  200. font: GoogleFonts.roboto(
  201. fontWeight: FlutterFlowTheme.of(context)
  202. .titleMedium
  203. .fontWeight,
  204. fontStyle: FlutterFlowTheme.of(context)
  205. .titleMedium
  206. .fontStyle,
  207. ),
  208. letterSpacing: 0.0,
  209. fontWeight: FlutterFlowTheme.of(context)
  210. .titleMedium
  211. .fontWeight,
  212. fontStyle: FlutterFlowTheme.of(context)
  213. .titleMedium
  214. .fontStyle,
  215. ),
  216. indicatorColor: FlutterFlowTheme.of(context).secondary,
  217. tabs: [
  218. Tab(
  219. text: FFLocalizations.of(context).getText(
  220. 'eor4c9rz' /* Uitgaan */,
  221. ),
  222. ),
  223. Tab(
  224. text: FFLocalizations.of(context).getText(
  225. 'mx7sn4ne' /* Activiteiten */,
  226. ),
  227. ),
  228. Tab(
  229. text: FFLocalizations.of(context).getText(
  230. 'e6xyyt74' /* Cultuur & Info */,
  231. ),
  232. ),
  233. Tab(
  234. text: FFLocalizations.of(context).getText(
  235. 'uxy2nfok' /* Films */,
  236. ),
  237. ),
  238. Tab(
  239. text: FFLocalizations.of(context).getText(
  240. 'lx77xfrn' /* Jeugd */,
  241. ),
  242. ),
  243. ],
  244. controller: _model.tabBarController,
  245. onTap: (i) async {
  246. [
  247. () async {},
  248. () async {
  249. _model.tabActiviteitenGeladen = true;
  250. safeSetState(() {});
  251. },
  252. () async {
  253. _model.tabCultuurGeladen = true;
  254. safeSetState(() {});
  255. },
  256. () async {
  257. _model.tabFilmsGeladen = true;
  258. safeSetState(() {});
  259. },
  260. () async {
  261. _model.tabJeugdGeladen = true;
  262. safeSetState(() {});
  263. }
  264. ][i]();
  265. },
  266. ),
  267. ),
  268. Expanded(
  269. child: TabBarView(
  270. controller: _model.tabBarController,
  271. children: [
  272. Column(
  273. mainAxisSize: MainAxisSize.max,
  274. children: [
  275. Expanded(
  276. child: wrapWithModel(
  277. model: _model
  278. .homeUitgaantabelKaartComponentModel1,
  279. updateCallback: () => safeSetState(() {}),
  280. child: Builder(builder: (_) {
  281. return DebugFlutterFlowModelContext(
  282. rootModel: _model.rootModel,
  283. child:
  284. HomeUitgaantabelKaartComponentWidget(
  285. displayid: 'services_3',
  286. ),
  287. );
  288. }),
  289. ),
  290. ),
  291. ],
  292. ),
  293. Builder(
  294. builder: (context) {
  295. if (_model.tabActiviteitenGeladen) {
  296. return Column(
  297. mainAxisSize: MainAxisSize.max,
  298. children: [
  299. Expanded(
  300. child: wrapWithModel(
  301. model: _model
  302. .homeUitgaantabelKaartComponentModel2,
  303. updateCallback: () =>
  304. safeSetState(() {}),
  305. child: Builder(builder: (_) {
  306. return DebugFlutterFlowModelContext(
  307. rootModel: _model.rootModel,
  308. child:
  309. HomeUitgaantabelKaartComponentWidget(
  310. displayid: 'services_4',
  311. ),
  312. );
  313. }),
  314. ),
  315. ),
  316. ],
  317. );
  318. } else {
  319. return Container(
  320. width: 100.0,
  321. height: 100.0,
  322. decoration: BoxDecoration(
  323. color: FlutterFlowTheme.of(context)
  324. .secondaryBackground,
  325. ),
  326. );
  327. }
  328. },
  329. ),
  330. Builder(
  331. builder: (context) {
  332. if (_model.tabCultuurGeladen) {
  333. return Column(
  334. mainAxisSize: MainAxisSize.max,
  335. children: [
  336. Expanded(
  337. child: wrapWithModel(
  338. model: _model
  339. .homeUitgaantabelKaartComponentModel3,
  340. updateCallback: () =>
  341. safeSetState(() {}),
  342. child: Builder(builder: (_) {
  343. return DebugFlutterFlowModelContext(
  344. rootModel: _model.rootModel,
  345. child:
  346. HomeUitgaantabelKaartComponentWidget(
  347. displayid: 'services_5',
  348. ),
  349. );
  350. }),
  351. ),
  352. ),
  353. ],
  354. );
  355. } else {
  356. return Container(
  357. width: 100.0,
  358. height: 100.0,
  359. decoration: BoxDecoration(
  360. color: FlutterFlowTheme.of(context)
  361. .secondaryBackground,
  362. ),
  363. );
  364. }
  365. },
  366. ),
  367. Builder(
  368. builder: (context) {
  369. if (_model.tabFilmsGeladen) {
  370. return Column(
  371. mainAxisSize: MainAxisSize.max,
  372. children: [
  373. Expanded(
  374. child: wrapWithModel(
  375. model: _model
  376. .homeUitgaantabelKaartComponentModel4,
  377. updateCallback: () =>
  378. safeSetState(() {}),
  379. child: Builder(builder: (_) {
  380. return DebugFlutterFlowModelContext(
  381. rootModel: _model.rootModel,
  382. child:
  383. HomeUitgaantabelKaartComponentWidget(
  384. displayid: 'services_6',
  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.tabJeugdGeladen) {
  407. return Column(
  408. mainAxisSize: MainAxisSize.max,
  409. children: [
  410. Expanded(
  411. child: wrapWithModel(
  412. model: _model
  413. .homeUitgaantabelKaartComponentModel5,
  414. updateCallback: () =>
  415. safeSetState(() {}),
  416. child: Builder(builder: (_) {
  417. return DebugFlutterFlowModelContext(
  418. rootModel: _model.rootModel,
  419. child:
  420. HomeUitgaantabelKaartComponentWidget(
  421. displayid: 'services_7',
  422. ),
  423. );
  424. }),
  425. ),
  426. ),
  427. ],
  428. );
  429. } else {
  430. return Container(
  431. width: 100.0,
  432. height: 100.0,
  433. decoration: BoxDecoration(
  434. color: FlutterFlowTheme.of(context)
  435. .secondaryBackground,
  436. ),
  437. );
  438. }
  439. },
  440. ),
  441. ],
  442. ),
  443. ),
  444. ],
  445. ),
  446. ),
  447. ],
  448. ),
  449. ),
  450. ),
  451. );
  452. }
  453. }