home_widget.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. import '/flutter_flow/flutter_flow_icon_button.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/p_uitgaan_slider_component/p_uitgaan_slider_component_widget.dart';
  7. import '/uitgaanspaginas/uitgaantabel_kaart_component/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. context.watch<FFAppState>();
  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(80.0),
  111. child: AppBar(
  112. backgroundColor: FlutterFlowTheme.of(context).info,
  113. iconTheme: IconThemeData(color: Color(0xFFB12727)),
  114. automaticallyImplyLeading: false,
  115. actions: [],
  116. flexibleSpace: FlexibleSpaceBar(
  117. title: Align(
  118. alignment: AlignmentDirectional(0.0, 0.0),
  119. child: Row(
  120. mainAxisSize: MainAxisSize.max,
  121. children: [
  122. FlutterFlowIconButton(
  123. borderRadius: 8.0,
  124. buttonSize: 40.0,
  125. fillColor: Color(0xFFB50808),
  126. icon: Icon(
  127. Icons.dehaze_outlined,
  128. color: FlutterFlowTheme.of(context).info,
  129. size: 24.0,
  130. ),
  131. onPressed: () async {
  132. scaffoldKey.currentState!.openDrawer();
  133. },
  134. ),
  135. Padding(
  136. padding:
  137. EdgeInsetsDirectional.fromSTEB(4.0, 0.0, 0.0, 0.0),
  138. child: FlutterFlowIconButton(
  139. borderColor: Color(0x00FF0000),
  140. borderRadius: 30.0,
  141. borderWidth: 1.0,
  142. buttonSize: 50.0,
  143. fillColor: Color(0xFFB50808),
  144. icon: Icon(
  145. Icons.arrow_back_outlined,
  146. color: Colors.white,
  147. size: 30.0,
  148. ),
  149. onPressed: () async {
  150. context.pop();
  151. },
  152. ),
  153. ),
  154. ],
  155. ),
  156. ),
  157. background: Align(
  158. alignment: AlignmentDirectional(0.0, 0.0),
  159. child: Padding(
  160. padding: EdgeInsetsDirectional.fromSTEB(60.0, 0.0, 5.0, 0.0),
  161. child: ClipRRect(
  162. borderRadius: BorderRadius.circular(8.0),
  163. child: Image.asset(
  164. 'assets/images/logo800px.png',
  165. width: () {
  166. if (MediaQuery.sizeOf(context).width <
  167. kBreakpointSmall) {
  168. return 150.0;
  169. } else if (MediaQuery.sizeOf(context).width <
  170. kBreakpointMedium) {
  171. return 225.0;
  172. } else if (MediaQuery.sizeOf(context).width <
  173. kBreakpointLarge) {
  174. return 350.0;
  175. } else {
  176. return 400.0;
  177. }
  178. }(),
  179. fit: BoxFit.fitWidth,
  180. ),
  181. ),
  182. ),
  183. ),
  184. centerTitle: true,
  185. expandedTitleScale: 1.0,
  186. ),
  187. bottom: PreferredSize(
  188. preferredSize: Size.fromHeight(70.0),
  189. child: Container(),
  190. ),
  191. toolbarHeight: MediaQuery.sizeOf(context).height * 0.25,
  192. elevation: 2.0,
  193. ),
  194. ),
  195. body: SafeArea(
  196. top: true,
  197. child: Column(
  198. mainAxisSize: MainAxisSize.max,
  199. children: [
  200. Material(
  201. color: Colors.transparent,
  202. elevation: 2.0,
  203. child: Container(
  204. height: 250.0,
  205. decoration: BoxDecoration(
  206. color: Color(0xFFF5A2A2),
  207. border: Border.all(
  208. color: Color(0xFFCAC3C3),
  209. width: 2.0,
  210. ),
  211. ),
  212. child: wrapWithModel(
  213. model: _model.pUitgaanSliderComponentModel,
  214. updateCallback: () => safeSetState(() {}),
  215. child: Builder(builder: (_) {
  216. return DebugFlutterFlowModelContext(
  217. rootModel: _model.rootModel,
  218. child: PUitgaanSliderComponentWidget(
  219. displayid: 'services_1',
  220. ),
  221. );
  222. }),
  223. ),
  224. ),
  225. ),
  226. Expanded(
  227. child: Column(
  228. children: [
  229. Align(
  230. alignment: Alignment(0.0, 0),
  231. child: TabBar(
  232. labelColor: FlutterFlowTheme.of(context).primaryText,
  233. unselectedLabelColor:
  234. FlutterFlowTheme.of(context).secondaryText,
  235. labelStyle:
  236. FlutterFlowTheme.of(context).titleMedium.override(
  237. font: GoogleFonts.interTight(
  238. fontWeight: FlutterFlowTheme.of(context)
  239. .titleMedium
  240. .fontWeight,
  241. fontStyle: FlutterFlowTheme.of(context)
  242. .titleMedium
  243. .fontStyle,
  244. ),
  245. letterSpacing: 0.0,
  246. fontWeight: FlutterFlowTheme.of(context)
  247. .titleMedium
  248. .fontWeight,
  249. fontStyle: FlutterFlowTheme.of(context)
  250. .titleMedium
  251. .fontStyle,
  252. ),
  253. unselectedLabelStyle:
  254. FlutterFlowTheme.of(context).titleMedium.override(
  255. font: GoogleFonts.interTight(
  256. fontWeight: FlutterFlowTheme.of(context)
  257. .titleMedium
  258. .fontWeight,
  259. fontStyle: FlutterFlowTheme.of(context)
  260. .titleMedium
  261. .fontStyle,
  262. ),
  263. letterSpacing: 0.0,
  264. fontWeight: FlutterFlowTheme.of(context)
  265. .titleMedium
  266. .fontWeight,
  267. fontStyle: FlutterFlowTheme.of(context)
  268. .titleMedium
  269. .fontStyle,
  270. ),
  271. indicatorColor: FlutterFlowTheme.of(context).primary,
  272. tabs: [
  273. Tab(
  274. text: FFLocalizations.of(context).getText(
  275. 'eor4c9rz' /* Uitgaan */,
  276. ),
  277. ),
  278. Tab(
  279. text: FFLocalizations.of(context).getText(
  280. 'mx7sn4ne' /* Activiteiten */,
  281. ),
  282. ),
  283. Tab(
  284. text: FFLocalizations.of(context).getText(
  285. 'e6xyyt74' /* Cultuur */,
  286. ),
  287. ),
  288. Tab(
  289. text: FFLocalizations.of(context).getText(
  290. 'uxy2nfok' /* Films */,
  291. ),
  292. ),
  293. Tab(
  294. text: FFLocalizations.of(context).getText(
  295. 'lx77xfrn' /* Jeugd */,
  296. ),
  297. ),
  298. ],
  299. controller: _model.tabBarController,
  300. onTap: (i) async {
  301. [
  302. () async {},
  303. () async {},
  304. () async {},
  305. () async {},
  306. () async {}
  307. ][i]();
  308. },
  309. ),
  310. ),
  311. Expanded(
  312. child: TabBarView(
  313. controller: _model.tabBarController,
  314. children: [
  315. Column(
  316. mainAxisSize: MainAxisSize.max,
  317. children: [
  318. Expanded(
  319. child: wrapWithModel(
  320. model: _model.uitgaantabelKaartComponentModel,
  321. updateCallback: () => safeSetState(() {}),
  322. child: Builder(builder: (_) {
  323. return DebugFlutterFlowModelContext(
  324. rootModel: _model.rootModel,
  325. child: UitgaantabelKaartComponentWidget(
  326. towndid: FFAppState().gemeenteSelectId,
  327. displayid: valueOrDefault<String>(
  328. '',
  329. 'services_3',
  330. ),
  331. ),
  332. );
  333. }),
  334. ),
  335. ),
  336. ],
  337. ),
  338. Column(
  339. mainAxisSize: MainAxisSize.max,
  340. children: [],
  341. ),
  342. Column(
  343. mainAxisSize: MainAxisSize.max,
  344. children: [],
  345. ),
  346. Column(
  347. mainAxisSize: MainAxisSize.max,
  348. children: [],
  349. ),
  350. Column(
  351. mainAxisSize: MainAxisSize.max,
  352. children: [],
  353. ),
  354. ],
  355. ),
  356. ),
  357. ],
  358. ),
  359. ),
  360. ],
  361. ),
  362. ),
  363. ),
  364. );
  365. }
  366. }