瀏覽代碼

Add Favorieten page (3 tabs) and drawer link

New favorieten page with a TabBar: Persoonlijke agenda, Favoriete
gemeenten, Favoriete Gelegenheden (placeholder content per tab, the
actual data lists and favorite-toggle API calls are follow-up work).
Adds a "Favorieten" entry to the drawer menu, above Provincie,
navigating to the new page.
bob 1 月之前
父節點
當前提交
bd4222459c

+ 0 - 2
lib/backend/api_requests/api_calls.dart

@@ -148,7 +148,6 @@ class FavorietenAgendaCall {
   static Future<ApiCallResponse> call({
     String? sessionname = '',
     String? sessionid = '',
-    String? token = '',
   }) async {
     return ApiManager.instance.makeApiCall(
       callName: 'FavorietenAgenda',
@@ -165,7 +164,6 @@ class FavorietenAgendaCall {
       cache: false,
       isStreamingApi: false,
       alwaysAllowBody: false,
-      client: ApiManager.getClient(withCredentials: true),
     );
   }
 

+ 69 - 0
lib/favorieten/favorieten_model.dart

@@ -0,0 +1,69 @@
+import '/flutter_flow/flutter_flow_theme.dart';
+import '/flutter_flow/flutter_flow_util.dart';
+import '/flutter_flow/flutter_flow_widgets.dart';
+import 'dart:ui';
+import 'favorieten_widget.dart' show FavorietenWidget;
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:google_fonts/google_fonts.dart';
+import 'package:provider/provider.dart';
+
+class FavorietenModel extends FlutterFlowModel<FavorietenWidget> {
+  ///  State fields for stateful widgets in this page.
+
+  // State field(s) for TabBar widget.
+  TabController? tabBarController;
+  int get tabBarCurrentIndex =>
+      tabBarController != null ? tabBarController!.index : 0;
+  int get tabBarPreviousIndex =>
+      tabBarController != null ? tabBarController!.previousIndex : 0;
+
+  final Map<String, DebugDataField> debugGeneratorVariables = {};
+  final Map<String, DebugDataField> debugBackendQueries = {};
+  final Map<String, FlutterFlowModel> widgetBuilderComponents = {};
+  @override
+  void initState(BuildContext context) {
+    debugLogWidgetClass(this);
+  }
+
+  @override
+  void dispose() {
+    tabBarController?.dispose();
+  }
+
+  @override
+  WidgetClassDebugData toWidgetClassDebugData() => WidgetClassDebugData(
+        widgetStates: {
+          'tabBarCurrentIndex': debugSerializeParam(
+            tabBarCurrentIndex,
+            ParamType.int,
+            link:
+                'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=favorieten',
+            name: 'int',
+            nullable: true,
+          ),
+          'tabBarPreviousIndex': debugSerializeParam(
+            tabBarPreviousIndex,
+            ParamType.int,
+            link:
+                'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=favorieten',
+            name: 'int',
+            nullable: true,
+          )
+        }.entries,
+        generatorVariables: debugGeneratorVariables.entries,
+        backendQueries: debugBackendQueries.entries,
+        componentStates: {
+          ...widgetBuilderComponents.map(
+            (key, value) => MapEntry(
+              key,
+              value.toWidgetClassDebugData(),
+            ),
+          ),
+        }.withoutNulls.entries,
+        link:
+            'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd/tab=uiBuilder&page=favorieten',
+        searchReference: 'reference=OgpmYXZvcmlldGVuUAFaCmZhdm9yaWV0ZW4=',
+        widgetClassName: 'favorieten',
+      );
+}

+ 286 - 0
lib/favorieten/favorieten_widget.dart

@@ -0,0 +1,286 @@
+import '/flutter_flow/flutter_flow_theme.dart';
+import '/flutter_flow/flutter_flow_util.dart';
+import '/flutter_flow/flutter_flow_widgets.dart';
+import 'dart:ui';
+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 'favorieten_model.dart';
+export 'favorieten_model.dart';
+
+class FavorietenWidget extends StatefulWidget {
+  const FavorietenWidget({super.key});
+
+  static String routeName = 'favorieten';
+  static String routePath = '/favorieten';
+
+  @override
+  State<FavorietenWidget> createState() => _FavorietenWidgetState();
+}
+
+class _FavorietenWidgetState extends State<FavorietenWidget>
+    with TickerProviderStateMixin, RouteAware {
+  late FavorietenModel _model;
+
+  final scaffoldKey = GlobalKey<ScaffoldState>();
+
+  @override
+  void initState() {
+    super.initState();
+    _model = createModel(context, () => FavorietenModel());
+
+    _model.tabBarController = TabController(
+      vsync: this,
+      length: 3,
+      initialIndex: 0,
+    )
+      ..addListener(() => safeSetState(() {}))
+      ..addListener(() {
+        debugLogWidgetClass(_model);
+      });
+  }
+
+  @override
+  void dispose() {
+    routeObserver.unsubscribe(this);
+
+    _model.dispose();
+
+    super.dispose();
+  }
+
+  @override
+  void didUpdateWidget(FavorietenWidget 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);
+
+    return GestureDetector(
+      onTap: () {
+        FocusScope.of(context).unfocus();
+        FocusManager.instance.primaryFocus?.unfocus();
+      },
+      child: Scaffold(
+        key: scaffoldKey,
+        backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
+        body: SafeArea(
+          top: true,
+          child: Column(
+            mainAxisSize: MainAxisSize.max,
+            children: [
+              Expanded(
+                child: Column(
+                  children: [
+                    Align(
+                      alignment: Alignment(0.0, 0),
+                      child: TabBar(
+                        labelColor: FlutterFlowTheme.of(context).primaryText,
+                        unselectedLabelColor:
+                            FlutterFlowTheme.of(context).secondaryText,
+                        labelStyle:
+                            FlutterFlowTheme.of(context).titleMedium.override(
+                                  font: GoogleFonts.interTight(
+                                    fontWeight: FlutterFlowTheme.of(context)
+                                        .titleMedium
+                                        .fontWeight,
+                                    fontStyle: FlutterFlowTheme.of(context)
+                                        .titleMedium
+                                        .fontStyle,
+                                  ),
+                                  letterSpacing: 0.0,
+                                  fontWeight: FlutterFlowTheme.of(context)
+                                      .titleMedium
+                                      .fontWeight,
+                                  fontStyle: FlutterFlowTheme.of(context)
+                                      .titleMedium
+                                      .fontStyle,
+                                ),
+                        unselectedLabelStyle:
+                            FlutterFlowTheme.of(context).titleMedium.override(
+                                  font: GoogleFonts.interTight(
+                                    fontWeight: FlutterFlowTheme.of(context)
+                                        .titleMedium
+                                        .fontWeight,
+                                    fontStyle: FlutterFlowTheme.of(context)
+                                        .titleMedium
+                                        .fontStyle,
+                                  ),
+                                  letterSpacing: 0.0,
+                                  fontWeight: FlutterFlowTheme.of(context)
+                                      .titleMedium
+                                      .fontWeight,
+                                  fontStyle: FlutterFlowTheme.of(context)
+                                      .titleMedium
+                                      .fontStyle,
+                                ),
+                        indicatorColor: FlutterFlowTheme.of(context).primary,
+                        tabs: [
+                          Tab(
+                            text: FFLocalizations.of(context).getText(
+                              'txq7zl0f' /* Persoonlijke agenda */,
+                            ),
+                          ),
+                          Tab(
+                            text: FFLocalizations.of(context).getText(
+                              '9wq117bv' /* Favoriete gemeenten */,
+                            ),
+                          ),
+                          Tab(
+                            text: FFLocalizations.of(context).getText(
+                              'ygk8aifq' /* Favoriete Gelegenheden */,
+                            ),
+                          ),
+                        ],
+                        controller: _model.tabBarController,
+                        onTap: (i) async {
+                          [() async {}, () async {}, () async {}][i]();
+                        },
+                      ),
+                    ),
+                    Expanded(
+                      child: TabBarView(
+                        controller: _model.tabBarController,
+                        children: [
+                          Column(
+                            mainAxisSize: MainAxisSize.max,
+                            children: [
+                              Text(
+                                FFLocalizations.of(context).getText(
+                                  '1y5w12fr' /* Je persoonlijke agenda met eve... */,
+                                ),
+                                style: FlutterFlowTheme.of(context)
+                                    .bodyMedium
+                                    .override(
+                                      font: GoogleFonts.inter(
+                                        fontWeight: FlutterFlowTheme.of(context)
+                                            .bodyMedium
+                                            .fontWeight,
+                                        fontStyle: FlutterFlowTheme.of(context)
+                                            .bodyMedium
+                                            .fontStyle,
+                                      ),
+                                      letterSpacing: 0.0,
+                                      fontWeight: FlutterFlowTheme.of(context)
+                                          .bodyMedium
+                                          .fontWeight,
+                                      fontStyle: FlutterFlowTheme.of(context)
+                                          .bodyMedium
+                                          .fontStyle,
+                                    ),
+                              ),
+                            ],
+                          ),
+                          Column(
+                            mainAxisSize: MainAxisSize.max,
+                            children: [
+                              Text(
+                                FFLocalizations.of(context).getText(
+                                  'o7pt2vls' /* De gemeentes die je hebt gemar... */,
+                                ),
+                                style: FlutterFlowTheme.of(context)
+                                    .bodyMedium
+                                    .override(
+                                      font: GoogleFonts.inter(
+                                        fontWeight: FlutterFlowTheme.of(context)
+                                            .bodyMedium
+                                            .fontWeight,
+                                        fontStyle: FlutterFlowTheme.of(context)
+                                            .bodyMedium
+                                            .fontStyle,
+                                      ),
+                                      letterSpacing: 0.0,
+                                      fontWeight: FlutterFlowTheme.of(context)
+                                          .bodyMedium
+                                          .fontWeight,
+                                      fontStyle: FlutterFlowTheme.of(context)
+                                          .bodyMedium
+                                          .fontStyle,
+                                    ),
+                              ),
+                            ],
+                          ),
+                          Column(
+                            mainAxisSize: MainAxisSize.max,
+                            children: [
+                              Text(
+                                FFLocalizations.of(context).getText(
+                                  'gyuds6ee' /* Hello World */,
+                                ),
+                                style: FlutterFlowTheme.of(context)
+                                    .bodyMedium
+                                    .override(
+                                      font: GoogleFonts.inter(
+                                        fontWeight: FlutterFlowTheme.of(context)
+                                            .bodyMedium
+                                            .fontWeight,
+                                        fontStyle: FlutterFlowTheme.of(context)
+                                            .bodyMedium
+                                            .fontStyle,
+                                      ),
+                                      letterSpacing: 0.0,
+                                      fontWeight: FlutterFlowTheme.of(context)
+                                          .bodyMedium
+                                          .fontWeight,
+                                      fontStyle: FlutterFlowTheme.of(context)
+                                          .bodyMedium
+                                          .fontStyle,
+                                    ),
+                              ),
+                            ],
+                          ),
+                        ],
+                      ),
+                    ),
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+}

+ 40 - 0
lib/flutter_flow/internationalization.dart

@@ -402,6 +402,38 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
       'en': '',
     },
   },
+  // favorieten
+  {
+    'txq7zl0f': {
+      'nl': 'Persoonlijke agenda',
+      'en': '',
+    },
+    '1y5w12fr': {
+      'nl':
+          'Je persoonlijke agenda met evenementen van je favoriete gelegenheden en gemeenten.',
+      'en': '',
+    },
+    '9wq117bv': {
+      'nl': 'Favoriete gemeenten',
+      'en': '',
+    },
+    'o7pt2vls': {
+      'nl': 'De gemeentes die je hebt gemarkeerd als favoriet.',
+      'en': '',
+    },
+    'ygk8aifq': {
+      'nl': 'Favoriete Gelegenheden',
+      'en': '',
+    },
+    'gyuds6ee': {
+      'nl': 'Hello World',
+      'en': '',
+    },
+    'xyig2ny4': {
+      'nl': 'Home',
+      'en': '',
+    },
+  },
   // PUitgaantabelKaartComponent
   {
     '4lehigdg': {
@@ -470,6 +502,14 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
       'nl': '',
       'en': '',
     },
+    '7pacsyhe': {
+      'nl': 'Favorieten',
+      'en': 'Home',
+    },
+    'm8h5x9ts': {
+      'nl': '',
+      'en': '',
+    },
     '4u9vsobq': {
       'nl': 'Provincie',
       'en': 'Provincie',

+ 8 - 1
lib/flutter_flow/nav/nav.dart

@@ -48,7 +48,9 @@ const debugRouteLinkMap = {
   '/horecagelegenhedenOverzichtSortPage':
       'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=HorecagelegenhedenOverzichtSortPage',
   '/wachtwoordVergeten':
-      'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=wachtwoordVergeten'
+      'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=wachtwoordVergeten',
+  '/favorieten':
+      'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=favorieten'
 };
 
 class AppStateNotifier extends ChangeNotifier {
@@ -219,6 +221,11 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
           name: WachtwoordVergetenWidget.routeName,
           path: WachtwoordVergetenWidget.routePath,
           builder: (context, params) => WachtwoordVergetenWidget(),
+        ),
+        FFRoute(
+          name: FavorietenWidget.routeName,
+          path: FavorietenWidget.routePath,
+          builder: (context, params) => FavorietenWidget(),
         )
       ].map((r) => r.toRoute(appStateNotifier)).toList(),
       observers: [routeObserver],

+ 1 - 0
lib/index.dart

@@ -18,3 +18,4 @@ export '/horecagelegenhedenoverzicht/horecagelegenheden_overzicht_sort_page/hore
     show HorecagelegenhedenOverzichtSortPageWidget;
 export '/wachtwoord_vergeten/wachtwoord_vergeten_widget.dart'
     show WachtwoordVergetenWidget;
+export '/favorieten/favorieten_widget.dart' show FavorietenWidget;

+ 57 - 0
lib/shared/drawer_component/drawer_component_widget.dart

@@ -237,6 +237,63 @@ class _DrawerComponentWidgetState extends State<DrawerComponentWidget>
                       ),
                     ),
                   ),
+                  Padding(
+                    padding: EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 0.0, 0.0),
+                    child: InkWell(
+                      splashColor: Colors.transparent,
+                      focusColor: Colors.transparent,
+                      hoverColor: Colors.transparent,
+                      highlightColor: Colors.transparent,
+                      onTap: () async {
+                        context.pushNamed(FavorietenWidget.routeName);
+                      },
+                      child: Material(
+                        color: Colors.transparent,
+                        child: ListTile(
+                          leading: Icon(
+                            Icons.favorite_border,
+                          ),
+                          title: Text(
+                            FFLocalizations.of(context).getText(
+                              '7pacsyhe' /* Favorieten */,
+                            ),
+                            style: FlutterFlowTheme.of(context)
+                                .titleLarge
+                                .override(
+                                  font: GoogleFonts.interTight(
+                                    fontWeight: FlutterFlowTheme.of(context)
+                                        .titleLarge
+                                        .fontWeight,
+                                    fontStyle: FlutterFlowTheme.of(context)
+                                        .titleLarge
+                                        .fontStyle,
+                                  ),
+                                  letterSpacing: 0.0,
+                                  fontWeight: FlutterFlowTheme.of(context)
+                                      .titleLarge
+                                      .fontWeight,
+                                  fontStyle: FlutterFlowTheme.of(context)
+                                      .titleLarge
+                                      .fontStyle,
+                                ),
+                          ),
+                          trailing: Icon(
+                            Icons.arrow_forward_ios_rounded,
+                            color: FlutterFlowTheme.of(context).secondaryText,
+                            size: 20.0,
+                          ),
+                          tileColor:
+                              FlutterFlowTheme.of(context).secondaryBackground,
+                          dense: true,
+                          contentPadding: EdgeInsetsDirectional.fromSTEB(
+                              12.0, 0.0, 12.0, 0.0),
+                          shape: RoundedRectangleBorder(
+                            borderRadius: BorderRadius.circular(8.0),
+                          ),
+                        ),
+                      ),
+                    ),
+                  ),
                   Padding(
                     padding: EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 0.0, 0.0),
                     child: Material(