dash_chat icon indicating copy to clipboard operation
dash_chat copied to clipboard

[Bug] Possible bug about firestore package out of date API

Open lucasjinreal opened this issue 5 years ago • 3 comments

lib/main.dart:197:31: Error: 'StorageReference' isn't a type.
                        final StorageReference storageRef =
                              ^^^^^^^^^^^^^^^^
lib/main.dart:200:25: Error: 'StorageUploadTask' isn't a type.
                        StorageUploadTask uploadTask = storageRef.putFile(
                        ^^^^^^^^^^^^^^^^^
lib/main.dart:206:25: Error: 'StorageTaskSnapshot' isn't a type.
                        StorageTaskSnapshot download =
                        ^^^^^^^^^^^^^^^^^^^

I am just cloned the repo, and my flutter is:

❯ flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.24.0-6.0.pre, on Linux, locale en_HK.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✗] Linux toolchain - develop for Linux desktop
    ✗ The blkid development library is required for Linux development.
      It is likely available from your distribution (e.g.: apt install libblkid-dev)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.50.1)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

anybody knows how to solve it?

lucasjinreal avatar Nov 23 '20 08:11 lucasjinreal

I found the apps acutally seems out-of-date and examples with some mistakes.

can author have a check please?

image

Under examples main.dart L121:

                  items.map((i) => ChatMessage.fromJson(i.data)).toList();

It should be:

                  items.map((i) => ChatMessage.fromJson(i.data())).toList();

Otherwise the file even can't pass syntax examine.

lucasjinreal avatar Nov 23 '20 08:11 lucasjinreal

@jinfagang You have to initialize Firebase: https://stackoverflow.com/questions/64402222/no-firebase-app-default-has-been-created-call-firebase-initializeapp-the

marcoheine avatar Dec 13 '20 13:12 marcoheine

Hello, with latest version the example has been fixed to support lates Firestore API.

diegogarciar avatar Mar 17 '21 01:03 diegogarciar