SHARE
TWEET

Untitled

a guest Jun 17th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AssetImage _imageToShow;
  2.      
  3. @override
  4. iniState(){
  5.    _imageToShow = AssetImage('youAssetImage');
  6. }
  7.      
  8. Container(
  9.             padding: EdgeInsets.only(left: 10.0),
  10.             height: MediaQuery.of(context).size.height * 0.5,
  11.             decoration: new BoxDecoration(
  12.               image: new DecorationImage(
  13.                 image: _ImageToShow,
  14.                 fit: BoxFit.cover,
  15.               ),
  16.             )),
  17.  ),
  18.      
  19. void updateImage() {
  20.    setState ((){
  21.       if (someCondition) {
  22.         _imageToShow = new AssetImage(lesson.imagePath);
  23.       }
  24.     });
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top