How to Show an Local image till the NetworkImage() Loads Up in flutter?

前端 未结 9 1152
忘掉有多难
忘掉有多难 2021-02-13 03:15
            new CircleAvatar(
                              backgroundColor: Colors.black87,
                              backgroundImage: new NetworkImage(url),
               


        
9条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 03:44

    There is a new cached_network_image package that has a "loading" and an "error" images. Along with auto image caching. https://stackoverflow.com/a/57493334/5502121

    You can set as a placeholder anything you want, for example from your assets use Image.asset('assets/images/my_placeholder.png')

提交回复
热议问题