Explorar el Código

Fix empty-URL crash in EvenementComponent (2 instances) + sync latest state

Same ConditionalBuilder pattern applied to the Carousel photo (fotoosItem)
and horeca-logo (EvenementCall.eventLogog) images in EvenementComponent.
6 of ~10 known instances of this bug are now fixed app-wide.
bob hace 1 mes
padre
commit
b9a8c858db

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

+ 50 - 22
lib/evenement/evenement_component/evenement_component_widget.dart

@@ -169,16 +169,28 @@ class _EvenementComponentWidgetState extends State<EvenementComponentWidget>
                       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 Builder(
+                          builder: (context) {
+                            if (fotoosItem != '') {
+                              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,
+                                ),
+                              );
+                            } else {
+                              return Icon(
+                                Icons.image_not_supported,
+                                color: FlutterFlowTheme.of(context).primaryText,
+                                size: 24.0,
+                              );
+                            }
+                          },
                         );
                       },
                       carouselController: _model.carouselController ??=
@@ -455,18 +467,34 @@ class _EvenementComponentWidgetState extends State<EvenementComponentWidget>
                   verticalDirection: VerticalDirection.down,
                   clipBehavior: Clip.none,
                   children: [
-                    ClipRRect(
-                      borderRadius: BorderRadius.circular(8.0),
-                      child: CachedNetworkImage(
-                        fadeInDuration: Duration(milliseconds: 500),
-                        fadeOutDuration: Duration(milliseconds: 500),
-                        imageUrl: EvenementCall.eventLogog(
-                          columnEvenementResponse.jsonBody,
-                        )!,
-                        width: 40.0,
-                        height: 40.0,
-                        fit: BoxFit.cover,
-                      ),
+                    Builder(
+                      builder: (context) {
+                        if (getJsonField(
+                              columnEvenementResponse.jsonBody,
+                              r'''$[0].logo''',
+                            ) !=
+                            null) {
+                          return ClipRRect(
+                            borderRadius: BorderRadius.circular(8.0),
+                            child: CachedNetworkImage(
+                              fadeInDuration: Duration(milliseconds: 500),
+                              fadeOutDuration: Duration(milliseconds: 500),
+                              imageUrl: EvenementCall.eventLogog(
+                                columnEvenementResponse.jsonBody,
+                              )!,
+                              width: 40.0,
+                              height: 40.0,
+                              fit: BoxFit.cover,
+                            ),
+                          );
+                        } else {
+                          return Icon(
+                            Icons.image_not_supported,
+                            color: FlutterFlowTheme.of(context).primaryText,
+                            size: 24.0,
+                          );
+                        }
+                      },
                     ),
                     Container(
                       width: MediaQuery.sizeOf(context).width * 0.4,

+ 22 - 8
lib/kanweg/kanweg/kanweg_widget.dart

@@ -164,14 +164,28 @@ class _KanwegWidgetState extends State<KanwegWidget> with RouteAware {
                     mainAxisSize: MainAxisSize.max,
                     children: List.generate(items.length, (itemsIndex) {
                       final itemsItem = items[itemsIndex];
-                      return ClipRRect(
-                        borderRadius: BorderRadius.circular(8.0),
-                        child: Image.network(
-                          'https://picsum.photos/seed/736/600',
-                          width: 200.0,
-                          height: 200.0,
-                          fit: BoxFit.cover,
-                        ),
+                      return Text(
+                        getJsonField(
+                          itemsItem,
+                          r'''$.title''',
+                        ).toString(),
+                        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,
+                            ),
                       );
                     }),
                   );

+ 1 - 9
lib/login/login/login_widget.dart

@@ -732,15 +732,7 @@ class _LoginWidgetState extends State<LoginWidget> with RouteAware {
                           ),
                           FFButtonWidget(
                             onPressed: () async {
-                              context.pushNamed(
-                                HorecagelegenhedenOverzichtWidget.routeName,
-                                queryParameters: {
-                                  'plaats': serializeParam(
-                                    FFAppState().provincieSelectId,
-                                    ParamType.String,
-                                  ),
-                                }.withoutNulls,
-                              );
+                              context.pushNamed(KanwegWidget.routeName);
                             },
                             text: FFLocalizations.of(context).getText(
                               'ym0dczsr' /* kanwegtest */,