Minified FirebaseFirestore datatypes (Map, List, etc.) in release mode (Flutter Web)

32 Views Asked by At

Every Firestore data I got in my flutter web (as e.g. in the stream below) were minified in release mode. In detail the runtimeTypes Map, List and Timestamp become "minified:...". In reference to the example below: Already the values of the DocumentSnapshot fields of snapshot.data are minified.

I´ve the newest Version of flutter, dart and android studio. My temporary workaround is to launch the website with:

flutter build web --profile --dart-define=Dart2jsOptimization=O0 --no-tree-shake-icons

but of course this is neither a solution to the problem nor a permanent method.

Thank you very much for your comments!

static StreamSubscription? surveyListener;
  static ValueNotifier<List<DocumentSnapshot>> surveyDocs = ValueNotifier<List<DocumentSnapshot>>([]);
  static Future<void> loadSurveyData(BuildContext context) async{
    SharedPreferences storage = await SharedPreferences.getInstance();
    String city = storage.getString("CityCharasteristics_key")!;
    if(surveyListener == null){
      Completer<void> completer = Completer<void>();
      surveyListener = FirebaseFirestore.instance.collection(city).doc(city).collection('survey')
          .snapshots()
          .listen((QuerySnapshot snapshot) async {
        try {
          List<DocumentSnapshot<Map<String, dynamic>>> docs = [];
          await Future.forEach(snapshot.docs as List<DocumentSnapshot<Map<String, dynamic>>>, (element) async {
            if (documentValidation(element, surveyValidationMap, true)) {
              docs.add(element);
            }
          });
          ContentStreams.surveyDocs.value = docs;
        } catch (e) {
          print('Fehler beim Laden der Daten: $e');
        } finally {
          if (!completer.isCompleted) {
            completer.complete();
          }
        }
      });
      await completer.future;
    }else{
      if(surveyListener!.isPaused){
        surveyListener!.resume();
      }
    }
  }
0

There are 0 best solutions below