Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
555 views
in Technique[技术] by (71.8m points)

flutter - No error but load image from firebase storage image not displayed

I read all previous post regarding this issue. But i could nt solve it.

I didnt receive any errors.

I also checked logcat. I dont know how to solve this issue.

few errors were regarding emulator. so tried with both API 28,29

[enter image description here][1]

I am new in flutter.

    class _DashState extends State<Dash> {
      @override
      Widget build(BuildContext context) {
        Future<Widget> _getImage(BuildContext context, String imageName) async {
          Image image;
          await FireStorageService.loadImage(context, imageName).then((value) {
            image = Image.network(
              value.toString(),
              fit: BoxFit.scaleDown,
            );
          });
          return image;
        }
        return Scaffold(
          body: Column(
            children: [
              FutureBuilder(
                future: _getImage(context, 'images/logo123'),
                builder: (context, snapshot) {
                  if (snapshot.connectionState ==
                      ConnectionState.done)
                    return Container(
                      height:
                      MediaQuery.of(context).size.height / 2.25,
                      width:
                      MediaQuery.of(context).size.width / 2.25,
                      child: snapshot.data,
                    );
    
                  if (snapshot.connectionState ==
                      ConnectionState.waiting)
                    return Container(
                        height: MediaQuery.of(context).size.height /
                            2.25,
                        width: MediaQuery.of(context).size.width /
                            2.25,
                        child: CircularProgressIndicator());
    
                  return Container();
                },
              ),
              Text('hjjjh'),
            ],
    
          ),
    
        );
    
      }
    
    }
    
    class FireStorageService extends ChangeNotifier {
      FireStorageService();
      static Future<dynamic> loadImage(BuildContext context, String image) async {
        return await FirebaseStorage.instance.ref().child(image).getDownloadURL();
      }
    }


  [1]: https://i.stack.imgur.com/zoP5f.png

Logcat 
2021-01-28 15:59:16.912 6033-6033/com.example.chinnifoodappnew E/hinnifoodappne: Unknown bits set in runtime_flags: 0x8000

2021-01-28 15:59:25.048 6033-6033/com.example.chinnifoodappnew E/libc: Access denied finding property "ro.serialno"
question from:https://stackoverflow.com/questions/65936564/no-error-but-load-image-from-firebase-storage-image-not-displayed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...