Ошибка при попытке распечатать информацию в консоли из базы данных Firestore в Dart - PullRequest
0 голосов
/ 14 февраля 2020

Я пытаюсь сделать запрос к базе данных пожарного магазина, сохранить информацию в массивах и распечатать их. Но ошибка появляется каждый раз, когда я пытаюсь запустить файл в Dart Configuration. Ошибка показывает, что Dart UI не найден в плагине Firestore. Код и журналы ошибок приведены ниже.

import 'dart:async';

import 'package:cloud_firestore/cloud_firestore.dart';

dynamic response;

class getData {
  Future<void> callFunction() async {
    final Firestore databaseReference = Firestore.instance;

    final Query query = databaseReference.collection('location_data');
    final QuerySnapshot snapshot = await await query.getDocuments();
    response = snapshot.documents;
    print(response);
  }
}

Журналы ошибок:

D:\flutter_windows_v1.9.1+hotfix.6-stable\flutter\bin\cache\dart-sdk\bin\dart.exe --enable-asserts --enable-vm-service:51548 "C:\Users\Adithya B. Shetty\Desktop\BEST Help\Project  Repository\Bus Information System\Flutter Application\bus_information_system\bus_informatio_system\lib\DartFirebaseBackend.dart"
Observatory listening on http://127.0.0.1:51548/qe5U4P2pa5E=/

lib/DartFirebaseBackend.dart: Warning: Interpreting this as package URI, 'package:bus_informatio_system/DartFirebaseBackend.dart'.
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.0+1/lib/cloud_firestore.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' show hashValues, hashList;
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/foundation/basic_types.dart:10:1: Error: Not found: 'dart:ui'
export 'dart:ui' show VoidCallback;
^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/foundation/binding.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui show saveCompilationTrace, Window, window;
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/foundation/key.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show hashValues;
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/services/binary_messenger.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/services/binding.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/services/font_loader.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/services/platform_messages.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/services/platform_views.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
       ^
/D:/flutter_windows_v1.9.1+hotfix.6-stable/flutter/packages/flutter/lib/src/services/raw_keyboard.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
       ^

Process finished with exit code 254
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...