Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement