Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AssetImage _imageToShow;
- @override
- iniState(){
- _imageToShow = AssetImage('youAssetImage');
- }
- Container(
- padding: EdgeInsets.only(left: 10.0),
- height: MediaQuery.of(context).size.height * 0.5,
- decoration: new BoxDecoration(
- image: new DecorationImage(
- image: _ImageToShow,
- fit: BoxFit.cover,
- ),
- )),
- ),
- void updateImage() {
- setState ((){
- if (someCondition) {
- _imageToShow = new AssetImage(lesson.imagePath);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement