Created
May 18, 2020 12:56
-
-
Save theindianappguy/391e2f6edb96dea09753cbbd984cfb2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CategoriesTile extends StatelessWidget { | |
final String imgUrls, categorie; | |
CategoriesTile({@required this.imgUrls, @required this.categorie}); | |
@override | |
Widget build(BuildContext context) { | |
return GestureDetector( | |
onTap: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute( | |
builder: (context) => CategorieScreen( | |
categorie: categorie, | |
))); | |
}, | |
child: Container( | |
margin: EdgeInsets.only(right: 8), | |
child: kIsWeb | |
? Column( | |
children: <Widget>[ | |
ClipRRect( | |
borderRadius: BorderRadius.circular(8), | |
child: kIsWeb | |
? Image.network( | |
imgUrls, | |
height: 50, | |
width: 100, | |
fit: BoxFit.cover, | |
) | |
: CachedNetworkImage( | |
imageUrl: imgUrls, | |
height: 50, | |
width: 100, | |
fit: BoxFit.cover, | |
)), | |
SizedBox( | |
height: 4, | |
), | |
Container( | |
width: 100, | |
alignment: Alignment.center, | |
child: Text( | |
categorie, | |
style: TextStyle( | |
color: Colors.black54, | |
fontSize: 13, | |
fontWeight: FontWeight.w400, | |
fontFamily: 'Overpass'), | |
)), | |
], | |
) | |
: Stack( | |
children: <Widget>[ | |
ClipRRect( | |
borderRadius: BorderRadius.circular(8), | |
child: kIsWeb | |
? Image.network( | |
imgUrls, | |
height: 50, | |
width: 100, | |
fit: BoxFit.cover, | |
) | |
: CachedNetworkImage( | |
imageUrl: imgUrls, | |
height: 50, | |
width: 100, | |
fit: BoxFit.cover, | |
)), | |
Container( | |
height: 50, | |
width: 100, | |
decoration: BoxDecoration( | |
color: Colors.black26, | |
borderRadius: BorderRadius.circular(8), | |
), | |
), | |
Container( | |
height: 50, | |
width: 100, | |
alignment: Alignment.center, | |
child: Text( | |
categorie ?? "Yo Yo", | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 15, | |
fontWeight: FontWeight.w500, | |
fontFamily: 'Overpass'), | |
)) | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment