Skip to content
Snippets Groups Projects
Commit 1d2bc462 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Add placeholder image asset

parent f5a80707
Branches
Tags
1 merge request!12Resolve "Add image placeholder asset"
Pipeline #960 passed
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.10 app.versionName=0.0.11
app.versionCode=10 app.versionCode=11
assets/placeholder.png

2.45 KiB

...@@ -51,13 +51,16 @@ class GamePickWordPage extends StatelessWidget { ...@@ -51,13 +51,16 @@ class GamePickWordPage extends StatelessWidget {
} }
Container _buildImageContainer(String image, Color color) { Container _buildImageContainer(String image, Color color) {
String imageAsset = 'assets/placeholder.png';
if (image != null) {
imageAsset = 'assets/images/'+image;
}
return Container( return Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: FlatButton( child: FlatButton(
color: Colors.teal, color: Colors.teal,
child: image == null ? child: Image(image: AssetImage(imageAsset)),
Text('') :
Image(image: AssetImage('assets/images/'+image)),
), ),
); );
} }
......
...@@ -22,3 +22,4 @@ flutter: ...@@ -22,3 +22,4 @@ flutter:
- assets/assets_images.json - assets/assets_images.json
- assets/files/ - assets/files/
- assets/images/ - assets/images/
- assets/placeholder.png
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment