|
@@ -0,0 +1,331 @@
|
|
|
|
|
+import '/backend/api_requests/api_calls.dart';
|
|
|
|
|
+import '/flutter_flow/flutter_flow_theme.dart';
|
|
|
|
|
+import '/flutter_flow/flutter_flow_util.dart';
|
|
|
|
|
+import '/flutter_flow/flutter_flow_widgets.dart';
|
|
|
|
|
+import '/uitgaanspaginas/p_uitgaan_slider_kaart_component/p_uitgaan_slider_kaart_component_widget.dart';
|
|
|
|
|
+import '/index.dart';
|
|
|
|
|
+import 'package:carousel_slider/carousel_slider.dart';
|
|
|
|
|
+import 'package:flutter/material.dart';
|
|
|
|
|
+import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|
|
|
|
+import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
+import 'package:provider/provider.dart';
|
|
|
|
|
+import 'home_uitgaan_slider_component_copy_model.dart';
|
|
|
|
|
+export 'home_uitgaan_slider_component_copy_model.dart';
|
|
|
|
|
+
|
|
|
|
|
+class HomeUitgaanSliderComponentCopyWidget extends StatefulWidget {
|
|
|
|
|
+ const HomeUitgaanSliderComponentCopyWidget({
|
|
|
|
|
+ super.key,
|
|
|
|
|
+ this.displayid,
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ final String? displayid;
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ State<HomeUitgaanSliderComponentCopyWidget> createState() =>
|
|
|
|
|
+ _HomeUitgaanSliderComponentCopyWidgetState();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+class _HomeUitgaanSliderComponentCopyWidgetState
|
|
|
|
|
+ extends State<HomeUitgaanSliderComponentCopyWidget> with RouteAware {
|
|
|
|
|
+ late HomeUitgaanSliderComponentCopyModel _model;
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void setState(VoidCallback callback) {
|
|
|
|
|
+ super.setState(callback);
|
|
|
|
|
+ _model.onUpdate();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void initState() {
|
|
|
|
|
+ super.initState();
|
|
|
|
|
+ _model = createModel(context, () => HomeUitgaanSliderComponentCopyModel());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void dispose() {
|
|
|
|
|
+ routeObserver.unsubscribe(this);
|
|
|
|
|
+
|
|
|
|
|
+ _model.maybeDispose();
|
|
|
|
|
+
|
|
|
|
|
+ super.dispose();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void didUpdateWidget(HomeUitgaanSliderComponentCopyWidget oldWidget) {
|
|
|
|
|
+ super.didUpdateWidget(oldWidget);
|
|
|
|
|
+ _model.widget = widget;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void didChangeDependencies() {
|
|
|
|
|
+ super.didChangeDependencies();
|
|
|
|
|
+ final route = DebugModalRoute.of(context);
|
|
|
|
|
+ if (route != null) {
|
|
|
|
|
+ routeObserver.subscribe(this, route);
|
|
|
|
|
+ }
|
|
|
|
|
+ debugLogGlobalProperty(context);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void didPopNext() {
|
|
|
|
|
+ if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
|
|
|
|
|
+ setState(() => _model.isRouteVisible = true);
|
|
|
|
|
+ debugLogWidgetClass(_model);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void didPush() {
|
|
|
|
|
+ if (mounted && DebugFlutterFlowModelContext.maybeOf(context) == null) {
|
|
|
|
|
+ setState(() => _model.isRouteVisible = true);
|
|
|
|
|
+ debugLogWidgetClass(_model);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void didPop() {
|
|
|
|
|
+ _model.isRouteVisible = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ void didPushNext() {
|
|
|
|
|
+ _model.isRouteVisible = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ Widget build(BuildContext context) {
|
|
|
|
|
+ DebugFlutterFlowModelContext.maybeOf(context)
|
|
|
|
|
+ ?.parentModelCallback
|
|
|
|
|
+ ?.call(_model);
|
|
|
|
|
+ _model.pUitgaanSliderKaartComponentModels.clear();
|
|
|
|
|
+
|
|
|
|
|
+ return Builder(
|
|
|
|
|
+ builder: (context) {
|
|
|
|
|
+ if (valueOrDefault<bool>(
|
|
|
|
|
+ widget!.displayid == widget!.displayid,
|
|
|
|
|
+ true,
|
|
|
|
|
+ )) {
|
|
|
|
|
+ return Padding(
|
|
|
|
|
+ padding: EdgeInsetsDirectional.fromSTEB(0.0, 15.0, 0.0, 15.0),
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ width: MediaQuery.sizeOf(context).width * 0.92,
|
|
|
|
|
+ height: MediaQuery.sizeOf(context).height * 0.32,
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ shape: BoxShape.rectangle,
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Padding(
|
|
|
|
|
+ padding: EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
|
|
|
|
|
+ child: FutureBuilder<ApiCallResponse>(
|
|
|
|
|
+ future: HomeSliderCall.call(
|
|
|
|
|
+ displayId: widget!.displayid,
|
|
|
|
|
+ ),
|
|
|
|
|
+ builder: (context, snapshot) {
|
|
|
|
|
+ // Customize what your widget looks like when it's loading.
|
|
|
|
|
+ if (!snapshot.hasData) {
|
|
|
|
|
+ return Center(
|
|
|
|
|
+ child: SizedBox(
|
|
|
|
|
+ width: 80.0,
|
|
|
|
|
+ height: 80.0,
|
|
|
|
|
+ child: SpinKitFadingCircle(
|
|
|
|
|
+ color: FlutterFlowTheme.of(context).primary,
|
|
|
|
|
+ size: 80.0,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ final carouselHomeSliderResponse = snapshot.data!;
|
|
|
|
|
+ _model.debugBackendQueries[
|
|
|
|
|
+ 'HomeSliderCall_statusCode_Carousel_lohx8ayf'] =
|
|
|
|
|
+ debugSerializeParam(
|
|
|
|
|
+ carouselHomeSliderResponse.statusCode,
|
|
|
|
|
+ ParamType.int,
|
|
|
|
|
+ link:
|
|
|
|
|
+ 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=HomeUitgaanSliderComponentCopy',
|
|
|
|
|
+ name: 'int',
|
|
|
|
|
+ nullable: false,
|
|
|
|
|
+ );
|
|
|
|
|
+ _model.debugBackendQueries[
|
|
|
|
|
+ 'HomeSliderCall_responseBody_Carousel_lohx8ayf'] =
|
|
|
|
|
+ debugSerializeParam(
|
|
|
|
|
+ carouselHomeSliderResponse.bodyText,
|
|
|
|
|
+ ParamType.String,
|
|
|
|
|
+ link:
|
|
|
|
|
+ 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=HomeUitgaanSliderComponentCopy',
|
|
|
|
|
+ name: 'String',
|
|
|
|
|
+ nullable: false,
|
|
|
|
|
+ );
|
|
|
|
|
+ debugLogWidgetClass(_model);
|
|
|
|
|
+
|
|
|
|
|
+ return Builder(
|
|
|
|
|
+ builder: (context) {
|
|
|
|
|
+ final homeslider = getJsonField(
|
|
|
|
|
+ carouselHomeSliderResponse.jsonBody,
|
|
|
|
|
+ r'''$''',
|
|
|
|
|
+ ).toList().take(12).toList();
|
|
|
|
|
+ if (homeslider.isEmpty) {
|
|
|
|
|
+ return Image.asset(
|
|
|
|
|
+ 'assets/images/logo800px.png',
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ _model.debugGeneratorVariables[
|
|
|
|
|
+ 'homeslider${homeslider.length > 100 ? ' (first 100)' : ''}'] =
|
|
|
|
|
+ debugSerializeParam(
|
|
|
|
|
+ homeslider.take(100),
|
|
|
|
|
+ ParamType.JSON,
|
|
|
|
|
+ isList: true,
|
|
|
|
|
+ link:
|
|
|
|
|
+ 'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=HomeUitgaanSliderComponentCopy',
|
|
|
|
|
+ name: 'dynamic',
|
|
|
|
|
+ nullable: false,
|
|
|
|
|
+ );
|
|
|
|
|
+ debugLogWidgetClass(_model);
|
|
|
|
|
+
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: double.infinity,
|
|
|
|
|
+ height: () {
|
|
|
|
|
+ if (MediaQuery.sizeOf(context).width <
|
|
|
|
|
+ kBreakpointSmall) {
|
|
|
|
|
+ return 180.0;
|
|
|
|
|
+ } else if (MediaQuery.sizeOf(context).width <
|
|
|
|
|
+ kBreakpointMedium) {
|
|
|
|
|
+ return 220.0;
|
|
|
|
|
+ } else if (MediaQuery.sizeOf(context).width <
|
|
|
|
|
+ kBreakpointLarge) {
|
|
|
|
|
+ return 260.0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return 300.0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }(),
|
|
|
|
|
+ child: CarouselSlider.builder(
|
|
|
|
|
+ itemCount: homeslider.length,
|
|
|
|
|
+ itemBuilder: (context, homesliderIndex, _) {
|
|
|
|
|
+ final homesliderItem =
|
|
|
|
|
+ homeslider[homesliderIndex];
|
|
|
|
|
+ return InkWell(
|
|
|
|
|
+ splashColor: Colors.transparent,
|
|
|
|
|
+ focusColor: Colors.transparent,
|
|
|
|
|
+ hoverColor: Colors.transparent,
|
|
|
|
|
+ highlightColor: Colors.transparent,
|
|
|
|
|
+ onTap: () async {
|
|
|
|
|
+ context.pushNamed(
|
|
|
|
|
+ EventCurrentWidget.routeName,
|
|
|
|
|
+ queryParameters: {
|
|
|
|
|
+ 'nid': serializeParam(
|
|
|
|
|
+ getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.nid''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ ParamType.String,
|
|
|
|
|
+ ),
|
|
|
|
|
+ 'horecaid': serializeParam(
|
|
|
|
|
+ getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.horecagelegenheidid''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ ParamType.String,
|
|
|
|
|
+ ),
|
|
|
|
|
+ }.withoutNulls,
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ child: Stack(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Builder(builder: (_) {
|
|
|
|
|
+ return DebugFlutterFlowModelContext(
|
|
|
|
|
+ rootModel: _model.rootModel,
|
|
|
|
|
+ parentModelCallback: (m) {
|
|
|
|
|
+ _model.pUitgaanSliderKaartComponentModels[
|
|
|
|
|
+ 'Keyk15_${homesliderIndex}_of_${homeslider.length}'] = m;
|
|
|
|
|
+ },
|
|
|
|
|
+ child:
|
|
|
|
|
+ PUitgaanSliderKaartComponentWidget(
|
|
|
|
|
+ key: Key(
|
|
|
|
|
+ 'Keyk15_${homesliderIndex}_of_${homeslider.length}'),
|
|
|
|
|
+ logo: getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.logo''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ categorie: (getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.categorie''',
|
|
|
|
|
+ true,
|
|
|
|
|
+ ) as List?)
|
|
|
|
|
+ ?.map<String>((e) => e.toString())
|
|
|
|
|
+ .toList()
|
|
|
|
|
+ .cast<String>(),
|
|
|
|
|
+ titel: getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.titel''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ datum: getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.datum''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ horecagelegenheid: getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.horecagelegenheid''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ adres: getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.adres''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ plaats: getJsonField(
|
|
|
|
|
+ homesliderItem,
|
|
|
|
|
+ r'''$.plaats''',
|
|
|
|
|
+ ).toString(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ carouselController: _model.carouselController ??=
|
|
|
|
|
+ CarouselSliderController(),
|
|
|
|
|
+ options: CarouselOptions(
|
|
|
|
|
+ initialPage:
|
|
|
|
|
+ max(0, min(1, homeslider.length - 1)),
|
|
|
|
|
+ viewportFraction: () {
|
|
|
|
|
+ if (MediaQuery.sizeOf(context).width <
|
|
|
|
|
+ kBreakpointSmall) {
|
|
|
|
|
+ return 0.75;
|
|
|
|
|
+ } else if (MediaQuery.sizeOf(context).width <
|
|
|
|
|
+ kBreakpointMedium) {
|
|
|
|
|
+ return 0.75;
|
|
|
|
|
+ } else if (MediaQuery.sizeOf(context).width <
|
|
|
|
|
+ kBreakpointLarge) {
|
|
|
|
|
+ return 0.5;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return 0.35;
|
|
|
|
|
+ }
|
|
|
|
|
+ }(),
|
|
|
|
|
+ disableCenter: true,
|
|
|
|
|
+ enlargeCenterPage: true,
|
|
|
|
|
+ enlargeFactor: 0.25,
|
|
|
|
|
+ enableInfiniteScroll: true,
|
|
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
|
|
+ autoPlay: false,
|
|
|
|
|
+ onPageChanged: (index, _) =>
|
|
|
|
|
+ _model.carouselCurrentIndex = index,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: 100.0,
|
|
|
|
|
+ height: 100.0,
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: FlutterFlowTheme.of(context).secondaryBackground,
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+}
|