ソースを参照

Add favorite-toggle heart to horeca detail page; unauth fallback now Home

- HorecagelegenheidCurrent: heart icon (favorite_border, red, white
  badge) top-right of the photo, matching the overview card's UI-only
  favorite toggle (no API call wired up yet).
- nav.dart: unauthenticated users now land on Home instead of Login,
  and the requireAuth redirect target changed from /login to /home.
bob 1 ヶ月 前
コミット
3d26ed887b

+ 4 - 4
ios/Runner.xcodeproj/project.pbxproj

@@ -44,8 +44,8 @@
 		97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
 		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
-		6436409027A31CD900820AF7 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		6436409A27A31CDF00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		6436409C27A31CD300820AF7 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		6436409527A31CD200820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -225,8 +225,8 @@
 		6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
 			isa = PBXVariantGroup;
 			children = (
-				6436409027A31CD900820AF7 /* nl */,
-				6436409A27A31CDF00820AF7 /* en */,
+				6436409C27A31CD300820AF7 /* nl */,
+				6436409527A31CD200820AF7 /* en */,
 			);
 			name = InfoPlist.strings;
 			sourceTree = "<group>";

+ 1 - 1
lib/components/header_buttons_component_widget.dart

@@ -149,7 +149,7 @@ class _HeaderButtonsComponentWidgetState
               padding: EdgeInsets.all(4.0),
               child: Text(
                 FFLocalizations.of(context).getText(
-                  'vmbtb6ah' /* Terug */,
+                  'f8ay39rg' /* Terug */,
                 ),
                 style: FlutterFlowTheme.of(context).bodyLarge.override(
                       font: GoogleFonts.inter(

+ 6 - 2
lib/flutter_flow/internationalization.dart

@@ -185,6 +185,10 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
   },
   // horecagelegenheidCurrent
   {
+    'pj545url': {
+      'nl': 'Favoriet',
+      'en': '',
+    },
     'pedeshok': {
       'nl': 'Info',
       'en': 'Info',
@@ -634,7 +638,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
       'nl': 'Mijn Account',
       'en': 'Mijn Account',
     },
-    'pj545url': {
+    'vmbtb6ah': {
       'nl': 'Terug',
       'en': '',
     },
@@ -741,7 +745,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
       'nl': 'Menu openen',
       'en': '',
     },
-    'vmbtb6ah': {
+    'f8ay39rg': {
       'nl': 'Terug',
       'en': '',
     },

+ 3 - 3
lib/flutter_flow/nav/nav.dart

@@ -113,14 +113,14 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
       navigatorKey: appNavigatorKey,
       errorBuilder: (context, state) => appStateNotifier.loggedIn
           ? SelectprovinciegemeenteWidget()
-          : LoginWidget(),
+          : HomeWidget(),
       routes: [
         FFRoute(
           name: '_initialize',
           path: '/',
           builder: (context, _) => appStateNotifier.loggedIn
               ? SelectprovinciegemeenteWidget()
-              : LoginWidget(),
+              : HomeWidget(),
         ),
         FFRoute(
           name: LoginWidget.routeName,
@@ -397,7 +397,7 @@ class FFRoute {
 
           if (requireAuth && !appStateNotifier.loggedIn) {
             appStateNotifier.setRedirectLocationIfUnset(state.uri.toString());
-            return '/login';
+            return '/home';
           }
           return null;
         },

+ 2 - 0
lib/horecagelegenhedenoverzicht/horecagelegenheid_current/horecagelegenheid_current_model.dart

@@ -1,5 +1,6 @@
 import '/backend/api_requests/api_calls.dart';
 import '/components/header_buttons_component_widget.dart';
+import '/flutter_flow/flutter_flow_icon_button.dart';
 import '/flutter_flow/flutter_flow_theme.dart';
 import '/flutter_flow/flutter_flow_util.dart';
 import '/flutter_flow/flutter_flow_widgets.dart';
@@ -9,6 +10,7 @@ import 'dart:ui';
 import '/custom_code/widgets/index.dart' as custom_widgets;
 import 'horecagelegenheid_current_widget.dart'
     show HorecagelegenheidCurrentWidget;
+import 'package:aligned_tooltip/aligned_tooltip.dart';
 import 'package:carousel_slider/carousel_slider.dart';
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/material.dart';

+ 127 - 60
lib/horecagelegenhedenoverzicht/horecagelegenheid_current/horecagelegenheid_current_widget.dart

@@ -1,5 +1,6 @@
 import '/backend/api_requests/api_calls.dart';
 import '/components/header_buttons_component_widget.dart';
+import '/flutter_flow/flutter_flow_icon_button.dart';
 import '/flutter_flow/flutter_flow_theme.dart';
 import '/flutter_flow/flutter_flow_util.dart';
 import '/flutter_flow/flutter_flow_widgets.dart';
@@ -7,6 +8,7 @@ import '/horecagelegenhedenoverzicht/horecagelegenheid_event_tabel_component_cop
 import '/shared/drawer_component/drawer_component_widget.dart';
 import 'dart:ui';
 import '/custom_code/widgets/index.dart' as custom_widgets;
+import 'package:aligned_tooltip/aligned_tooltip.dart';
 import 'package:carousel_slider/carousel_slider.dart';
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/material.dart';
@@ -214,70 +216,135 @@ class _HorecagelegenheidCurrentWidgetState
               child: Column(
                 mainAxisSize: MainAxisSize.max,
                 children: [
-                  Container(
-                    width: 366.1,
-                    height: 281.5,
-                    decoration: BoxDecoration(
-                      color: FlutterFlowTheme.of(context).secondaryBackground,
-                    ),
-                    child: Builder(
-                      builder: (context) {
-                        final fotoos =
-                            EstablishmentInfoCall.establishmentFotoos(
-                                  horecagelegenheidCurrentEstablishmentInfoResponse
-                                      .jsonBody,
-                                )?.toList() ??
-                                [];
-                        _model.debugGeneratorVariables[
-                                'fotoos${fotoos.length > 100 ? ' (first 100)' : ''}'] =
-                            debugSerializeParam(
-                          fotoos.take(100),
-                          ParamType.String,
-                          isList: true,
-                          link:
-                              'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=horecagelegenheidCurrent',
-                          name: 'String',
-                          nullable: false,
-                        );
-                        debugLogWidgetClass(_model);
+                  Stack(
+                    children: [
+                      Container(
+                        width: 366.1,
+                        height: 281.5,
+                        decoration: BoxDecoration(
+                          color:
+                              FlutterFlowTheme.of(context).secondaryBackground,
+                        ),
+                        child: Builder(
+                          builder: (context) {
+                            final fotoos =
+                                EstablishmentInfoCall.establishmentFotoos(
+                                      horecagelegenheidCurrentEstablishmentInfoResponse
+                                          .jsonBody,
+                                    )?.toList() ??
+                                    [];
+                            _model.debugGeneratorVariables[
+                                    'fotoos${fotoos.length > 100 ? ' (first 100)' : ''}'] =
+                                debugSerializeParam(
+                              fotoos.take(100),
+                              ParamType.String,
+                              isList: true,
+                              link:
+                                  'https://app.flutterflow.io/project/uitgaanskrant-1qhvtd?tab=uiBuilder&page=horecagelegenheidCurrent',
+                              name: 'String',
+                              nullable: false,
+                            );
+                            debugLogWidgetClass(_model);
 
-                        return Container(
-                          width: double.infinity,
-                          height: 200.0,
-                          child: CarouselSlider.builder(
-                            itemCount: fotoos.length,
-                            itemBuilder: (context, fotoosIndex, _) {
-                              final fotoosItem = fotoos[fotoosIndex];
-                              return ClipRRect(
-                                borderRadius: BorderRadius.circular(8.0),
-                                child: CachedNetworkImage(
-                                  fadeInDuration: Duration(milliseconds: 500),
-                                  fadeOutDuration: Duration(milliseconds: 500),
-                                  imageUrl: fotoosItem,
-                                  width: 200.0,
-                                  height: 200.0,
-                                  fit: BoxFit.cover,
+                            return Container(
+                              width: double.infinity,
+                              height: 200.0,
+                              child: CarouselSlider.builder(
+                                itemCount: fotoos.length,
+                                itemBuilder: (context, fotoosIndex, _) {
+                                  final fotoosItem = fotoos[fotoosIndex];
+                                  return ClipRRect(
+                                    borderRadius: BorderRadius.circular(8.0),
+                                    child: CachedNetworkImage(
+                                      fadeInDuration:
+                                          Duration(milliseconds: 500),
+                                      fadeOutDuration:
+                                          Duration(milliseconds: 500),
+                                      imageUrl: fotoosItem,
+                                      width: 200.0,
+                                      height: 200.0,
+                                      fit: BoxFit.cover,
+                                    ),
+                                  );
+                                },
+                                carouselController:
+                                    _model.carouselController ??=
+                                        CarouselSliderController(),
+                                options: CarouselOptions(
+                                  initialPage:
+                                      max(0, min(1, fotoos.length - 1)),
+                                  viewportFraction: 0.5,
+                                  disableCenter: true,
+                                  enlargeCenterPage: true,
+                                  enlargeFactor: 0.25,
+                                  enableInfiniteScroll: true,
+                                  scrollDirection: Axis.horizontal,
+                                  autoPlay: false,
+                                  onPageChanged: (index, _) =>
+                                      _model.carouselCurrentIndex = index,
                                 ),
-                              );
-                            },
-                            carouselController: _model.carouselController ??=
-                                CarouselSliderController(),
-                            options: CarouselOptions(
-                              initialPage: max(0, min(1, fotoos.length - 1)),
-                              viewportFraction: 0.5,
-                              disableCenter: true,
-                              enlargeCenterPage: true,
-                              enlargeFactor: 0.25,
-                              enableInfiniteScroll: true,
-                              scrollDirection: Axis.horizontal,
-                              autoPlay: false,
-                              onPageChanged: (index, _) =>
-                                  _model.carouselCurrentIndex = index,
+                              ),
+                            );
+                          },
+                        ),
+                      ),
+                      Align(
+                        alignment: AlignmentDirectional(1.0, 0.0),
+                        child: AlignedTooltip(
+                          content: Padding(
+                            padding: EdgeInsets.all(4.0),
+                            child: Text(
+                              FFLocalizations.of(context).getText(
+                                'pj545url' /* Favoriet */,
+                              ),
+                              style: FlutterFlowTheme.of(context)
+                                  .bodyLarge
+                                  .override(
+                                    font: GoogleFonts.inter(
+                                      fontWeight: FlutterFlowTheme.of(context)
+                                          .bodyLarge
+                                          .fontWeight,
+                                      fontStyle: FlutterFlowTheme.of(context)
+                                          .bodyLarge
+                                          .fontStyle,
+                                    ),
+                                    letterSpacing: 0.0,
+                                    fontWeight: FlutterFlowTheme.of(context)
+                                        .bodyLarge
+                                        .fontWeight,
+                                    fontStyle: FlutterFlowTheme.of(context)
+                                        .bodyLarge
+                                        .fontStyle,
+                                  ),
                             ),
                           ),
-                        );
-                      },
-                    ),
+                          offset: 4.0,
+                          preferredDirection: AxisDirection.down,
+                          borderRadius: BorderRadius.circular(8.0),
+                          backgroundColor:
+                              FlutterFlowTheme.of(context).secondaryBackground,
+                          elevation: 4.0,
+                          tailBaseWidth: 24.0,
+                          tailLength: 12.0,
+                          waitDuration: Duration(milliseconds: 100),
+                          showDuration: Duration(milliseconds: 1500),
+                          triggerMode: TooltipTriggerMode.tap,
+                          child: FlutterFlowIconButton(
+                            borderRadius: 8.0,
+                            buttonSize: 32.0,
+                            fillColor: Color(0x0AFFFFFF),
+                            icon: Icon(
+                              Icons.favorite_border,
+                              color: Color(0xFFB50808),
+                              size: 24.0,
+                            ),
+                            onPressed: () {
+                              print('IconButtonFavoriet pressed ...');
+                            },
+                          ),
+                        ),
+                      ),
+                    ],
                   ),
                   Text(
                     valueOrDefault<String>(

+ 1 - 1
lib/shared/drawer_component/drawer_component_widget.dart

@@ -1319,7 +1319,7 @@ class _DrawerComponentWidgetState extends State<DrawerComponentWidget>
                           padding: EdgeInsets.all(4.0),
                           child: Text(
                             FFLocalizations.of(context).getText(
-                              'pj545url' /* Terug */,
+                              'vmbtb6ah' /* Terug */,
                             ),
                             style:
                                 FlutterFlowTheme.of(context).bodyLarge.override(