Changed Background colour and added some additional data to it.
This commit is contained in:
parent
95611cf38d
commit
a4d7cb0ebd
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
|
@ -13,7 +13,7 @@ class MyApp extends StatelessWidget {
|
|||
//title: 'Recipes',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSwatch().copyWith(
|
||||
primary: const Color(0xff263341),
|
||||
primary: Colors.white,
|
||||
secondary: const Color(0xff8DB646), // Your accent color
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class DetailsPage extends StatelessWidget {
|
|||
];
|
||||
},
|
||||
body: Container(
|
||||
color: Theme.of(context).primaryColor,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(top: 8.0),
|
||||
child: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
|
|
|
|||
|
|
@ -114,75 +114,88 @@ class HomePage extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
), */
|
||||
child: GridView.builder(
|
||||
shrinkWrap: false,
|
||||
itemCount: Data.recipes.length,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DetailsPage(
|
||||
recipe: Data.recipes[index],
|
||||
)));
|
||||
},
|
||||
child: Card(
|
||||
color: Color.fromARGB(255, 249, 171, 21),
|
||||
//color: Color.fromARGB(255, 253, 73, 73), //FD4949 //Nachtleben
|
||||
//color: Color.fromARGB(255, 80, 168, 250), //50A8FA//Kunst
|
||||
//color: Color.fromARGB(255, 80, 240, 250), //50F0FA //Sport
|
||||
//color: Color.fromARGB(255, 130, 73, 253), //8249FD //Gesundheit
|
||||
//color: Color.fromARGB(255, 253, 73, 73), //FD4949//Essen
|
||||
//color: Color.fromARGB(255, 255, 0, 199), //FF00C7//Soziales
|
||||
//color: Color.fromARGB(255, 66, 255, 0), //42FF00//Familie
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width / 2,
|
||||
height: 50,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(6.0),
|
||||
topRight: Radius.circular(6.0),
|
||||
),
|
||||
child: Hero(
|
||||
tag: Data.recipes[index].id,
|
||||
child: FadeInImage(
|
||||
image: AssetImage(
|
||||
Data.recipes[index].imageUrl),
|
||||
fit: BoxFit.cover,
|
||||
placeholder: AssetImage(
|
||||
'assets/images/loading.gif'),
|
||||
child: /* Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50, //height of button
|
||||
//width of button
|
||||
child: IconButton(
|
||||
icon: Image.asset('assets/images/filter_wann.png'),
|
||||
onPressed: () {},
|
||||
),
|
||||
), */
|
||||
GridView.builder(
|
||||
shrinkWrap: false,
|
||||
itemCount: Data.recipes.length,
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DetailsPage(
|
||||
recipe: Data.recipes[index],
|
||||
)));
|
||||
},
|
||||
child: Card(
|
||||
color: Color.fromARGB(255, 249, 171, 21),
|
||||
//color: Color.fromARGB(255, 253, 73, 73), //FD4949 //Nachtleben
|
||||
//color: Color.fromARGB(255, 80, 168, 250), //50A8FA//Kunst
|
||||
//color: Color.fromARGB(255, 80, 240, 250), //50F0FA //Sport
|
||||
//color: Color.fromARGB(255, 130, 73, 253), //8249FD //Gesundheit
|
||||
//color: Color.fromARGB(255, 253, 73, 73), //FD4949//Essen
|
||||
//color: Color.fromARGB(255, 255, 0, 199), //FF00C7//Soziales
|
||||
//color: Color.fromARGB(255, 66, 255, 0), //42FF00//Familie
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width / 2,
|
||||
height: 50,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(6.0),
|
||||
topRight: Radius.circular(6.0),
|
||||
),
|
||||
child: Hero(
|
||||
tag: Data.recipes[index].id,
|
||||
child: FadeInImage(
|
||||
image: AssetImage(
|
||||
Data.recipes[index].imageUrl),
|
||||
fit: BoxFit.cover,
|
||||
placeholder: AssetImage(
|
||||
'assets/images/loading.gif'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Data.recipes[index].title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
Data.recipes[index].title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
// ],
|
||||
// ),
|
||||
),
|
||||
|
||||
//Footer Container
|
||||
|
|
@ -212,6 +225,7 @@ class HomePage extends StatelessWidget {
|
|||
)
|
||||
],
|
||||
), */
|
||||
backgroundColor: Colors.white,
|
||||
body: body,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,5 +83,45 @@ class Data {
|
|||
'2 shots espresso (a double shot)',
|
||||
'4 ounces milk'
|
||||
]),
|
||||
Recipe(
|
||||
id: '4',
|
||||
title: 'Gesundheit & Wellness',
|
||||
imageUrl: 'assets/images/Gesundheit.png',
|
||||
nutrients: [
|
||||
Nutrients(name: 'Calories', weight: '200', percent: 0.7),
|
||||
Nutrients(name: 'Protein', weight: '10gm', percent: 0.5),
|
||||
Nutrients(name: 'Carb', weight: '50gm', percent: 0.9),
|
||||
],
|
||||
steps: [
|
||||
'Gather the ingredients.',
|
||||
'Pull a double shot of espresso into a cappuccino cup.',
|
||||
'Foam the milk to double its original volume.'
|
||||
'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.',
|
||||
'Serve immediately.'
|
||||
],
|
||||
ingredients: [
|
||||
'2 shots espresso (a double shot)',
|
||||
'4 ounces milk'
|
||||
]),
|
||||
Recipe(
|
||||
id: '4',
|
||||
title: 'Essen & Trinken',
|
||||
imageUrl: 'assets/images/Essen.png',
|
||||
nutrients: [
|
||||
Nutrients(name: 'Calories', weight: '200', percent: 0.7),
|
||||
Nutrients(name: 'Protein', weight: '10gm', percent: 0.5),
|
||||
Nutrients(name: 'Carb', weight: '50gm', percent: 0.9),
|
||||
],
|
||||
steps: [
|
||||
'Gather the ingredients.',
|
||||
'Pull a double shot of espresso into a cappuccino cup.',
|
||||
'Foam the milk to double its original volume.'
|
||||
'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.',
|
||||
'Serve immediately.'
|
||||
],
|
||||
ingredients: [
|
||||
'2 shots espresso (a double shot)',
|
||||
'4 ounces milk'
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue