this repo has no description

feat: Simplify profile fetching logic in ExplorePage by removing redundant asyncProfile checks

+4 -10
+4 -10
lib/screens/explore_page.dart
··· 6 import 'package:grain/app_icons.dart'; 7 import 'package:grain/models/profile.dart'; 8 import 'package:grain/providers/profile_provider.dart'; 9 import 'package:grain/widgets/app_image.dart'; 10 import 'package:grain/widgets/plain_text_field.dart'; 11 import 'package:shared_preferences/shared_preferences.dart'; 12 - 13 - import 'profile_page.dart'; 14 15 class ExplorePage extends ConsumerStatefulWidget { 16 const ExplorePage({super.key}); ··· 41 final profiles = <Profile>[]; 42 for (final did in dids) { 43 try { 44 - final asyncProfile = ref.watch(profileNotifierProvider(did)); 45 - if (asyncProfile.hasValue && asyncProfile.value != null) { 46 - profiles.add(asyncProfile.value!.profile); 47 - } else { 48 - final profileWithGalleries = await ref.refresh(profileNotifierProvider(did).future); 49 - if (profileWithGalleries != null) { 50 - profiles.add(profileWithGalleries.profile); 51 - } 52 } 53 } catch (_) {} 54 }
··· 6 import 'package:grain/app_icons.dart'; 7 import 'package:grain/models/profile.dart'; 8 import 'package:grain/providers/profile_provider.dart'; 9 + import 'package:grain/screens/profile_page.dart'; 10 import 'package:grain/widgets/app_image.dart'; 11 import 'package:grain/widgets/plain_text_field.dart'; 12 import 'package:shared_preferences/shared_preferences.dart'; 13 14 class ExplorePage extends ConsumerStatefulWidget { 15 const ExplorePage({super.key}); ··· 40 final profiles = <Profile>[]; 41 for (final did in dids) { 42 try { 43 + final profileWithGalleries = await ref.read(profileNotifierProvider(did).future); 44 + if (profileWithGalleries != null) { 45 + profiles.add(profileWithGalleries.profile); 46 } 47 } catch (_) {} 48 }