From c1a4a339db0f6d26b9d3a4e755ab64fd39cf05ab Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 8 Nov 2023 16:34:01 +0530 Subject: [PATCH 1/2] Added error builder in case logo url returns error --- .../lib/src/hls_viewer/hls_viewer_header.dart | 8 ++++++++ .../hms_room_kit/lib/src/meeting/meeting_header.dart | 9 +++++++++ .../hms_room_kit/lib/src/preview/preview_header.dart | 8 ++++++++ .../src/preview_for_role/preview_for_role_header.dart | 10 ++++++++++ 4 files changed, 35 insertions(+) diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart index 6f9e42d6b..83a72b74f 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart @@ -1,4 +1,5 @@ ///Dart imports +import 'dart:developer'; import 'dart:io'; import 'package:flutter/material.dart'; @@ -44,6 +45,13 @@ class HLSViewerHeader extends StatelessWidget { HMSRoomLayout.roleLayoutData!.logo!.url!) : Image.network( HMSRoomLayout.roleLayoutData!.logo!.url!, + errorBuilder: (context, exception, _) { + log('Error is $exception'); + return const SizedBox( + width: 30, + height: 30, + ); + }, height: 30, width: 30, ), diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_header.dart b/packages/hms_room_kit/lib/src/meeting/meeting_header.dart index 704703cfe..d2d90803d 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_header.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_header.dart @@ -1,4 +1,5 @@ ///Dart imports +import 'dart:developer'; import 'dart:io'; ///Package imports @@ -60,6 +61,14 @@ class _MeetingHeaderState extends State { ) : Image.network( HMSRoomLayout.roleLayoutData!.logo!.url!, + errorBuilder: + (context, exception, _) { + log('Error is $exception'); + return const SizedBox( + width: 30, + height: 30, + ); + }, height: 30, width: 30, ), diff --git a/packages/hms_room_kit/lib/src/preview/preview_header.dart b/packages/hms_room_kit/lib/src/preview/preview_header.dart index 1d56cc9f1..c4b2650cb 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_header.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_header.dart @@ -1,4 +1,5 @@ ///dart imports +import 'dart:developer'; import 'dart:io'; ///Package imports @@ -69,6 +70,13 @@ class PreviewHeader extends StatelessWidget { ) : Image.network( HMSRoomLayout.roleLayoutData!.logo!.url!, + errorBuilder: (context, exception, _) { + log('Error is $exception'); + return const SizedBox( + width: 30, + height: 30, + ); + }, height: 30, width: 30, ), diff --git a/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart b/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart index 0b1571cf5..c25deda2e 100644 --- a/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart +++ b/packages/hms_room_kit/lib/src/preview_for_role/preview_for_role_header.dart @@ -1,3 +1,6 @@ +///Dart imports +import 'dart:developer'; + ///Package imports import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -37,6 +40,13 @@ class _PreviewForRoleHeaderState extends State { HMSRoomLayout.roleLayoutData!.logo!.url!) : Image.network( HMSRoomLayout.roleLayoutData!.logo!.url!, + errorBuilder: (context, exception, _) { + log('Error is $exception'); + return const SizedBox( + width: 30, + height: 30, + ); + }, height: 30, width: 30, ), From ff34c9bc2629147f3c94ee0111c6f60574eece85 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 8 Nov 2023 16:34:29 +0530 Subject: [PATCH 2/2] Lint fixes --- .../hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart | 2 +- packages/hms_room_kit/lib/src/meeting/meeting_header.dart | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart index 83a72b74f..33d8f8a5f 100644 --- a/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart +++ b/packages/hms_room_kit/lib/src/hls_viewer/hls_viewer_header.dart @@ -46,7 +46,7 @@ class HLSViewerHeader extends StatelessWidget { : Image.network( HMSRoomLayout.roleLayoutData!.logo!.url!, errorBuilder: (context, exception, _) { - log('Error is $exception'); + log('Error is $exception'); return const SizedBox( width: 30, height: 30, diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_header.dart b/packages/hms_room_kit/lib/src/meeting/meeting_header.dart index d2d90803d..3a2a42abf 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_header.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_header.dart @@ -61,8 +61,7 @@ class _MeetingHeaderState extends State { ) : Image.network( HMSRoomLayout.roleLayoutData!.logo!.url!, - errorBuilder: - (context, exception, _) { + errorBuilder: (context, exception, _) { log('Error is $exception'); return const SizedBox( width: 30,