Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class TercerReto extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- leading: Icon(
- Icons.dehaze
- ),
- centerTitle: true,
- title: Text(
- 'Rock clásico',
- style: TextStyle(
- fontFamily: "Lato",
- fontWeight: FontWeight.w900
- ),
- ),
- elevation: 0.0,
- backgroundColor: Color(0xFFD299C2),
- ),
- body: Stack(
- children: <Widget>[
- CustomBackground(),
- BandCardList()
- ],
- ),
- );
- }
- }
- class CustomBackground extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Container(
- height: MediaQuery.of(context).size.height,
- width: MediaQuery.of(context).size.width,
- decoration: BoxDecoration(
- gradient: LinearGradient(
- colors: [
- Color(0xFFD299C2),
- Color(0xFFfef9d7)
- ],
- begin: Alignment(-0.2, -1.0),
- end: Alignment(0.0, 1.0),
- stops: [0.3,1.0]
- )
- ),
- );
- }
- }
- class BandCard extends StatelessWidget {
- String image;
- String bandName;
- String bandYears;
- bool favorite;
- BandCard(this.image, this.bandName, this.bandYears, this.favorite);
- @override
- Widget build(BuildContext context) {
- Widget favoriteState;
- if(favorite){
- favoriteState = Icon(
- Icons.favorite,
- color: Colors.pinkAccent,
- );
- }
- else{
- favoriteState = Icon(
- Icons.favorite_border,
- color: Colors.pinkAccent,
- );
- }
- return Card(
- color: Colors.transparent,
- elevation: 0.6,
- margin: EdgeInsets.only(
- top: 20.0,
- left: 20.0,
- right: 20.0
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: <Widget>[
- ListTile(
- leading: CircleAvatar(
- backgroundImage: NetworkImage(image),
- ),
- title: Text(
- bandName,
- style: TextStyle(
- fontFamily: "Lato",
- fontWeight: FontWeight.w600,
- fontSize: 20.0
- ),
- ),
- subtitle: Text(
- bandYears,
- style: TextStyle(
- fontFamily: "Lato",
- fontWeight: FontWeight.w400,
- fontSize: 17.0
- ),
- ),
- trailing: favoriteState,
- )
- ],
- ),
- );
- }
- }
- class BandCardList extends StatelessWidget {
- String queenImage = 'http://www.mexmads.com/wp-content/uploads/2018/11/z10358342QQueen.jpg';
- String pinkFImage = 'https://universal881.com/wp-content/uploads/2016/10/Blog_20161003_Universal_Musica_8DatosCuriososDeRogerWaters2.jpg';
- String gunsImage = 'https://pbs.twimg.com/profile_images/885491686327169024/ufh03Wmg.jpg';
- String aerosmithFImage = 'https://www.musicrecordshop.com/media/catalog/product/cache/1/image/650x/040ec09b1e35df139433887a97daa66f/a/e/aerosmith.jpg';
- String ledZImage = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRsI61Y-VSVwVC3GM4xanp71VX59HLbFkSDzK1JbyX8zhGfja7hsw';
- String smithsImage = 'https://is4-ssl.mzstatic.com/image/thumb/Music4/v4/fd/e2/24/fde224a7-3ce9-3d93-8a12-eaab672c78a1/825646937097.jpg/600x600bf.png';
- @override
- Widget build(BuildContext context) {
- return ListView(
- children: <Widget>[
- BandCard(queenImage, 'Queen', '1970-',true),
- BandCard(pinkFImage, 'Pink Floyd', '1965-1995 ', true),
- BandCard(gunsImage, 'Guns N Roses', '1985-', false),
- BandCard(aerosmithFImage, 'Aerosmith', '1970-', false),
- BandCard(ledZImage, 'Led Zepellin', '1968-1980', false),
- BandCard(smithsImage, 'The Smiths', '1982-1987', true),
- BandCard(queenImage, 'Queen', '1970-',true),
- BandCard(queenImage, 'Queen', '1970-',true),
- BandCard(queenImage, 'Queen', '1970-',true),
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement