Loading lib/pages/collections/postcard_tile.dart +9 −11 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ class PostcardTile extends StatelessWidget { SizedBox( height: 8, ), _senderDetail(mediaService) _senderDetail(context, mediaService) ], ), ), Loading @@ -59,22 +59,20 @@ class PostcardTile extends StatelessWidget { ); } Widget _senderDetail(MediaService mediaService) { Widget _senderDetail( BuildContext context, MediaService mediaService, ) { return Row( children: [ Text(postcard.sender.userName.length > 13 ? '${postcard.sender.userName.substring(0, 13)}..' : postcard.sender.userName), Spacer(), FutureBuilderHandler( future: mediaService.getFlagBitcode(postcard.originLocation), builder: (BuildContext context, data) { return Text( data, style: TextStyle( fontSize: MediaQuery.of(context).textScaleFactor * 20), ); }, Text( mediaService.getFlagBitcode(postcard.originLocation), style: TextStyle(fontSize: MediaQuery.of(context).textScaleFactor * 20), ), ], ); Loading lib/service/media_service.dart +3 −6 Original line number Diff line number Diff line import 'dart:io'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:country_picker/country_picker.dart'; import 'package:firebase_storage/firebase_storage.dart'; import 'package:path/path.dart' as p; import 'package:stamped/data/entities/country_entity.dart'; Loading @@ -27,12 +28,8 @@ class MediaService { }, ); Future<String> getFlagBitcode(String country) async { final countrySnapshot = await _countryCollection.doc(country).get(); if (!countrySnapshot.exists) { throw Exception('Country $country not found'); } return countrySnapshot.data()!.flag; String getFlagBitcode(String country) { return Country.tryParse(country)?.flagEmoji ?? ''; } Future<Reference?> uploadImage( Loading Loading
lib/pages/collections/postcard_tile.dart +9 −11 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ class PostcardTile extends StatelessWidget { SizedBox( height: 8, ), _senderDetail(mediaService) _senderDetail(context, mediaService) ], ), ), Loading @@ -59,22 +59,20 @@ class PostcardTile extends StatelessWidget { ); } Widget _senderDetail(MediaService mediaService) { Widget _senderDetail( BuildContext context, MediaService mediaService, ) { return Row( children: [ Text(postcard.sender.userName.length > 13 ? '${postcard.sender.userName.substring(0, 13)}..' : postcard.sender.userName), Spacer(), FutureBuilderHandler( future: mediaService.getFlagBitcode(postcard.originLocation), builder: (BuildContext context, data) { return Text( data, style: TextStyle( fontSize: MediaQuery.of(context).textScaleFactor * 20), ); }, Text( mediaService.getFlagBitcode(postcard.originLocation), style: TextStyle(fontSize: MediaQuery.of(context).textScaleFactor * 20), ), ], ); Loading
lib/service/media_service.dart +3 −6 Original line number Diff line number Diff line import 'dart:io'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:country_picker/country_picker.dart'; import 'package:firebase_storage/firebase_storage.dart'; import 'package:path/path.dart' as p; import 'package:stamped/data/entities/country_entity.dart'; Loading @@ -27,12 +28,8 @@ class MediaService { }, ); Future<String> getFlagBitcode(String country) async { final countrySnapshot = await _countryCollection.doc(country).get(); if (!countrySnapshot.exists) { throw Exception('Country $country not found'); } return countrySnapshot.data()!.flag; String getFlagBitcode(String country) { return Country.tryParse(country)?.flagEmoji ?? ''; } Future<Reference?> uploadImage( Loading