Bladeren bron

P1-6: 9 velden op evenement_horecagelegenheid_widget.dart voorzien van Visibility-guard (Is Set/Is Set and Not Empty)

HorecaNaam (titel), email, logo, plaats, adres, entreeprijs,
entreetoelichting, OpeningstijdenUitzondering, bezorgtijden tonen nu
niets meer i.p.v. de letterlijke veldnaam bij ontbrekende data.
Guard-aanpak i.p.v. Default Value-tekst, omdat deze velden JSON-Path-
gebonden zijn (geen Default Variable Value-veld beschikbaar, zie
TASKS.md P1-6-architectuurnotitie).

flutter analyze: 0 errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
bob 4 weken geleden
bovenliggende
commit
4fbcb0d1f1

+ 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>"; };
-		6436409A27A31CDA00820AF7 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		6436409C27A31CD400820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		6436409627A31CD600820AF7 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		6436409827A31CD000820AF7 /* 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 = (
-				6436409A27A31CDA00820AF7 /* nl */,
-				6436409C27A31CD400820AF7 /* en */,
+				6436409627A31CD600820AF7 /* nl */,
+				6436409827A31CD000820AF7 /* en */,
 			);
 			name = InfoPlist.strings;
 			sourceTree = "<group>";

+ 297 - 189
lib/evenement/evenement_horecagelegenheid/evenement_horecagelegenheid_widget.dart

@@ -154,31 +154,47 @@ class _EvenementHorecagelegenheidWidgetState
         return Column(
           mainAxisSize: MainAxisSize.max,
           children: [
-            InkWell(
-              splashColor: Colors.transparent,
-              focusColor: Colors.transparent,
-              hoverColor: Colors.transparent,
-              highlightColor: Colors.transparent,
-              onTap: () async {
-                context.pushNamed(
-                  HorecagelegenheidCurrentWidget.routeName,
-                  queryParameters: {
-                    'nid': serializeParam(
-                      widget!.establishmentID,
-                      ParamType.String,
+            if (EstablishmentInfoCall.establshmentTitel(
+                      columnEstablishmentInfoResponse.jsonBody,
+                    ) !=
+                    null &&
+                EstablishmentInfoCall.establshmentTitel(
+                      columnEstablishmentInfoResponse.jsonBody,
+                    ) !=
+                    '')
+              InkWell(
+                splashColor: Colors.transparent,
+                focusColor: Colors.transparent,
+                hoverColor: Colors.transparent,
+                highlightColor: Colors.transparent,
+                onTap: () async {
+                  context.pushNamed(
+                    HorecagelegenheidCurrentWidget.routeName,
+                    queryParameters: {
+                      'nid': serializeParam(
+                        widget!.establishmentID,
+                        ParamType.String,
+                      ),
+                    }.withoutNulls,
+                  );
+                },
+                child: Text(
+                  valueOrDefault<String>(
+                    EstablishmentInfoCall.establshmentTitel(
+                      columnEstablishmentInfoResponse.jsonBody,
                     ),
-                  }.withoutNulls,
-                );
-              },
-              child: Text(
-                valueOrDefault<String>(
-                  EstablishmentInfoCall.establshmentTitel(
-                    columnEstablishmentInfoResponse.jsonBody,
+                    'HorecaNaam',
                   ),
-                  'HorecaNaam',
-                ),
-                style: FlutterFlowTheme.of(context).headlineLarge.override(
-                      font: GoogleFonts.interTight(
+                  style: FlutterFlowTheme.of(context).headlineLarge.override(
+                        font: GoogleFonts.interTight(
+                          fontWeight: FlutterFlowTheme.of(context)
+                              .headlineLarge
+                              .fontWeight,
+                          fontStyle: FlutterFlowTheme.of(context)
+                              .headlineLarge
+                              .fontStyle,
+                        ),
+                        letterSpacing: 0.0,
                         fontWeight: FlutterFlowTheme.of(context)
                             .headlineLarge
                             .fontWeight,
@@ -186,14 +202,8 @@ class _EvenementHorecagelegenheidWidgetState
                             .headlineLarge
                             .fontStyle,
                       ),
-                      letterSpacing: 0.0,
-                      fontWeight:
-                          FlutterFlowTheme.of(context).headlineLarge.fontWeight,
-                      fontStyle:
-                          FlutterFlowTheme.of(context).headlineLarge.fontStyle,
-                    ),
+                ),
               ),
-            ),
             Padding(
               padding: EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 8.0),
               child: Builder(
@@ -444,17 +454,33 @@ class _EvenementHorecagelegenheidWidgetState
                                         .fontStyle,
                                   ),
                             ),
-                            Text(
-                              valueOrDefault<String>(
+                            if (EstablishmentInfoCall.establishmentEmail(
+                                      columnEstablishmentInfoResponse.jsonBody,
+                                    ) !=
+                                    null &&
                                 EstablishmentInfoCall.establishmentEmail(
-                                  columnEstablishmentInfoResponse.jsonBody,
+                                      columnEstablishmentInfoResponse.jsonBody,
+                                    ) !=
+                                    '')
+                              Text(
+                                valueOrDefault<String>(
+                                  EstablishmentInfoCall.establishmentEmail(
+                                    columnEstablishmentInfoResponse.jsonBody,
+                                  ),
+                                  'email',
                                 ),
-                                'email',
-                              ),
-                              style: FlutterFlowTheme.of(context)
-                                  .bodyMedium
-                                  .override(
-                                    font: GoogleFonts.inter(
+                                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,
@@ -462,31 +488,32 @@ class _EvenementHorecagelegenheidWidgetState
                                           .bodyMedium
                                           .fontStyle,
                                     ),
-                                    letterSpacing: 0.0,
-                                    fontWeight: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .fontWeight,
-                                    fontStyle: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .fontStyle,
-                                  ),
-                            ),
-                            ClipRRect(
-                              borderRadius: BorderRadius.circular(8.0),
-                              child: CachedNetworkImage(
-                                fadeInDuration: Duration(milliseconds: 500),
-                                fadeOutDuration: Duration(milliseconds: 500),
-                                imageUrl: valueOrDefault<String>(
-                                  EstablishmentInfoCall.establshmentLogo(
-                                    columnEstablishmentInfoResponse.jsonBody,
+                              ),
+                            if (EstablishmentInfoCall.establshmentLogo(
+                                      columnEstablishmentInfoResponse.jsonBody,
+                                    ) !=
+                                    null &&
+                                EstablishmentInfoCall.establshmentLogo(
+                                      columnEstablishmentInfoResponse.jsonBody,
+                                    ) !=
+                                    '')
+                              ClipRRect(
+                                borderRadius: BorderRadius.circular(8.0),
+                                child: CachedNetworkImage(
+                                  fadeInDuration: Duration(milliseconds: 500),
+                                  fadeOutDuration: Duration(milliseconds: 500),
+                                  imageUrl: valueOrDefault<String>(
+                                    EstablishmentInfoCall.establshmentLogo(
+                                      columnEstablishmentInfoResponse.jsonBody,
+                                    ),
+                                    'Logo',
                                   ),
-                                  'Logo',
+                                  width:
+                                      MediaQuery.sizeOf(context).width * 0.15,
+                                  height: 200.0,
+                                  fit: BoxFit.cover,
                                 ),
-                                width: MediaQuery.sizeOf(context).width * 0.15,
-                                height: 200.0,
-                                fit: BoxFit.cover,
                               ),
-                            ),
                             Row(
                               mainAxisSize: MainAxisSize.max,
                               children: [
@@ -496,19 +523,45 @@ class _EvenementHorecagelegenheidWidgetState
                                       FlutterFlowTheme.of(context).primaryText,
                                   size: 24.0,
                                 ),
-                                Flexible(
-                                  child: Text(
-                                    valueOrDefault<String>(
-                                      EstablishmentInfoCall.establishmentPlaats(
-                                        columnEstablishmentInfoResponse
-                                            .jsonBody,
+                                if ((EstablishmentInfoCall.establishmentPlaats(
+                                              columnEstablishmentInfoResponse
+                                                  .jsonBody,
+                                            ) !=
+                                            null &&
+                                        EstablishmentInfoCall
+                                                .establishmentPlaats(
+                                              columnEstablishmentInfoResponse
+                                                  .jsonBody,
+                                            ) !=
+                                            '') &&
+                                    responsiveVisibility(
+                                      context: context,
+                                      phone: false,
+                                    ))
+                                  Flexible(
+                                    child: Text(
+                                      valueOrDefault<String>(
+                                        EstablishmentInfoCall
+                                            .establishmentPlaats(
+                                          columnEstablishmentInfoResponse
+                                              .jsonBody,
+                                        ),
+                                        'Plaats',
                                       ),
-                                      'Plaats',
-                                    ),
-                                    style: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .override(
-                                          font: GoogleFonts.inter(
+                                      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
@@ -518,31 +571,42 @@ class _EvenementHorecagelegenheidWidgetState
                                                     .bodyMedium
                                                     .fontStyle,
                                           ),
-                                          letterSpacing: 0.0,
-                                          fontWeight:
-                                              FlutterFlowTheme.of(context)
-                                                  .bodyMedium
-                                                  .fontWeight,
-                                          fontStyle:
-                                              FlutterFlowTheme.of(context)
-                                                  .bodyMedium
-                                                  .fontStyle,
-                                        ),
+                                    ),
                                   ),
-                                ),
-                                Flexible(
-                                  child: Text(
-                                    valueOrDefault<String>(
-                                      EstablishmentInfoCall.establishmentAdres(
-                                        columnEstablishmentInfoResponse
-                                            .jsonBody,
+                                if (EstablishmentInfoCall.establishmentAdres(
+                                          columnEstablishmentInfoResponse
+                                              .jsonBody,
+                                        ) !=
+                                        null &&
+                                    EstablishmentInfoCall.establishmentAdres(
+                                          columnEstablishmentInfoResponse
+                                              .jsonBody,
+                                        ) !=
+                                        '')
+                                  Flexible(
+                                    child: Text(
+                                      valueOrDefault<String>(
+                                        EstablishmentInfoCall
+                                            .establishmentAdres(
+                                          columnEstablishmentInfoResponse
+                                              .jsonBody,
+                                        ),
+                                        'Adres',
                                       ),
-                                      'Adres',
-                                    ),
-                                    style: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .override(
-                                          font: GoogleFonts.inter(
+                                      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
@@ -552,18 +616,8 @@ class _EvenementHorecagelegenheidWidgetState
                                                     .bodyMedium
                                                     .fontStyle,
                                           ),
-                                          letterSpacing: 0.0,
-                                          fontWeight:
-                                              FlutterFlowTheme.of(context)
-                                                  .bodyMedium
-                                                  .fontWeight,
-                                          fontStyle:
-                                              FlutterFlowTheme.of(context)
-                                                  .bodyMedium
-                                                  .fontStyle,
-                                        ),
+                                    ),
                                   ),
-                                ),
                               ],
                             ),
                             Row(
@@ -718,19 +772,43 @@ class _EvenementHorecagelegenheidWidgetState
                                   Column(
                                     mainAxisSize: MainAxisSize.max,
                                     children: [
-                                      Text(
-                                        valueOrDefault<String>(
+                                      if (EstablishmentInfoCall
+                                                  .establishmentEntreeprijs(
+                                                columnEstablishmentInfoResponse
+                                                    .jsonBody,
+                                              ) !=
+                                              null &&
                                           EstablishmentInfoCall
-                                              .establishmentEntreeprijs(
-                                            columnEstablishmentInfoResponse
-                                                .jsonBody,
+                                                  .establishmentEntreeprijs(
+                                                columnEstablishmentInfoResponse
+                                                    .jsonBody,
+                                              ) !=
+                                              '')
+                                        Text(
+                                          valueOrDefault<String>(
+                                            EstablishmentInfoCall
+                                                .establishmentEntreeprijs(
+                                              columnEstablishmentInfoResponse
+                                                  .jsonBody,
+                                            ),
+                                            'entreeprijs',
                                           ),
-                                          'entreeprijs',
-                                        ),
-                                        style: FlutterFlowTheme.of(context)
-                                            .bodyMedium
-                                            .override(
-                                              font: GoogleFonts.inter(
+                                          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
@@ -740,30 +818,48 @@ class _EvenementHorecagelegenheidWidgetState
                                                         .bodyMedium
                                                         .fontStyle,
                                               ),
-                                              letterSpacing: 0.0,
-                                              fontWeight:
-                                                  FlutterFlowTheme.of(context)
-                                                      .bodyMedium
-                                                      .fontWeight,
-                                              fontStyle:
-                                                  FlutterFlowTheme.of(context)
-                                                      .bodyMedium
-                                                      .fontStyle,
+                                        ),
+                                      if ((EstablishmentInfoCall
+                                                      .establishmentEntreeToelichting(
+                                                    columnEstablishmentInfoResponse
+                                                        .jsonBody,
+                                                  ) !=
+                                                  null &&
+                                              EstablishmentInfoCall
+                                                      .establishmentEntreeToelichting(
+                                                    columnEstablishmentInfoResponse
+                                                        .jsonBody,
+                                                  ) !=
+                                                  '') &&
+                                          responsiveVisibility(
+                                            context: context,
+                                            phone: false,
+                                          ))
+                                        Text(
+                                          valueOrDefault<String>(
+                                            EstablishmentInfoCall
+                                                .establishmentEntreeToelichting(
+                                              columnEstablishmentInfoResponse
+                                                  .jsonBody,
                                             ),
-                                      ),
-                                      Text(
-                                        valueOrDefault<String>(
-                                          EstablishmentInfoCall
-                                              .establishmentEntreeToelichting(
-                                            columnEstablishmentInfoResponse
-                                                .jsonBody,
+                                            'EntreeToelichting',
                                           ),
-                                          'EntreeToelichting',
-                                        ),
-                                        style: FlutterFlowTheme.of(context)
-                                            .bodyMedium
-                                            .override(
-                                              font: GoogleFonts.inter(
+                                          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
@@ -773,17 +869,7 @@ class _EvenementHorecagelegenheidWidgetState
                                                         .bodyMedium
                                                         .fontStyle,
                                               ),
-                                              letterSpacing: 0.0,
-                                              fontWeight:
-                                                  FlutterFlowTheme.of(context)
-                                                      .bodyMedium
-                                                      .fontWeight,
-                                              fontStyle:
-                                                  FlutterFlowTheme.of(context)
-                                                      .bodyMedium
-                                                      .fontStyle,
-                                            ),
-                                      ),
+                                        ),
                                     ],
                                   ),
                                 ],
@@ -1201,18 +1287,42 @@ class _EvenementHorecagelegenheidWidgetState
                                           .fontStyle,
                                     ),
                               ),
-                            Text(
-                              valueOrDefault<String>(
-                                EstablishmentInfoCall
-                                    .establshmentOpeningUitzondering(
-                                  columnEstablishmentInfoResponse.jsonBody,
+                            if ((EstablishmentInfoCall
+                                            .establshmentOpeningUitzondering(
+                                          columnEstablishmentInfoResponse
+                                              .jsonBody,
+                                        ) !=
+                                        null &&
+                                    EstablishmentInfoCall
+                                            .establshmentOpeningUitzondering(
+                                          columnEstablishmentInfoResponse
+                                              .jsonBody,
+                                        ) !=
+                                        '') &&
+                                responsiveVisibility(
+                                  context: context,
+                                  phone: false,
+                                ))
+                              Text(
+                                valueOrDefault<String>(
+                                  EstablishmentInfoCall
+                                      .establshmentOpeningUitzondering(
+                                    columnEstablishmentInfoResponse.jsonBody,
+                                  ),
+                                  'OpeningstijdenUitzondering',
                                 ),
-                                'OpeningstijdenUitzondering',
-                              ),
-                              style: FlutterFlowTheme.of(context)
-                                  .bodyMedium
-                                  .override(
-                                    font: GoogleFonts.inter(
+                                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,
@@ -1220,15 +1330,7 @@ class _EvenementHorecagelegenheidWidgetState
                                           .bodyMedium
                                           .fontStyle,
                                     ),
-                                    letterSpacing: 0.0,
-                                    fontWeight: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .fontWeight,
-                                    fontStyle: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .fontStyle,
-                                  ),
-                            ),
+                              ),
                           ],
                         ),
                         Column(
@@ -1290,17 +1392,31 @@ class _EvenementHorecagelegenheidWidgetState
                                 );
                               },
                             ),
-                            Text(
-                              valueOrDefault<String>(
-                                EstablishmentInfoCall.establishmentbezorgtijden(
+                            if (getJsonField(
                                   columnEstablishmentInfoResponse.jsonBody,
+                                  r'''$[:].bezorgtijden''',
+                                ) !=
+                                null)
+                              Text(
+                                valueOrDefault<String>(
+                                  EstablishmentInfoCall
+                                      .establishmentbezorgtijden(
+                                    columnEstablishmentInfoResponse.jsonBody,
+                                  ),
+                                  'Bezorgtijden',
                                 ),
-                                'Bezorgtijden',
-                              ),
-                              style: FlutterFlowTheme.of(context)
-                                  .bodyMedium
-                                  .override(
-                                    font: GoogleFonts.inter(
+                                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,
@@ -1308,15 +1424,7 @@ class _EvenementHorecagelegenheidWidgetState
                                           .bodyMedium
                                           .fontStyle,
                                     ),
-                                    letterSpacing: 0.0,
-                                    fontWeight: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .fontWeight,
-                                    fontStyle: FlutterFlowTheme.of(context)
-                                        .bodyMedium
-                                        .fontStyle,
-                                  ),
-                            ),
+                              ),
                             Text(
                               valueOrDefault<String>(
                                 EstablishmentInfoCall.establishmentBezorgkosten(