mirror of
https://github.com/flutter/samples.git
synced 2025-11-12 07:48:55 +00:00
Update web/ samples to work with Flutter SDK (#134)
* add package:http dependency in dad_jokes * add package:http dependency in filipino_cuisine * don't build package:http demos until flutter/flutter#34858 is resolved * update gallery * update github_dataviz * update particle_background * don't build github_dataviz (uses package:http) * update slide_puzzle * update spinning_square * update timeflow * update vision_challenge * update charts * update dad_jokes * update filipino cuisine * ignore build output * update timeflow and vision_challenge * update slide_puzzle * don't commit build/ directory * move preview.png images to assets * fix path url join * update readme * update web/readme.md
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// Copyright 2016 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_web/material.dart';
|
||||
import 'package:flutter_web/rendering.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
class PestoDemo extends StatelessWidget {
|
||||
const PestoDemo({Key key}) : super(key: key);
|
||||
const PestoDemo({ Key key }) : super(key: key);
|
||||
|
||||
static const String routeName = '/pesto';
|
||||
|
||||
@@ -14,13 +14,14 @@ class PestoDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) => PestoHome();
|
||||
}
|
||||
|
||||
|
||||
const String _kSmallLogoImage = 'logos/pesto/logo_small.png';
|
||||
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
|
||||
const double _kAppBarHeight = 128.0;
|
||||
const double _kFabHalfSize =
|
||||
28.0; // TODO(mpcomplete): needs to adapt to screen size
|
||||
const double _kFabHalfSize = 28.0; // TODO(mpcomplete): needs to adapt to screen size
|
||||
const double _kRecipePageMaxWidth = 500.0;
|
||||
|
||||
final Set<Recipe> _favoriteRecipes = Set<Recipe>();
|
||||
final Set<Recipe> _favoriteRecipes = <Recipe>{};
|
||||
|
||||
final ThemeData _kTheme = ThemeData(
|
||||
brightness: Brightness.light,
|
||||
@@ -50,20 +51,20 @@ class PestoStyle extends TextStyle {
|
||||
double letterSpacing,
|
||||
double height,
|
||||
}) : super(
|
||||
inherit: false,
|
||||
color: color,
|
||||
fontFamily: 'Raleway',
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeight,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
letterSpacing: letterSpacing,
|
||||
height: height,
|
||||
);
|
||||
inherit: false,
|
||||
color: color,
|
||||
fontFamily: 'Raleway',
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeight,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
letterSpacing: letterSpacing,
|
||||
height: height,
|
||||
);
|
||||
}
|
||||
|
||||
// Displays a grid of recipe cards.
|
||||
class RecipeGridPage extends StatefulWidget {
|
||||
const RecipeGridPage({Key key, this.recipes}) : super(key: key);
|
||||
const RecipeGridPage({ Key key, this.recipes }) : super(key: key);
|
||||
|
||||
final List<Recipe> recipes;
|
||||
|
||||
@@ -119,10 +120,8 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
final Size size = constraints.biggest;
|
||||
final double appBarHeight = size.height - statusBarHeight;
|
||||
final double t = (appBarHeight - kToolbarHeight) /
|
||||
(_kAppBarHeight - kToolbarHeight);
|
||||
final double extraPadding =
|
||||
Tween<double>(begin: 10.0, end: 24.0).transform(t);
|
||||
final double t = (appBarHeight - kToolbarHeight) / (_kAppBarHeight - kToolbarHeight);
|
||||
final double extraPadding = Tween<double>(begin: 10.0, end: 24.0).transform(t);
|
||||
final double logoHeight = appBarHeight - 1.5 * extraPadding;
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@@ -130,7 +129,8 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
||||
bottom: extraPadding,
|
||||
),
|
||||
child: Center(
|
||||
child: PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0))),
|
||||
child: PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0)),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -140,10 +140,11 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
||||
Widget _buildBody(BuildContext context, double statusBarHeight) {
|
||||
final EdgeInsets mediaPadding = MediaQuery.of(context).padding;
|
||||
final EdgeInsets padding = EdgeInsets.only(
|
||||
top: 8.0,
|
||||
left: 8.0 + mediaPadding.left,
|
||||
right: 8.0 + mediaPadding.right,
|
||||
bottom: 8.0);
|
||||
top: 8.0,
|
||||
left: 8.0 + mediaPadding.left,
|
||||
right: 8.0 + mediaPadding.right,
|
||||
bottom: 8.0,
|
||||
);
|
||||
return SliverPadding(
|
||||
padding: padding,
|
||||
sliver: SliverGrid(
|
||||
@@ -157,9 +158,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
||||
final Recipe recipe = widget.recipes[index];
|
||||
return RecipeCard(
|
||||
recipe: recipe,
|
||||
onTap: () {
|
||||
showRecipePage(context, recipe);
|
||||
},
|
||||
onTap: () { showRecipePage(context, recipe); },
|
||||
);
|
||||
},
|
||||
childCount: widget.recipes.length,
|
||||
@@ -169,26 +168,22 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
||||
}
|
||||
|
||||
void showFavoritesPage(BuildContext context) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute<void>(
|
||||
settings: const RouteSettings(name: '/pesto/favorites'),
|
||||
builder: (BuildContext context) => PestoFavorites(),
|
||||
));
|
||||
Navigator.push(context, MaterialPageRoute<void>(
|
||||
settings: const RouteSettings(name: '/pesto/favorites'),
|
||||
builder: (BuildContext context) => PestoFavorites(),
|
||||
));
|
||||
}
|
||||
|
||||
void showRecipePage(BuildContext context, Recipe recipe) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute<void>(
|
||||
settings: const RouteSettings(name: '/pesto/recipe'),
|
||||
builder: (BuildContext context) {
|
||||
return Theme(
|
||||
data: _kTheme.copyWith(platform: Theme.of(context).platform),
|
||||
child: RecipePage(recipe: recipe),
|
||||
);
|
||||
},
|
||||
));
|
||||
Navigator.push(context, MaterialPageRoute<void>(
|
||||
settings: const RouteSettings(name: '/pesto/recipe'),
|
||||
builder: (BuildContext context) {
|
||||
return Theme(
|
||||
data: _kTheme.copyWith(platform: Theme.of(context).platform),
|
||||
child: RecipePage(recipe: recipe),
|
||||
);
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,18 +203,15 @@ class _PestoLogoState extends State<PestoLogo> {
|
||||
static const double kLogoWidth = 220.0;
|
||||
static const double kImageHeight = 108.0;
|
||||
static const double kTextHeight = 48.0;
|
||||
final TextStyle titleStyle = const PestoStyle(
|
||||
fontSize: kTextHeight,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
letterSpacing: 3.0);
|
||||
final TextStyle titleStyle = const PestoStyle(fontSize: kTextHeight, fontWeight: FontWeight.w900, color: Colors.white, letterSpacing: 3.0);
|
||||
final RectTween _textRectTween = RectTween(
|
||||
begin: Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight),
|
||||
end: Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight));
|
||||
begin: const Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight),
|
||||
end: const Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight),
|
||||
);
|
||||
final Curve _textOpacity = const Interval(0.4, 1.0, curve: Curves.easeInOut);
|
||||
final RectTween _imageRectTween = RectTween(
|
||||
begin: Rect.fromLTWH(0.0, 0.0, kLogoWidth, kLogoHeight),
|
||||
end: Rect.fromLTWH(0.0, 0.0, kLogoWidth, kImageHeight),
|
||||
begin: const Rect.fromLTWH(0.0, 0.0, kLogoWidth, kLogoHeight),
|
||||
end: const Rect.fromLTWH(0.0, 0.0, kLogoWidth, kImageHeight),
|
||||
);
|
||||
|
||||
@override
|
||||
@@ -237,7 +229,8 @@ class _PestoLogoState extends State<PestoLogo> {
|
||||
Positioned.fromRect(
|
||||
rect: _imageRectTween.lerp(widget.t),
|
||||
child: Image.asset(
|
||||
'$_kSmallLogoImage',
|
||||
_kSmallLogoImage,
|
||||
package: _kGalleryAssetsPackage,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
@@ -245,8 +238,7 @@ class _PestoLogoState extends State<PestoLogo> {
|
||||
rect: _textRectTween.lerp(widget.t),
|
||||
child: Opacity(
|
||||
opacity: _textOpacity.transform(widget.t),
|
||||
child: Text('PESTO',
|
||||
style: titleStyle, textAlign: TextAlign.center),
|
||||
child: Text('PESTO', style: titleStyle, textAlign: TextAlign.center),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -259,15 +251,13 @@ class _PestoLogoState extends State<PestoLogo> {
|
||||
|
||||
// A card with the recipe's image, author, and title.
|
||||
class RecipeCard extends StatelessWidget {
|
||||
const RecipeCard({Key key, this.recipe, this.onTap}) : super(key: key);
|
||||
const RecipeCard({ Key key, this.recipe, this.onTap }) : super(key: key);
|
||||
|
||||
final Recipe recipe;
|
||||
final VoidCallback onTap;
|
||||
|
||||
TextStyle get titleStyle =>
|
||||
const PestoStyle(fontSize: 24.0, fontWeight: FontWeight.w600);
|
||||
TextStyle get authorStyle =>
|
||||
const PestoStyle(fontWeight: FontWeight.w500, color: Colors.black54);
|
||||
TextStyle get titleStyle => const PestoStyle(fontSize: 24.0, fontWeight: FontWeight.w600);
|
||||
TextStyle get authorStyle => const PestoStyle(fontWeight: FontWeight.w500, color: Colors.black54);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -278,11 +268,11 @@ class RecipeCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Hero(
|
||||
tag: '${recipe.imagePath}',
|
||||
tag: 'packages/$_kGalleryAssetsPackage/${recipe.imagePath}',
|
||||
child: AspectRatio(
|
||||
aspectRatio: 4.0 / 3.0,
|
||||
child: Image.asset(
|
||||
'${recipe.imagePath}',
|
||||
recipe.imagePath,
|
||||
package: recipe.imagePackage,
|
||||
fit: BoxFit.cover,
|
||||
semanticLabel: recipe.name,
|
||||
@@ -295,7 +285,7 @@ class RecipeCard extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Image.asset(
|
||||
'${recipe.ingredientsImagePath}',
|
||||
recipe.ingredientsImagePath,
|
||||
package: recipe.ingredientsImagePackage,
|
||||
width: 48.0,
|
||||
height: 48.0,
|
||||
@@ -306,10 +296,7 @@ class RecipeCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(recipe.name,
|
||||
style: titleStyle,
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.ellipsis),
|
||||
Text(recipe.name, style: titleStyle, softWrap: false, overflow: TextOverflow.ellipsis),
|
||||
Text(recipe.author, style: authorStyle),
|
||||
],
|
||||
),
|
||||
@@ -326,7 +313,7 @@ class RecipeCard extends StatelessWidget {
|
||||
|
||||
// Displays one recipe. Includes the recipe sheet with a background image.
|
||||
class RecipePage extends StatefulWidget {
|
||||
const RecipePage({Key key, this.recipe}) : super(key: key);
|
||||
const RecipePage({ Key key, this.recipe }) : super(key: key);
|
||||
|
||||
final Recipe recipe;
|
||||
|
||||
@@ -336,11 +323,9 @@ class RecipePage extends StatefulWidget {
|
||||
|
||||
class _RecipePageState extends State<RecipePage> {
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
final TextStyle menuItemStyle = const PestoStyle(
|
||||
fontSize: 15.0, color: Colors.black54, height: 24.0 / 15.0);
|
||||
final TextStyle menuItemStyle = const PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
|
||||
|
||||
double _getAppBarHeight(BuildContext context) =>
|
||||
MediaQuery.of(context).size.height * 0.3;
|
||||
double _getAppBarHeight(BuildContext context) => MediaQuery.of(context).size.height * 0.3;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -361,9 +346,9 @@ class _RecipePageState extends State<RecipePage> {
|
||||
right: 0.0,
|
||||
height: appBarHeight + _kFabHalfSize,
|
||||
child: Hero(
|
||||
tag: '${widget.recipe.imagePath}',
|
||||
tag: 'packages/$_kGalleryAssetsPackage/${widget.recipe.imagePath}',
|
||||
child: Image.asset(
|
||||
'${widget.recipe.imagePath}',
|
||||
widget.recipe.imagePath,
|
||||
package: widget.recipe.imagePackage,
|
||||
fit: fullWidth ? BoxFit.fitWidth : BoxFit.cover,
|
||||
),
|
||||
@@ -376,9 +361,8 @@ class _RecipePageState extends State<RecipePage> {
|
||||
backgroundColor: Colors.transparent,
|
||||
actions: <Widget>[
|
||||
PopupMenuButton<String>(
|
||||
onSelected: (String item) {},
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuItem<String>>[
|
||||
onSelected: (String item) { },
|
||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||
_buildMenuItem(Icons.share, 'Tweet recipe'),
|
||||
_buildMenuItem(Icons.email, 'Email recipe'),
|
||||
_buildMenuItem(Icons.message, 'Message recipe'),
|
||||
@@ -399,23 +383,23 @@ class _RecipePageState extends State<RecipePage> {
|
||||
),
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: _kFabHalfSize),
|
||||
width: fullWidth ? null : _kRecipePageMaxWidth,
|
||||
child: RecipeSheet(recipe: widget.recipe),
|
||||
),
|
||||
Positioned(
|
||||
right: 16.0,
|
||||
child: FloatingActionButton(
|
||||
child: Icon(
|
||||
isFavorite ? Icons.favorite : Icons.favorite_border),
|
||||
onPressed: _toggleFavorite,
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: _kFabHalfSize),
|
||||
width: fullWidth ? null : _kRecipePageMaxWidth,
|
||||
child: RecipeSheet(recipe: widget.recipe),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
Positioned(
|
||||
right: 16.0,
|
||||
child: FloatingActionButton(
|
||||
child: Icon(isFavorite ? Icons.favorite : Icons.favorite_border),
|
||||
onPressed: _toggleFavorite,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -428,8 +412,9 @@ class _RecipePageState extends State<RecipePage> {
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 24.0),
|
||||
child: Icon(icon, color: Colors.black54)),
|
||||
padding: const EdgeInsets.only(right: 24.0),
|
||||
child: Icon(icon, color: Colors.black54),
|
||||
),
|
||||
Text(label, style: menuItemStyle),
|
||||
],
|
||||
),
|
||||
@@ -448,17 +433,13 @@ class _RecipePageState extends State<RecipePage> {
|
||||
|
||||
/// Displays the recipe's name and instructions.
|
||||
class RecipeSheet extends StatelessWidget {
|
||||
RecipeSheet({Key key, this.recipe}) : super(key: key);
|
||||
RecipeSheet({ Key key, this.recipe }) : super(key: key);
|
||||
|
||||
final TextStyle titleStyle = const PestoStyle(fontSize: 34.0);
|
||||
final TextStyle descriptionStyle = const PestoStyle(
|
||||
fontSize: 15.0, color: Colors.black54, height: 24.0 / 15.0);
|
||||
final TextStyle itemStyle =
|
||||
const PestoStyle(fontSize: 15.0, height: 24.0 / 15.0);
|
||||
final TextStyle itemAmountStyle = PestoStyle(
|
||||
fontSize: 15.0, color: _kTheme.primaryColor, height: 24.0 / 15.0);
|
||||
final TextStyle headingStyle = const PestoStyle(
|
||||
fontSize: 16.0, fontWeight: FontWeight.bold, height: 24.0 / 15.0);
|
||||
final TextStyle descriptionStyle = const PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
|
||||
final TextStyle itemStyle = const PestoStyle(fontSize: 15.0, height: 24.0/15.0);
|
||||
final TextStyle itemAmountStyle = PestoStyle(fontSize: 15.0, color: _kTheme.primaryColor, height: 24.0/15.0);
|
||||
final TextStyle headingStyle = const PestoStyle(fontSize: 16.0, fontWeight: FontWeight.bold, height: 24.0/15.0);
|
||||
|
||||
final Recipe recipe;
|
||||
|
||||
@@ -472,48 +453,62 @@ class RecipeSheet extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
|
||||
child: Table(
|
||||
columnWidths: const <int, TableColumnWidth>{
|
||||
0: FixedColumnWidth(64.0)
|
||||
0: FixedColumnWidth(64.0),
|
||||
},
|
||||
children: <TableRow>[
|
||||
TableRow(children: <Widget>[
|
||||
TableCell(
|
||||
TableRow(
|
||||
children: <Widget>[
|
||||
TableCell(
|
||||
verticalAlignment: TableCellVerticalAlignment.middle,
|
||||
child: Image.asset('${recipe.ingredientsImagePath}',
|
||||
package: recipe.ingredientsImagePackage,
|
||||
width: 32.0,
|
||||
height: 32.0,
|
||||
alignment: Alignment.centerLeft,
|
||||
fit: BoxFit.scaleDown)),
|
||||
TableCell(
|
||||
child: Image.asset(
|
||||
recipe.ingredientsImagePath,
|
||||
package: recipe.ingredientsImagePackage,
|
||||
width: 32.0,
|
||||
height: 32.0,
|
||||
alignment: Alignment.centerLeft,
|
||||
fit: BoxFit.scaleDown,
|
||||
),
|
||||
),
|
||||
TableCell(
|
||||
verticalAlignment: TableCellVerticalAlignment.middle,
|
||||
child: Text(recipe.name, style: titleStyle)),
|
||||
]),
|
||||
TableRow(children: <Widget>[
|
||||
const SizedBox(),
|
||||
Padding(
|
||||
child: Text(recipe.name, style: titleStyle),
|
||||
),
|
||||
]
|
||||
),
|
||||
TableRow(
|
||||
children: <Widget>[
|
||||
const SizedBox(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
||||
child: Text(recipe.description, style: descriptionStyle)),
|
||||
]),
|
||||
TableRow(children: <Widget>[
|
||||
const SizedBox(),
|
||||
Padding(
|
||||
child: Text(recipe.description, style: descriptionStyle),
|
||||
),
|
||||
]
|
||||
),
|
||||
TableRow(
|
||||
children: <Widget>[
|
||||
const SizedBox(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
|
||||
child: Text('Ingredients', style: headingStyle)),
|
||||
]),
|
||||
]
|
||||
..addAll(recipe.ingredients
|
||||
.map<TableRow>((RecipeIngredient ingredient) {
|
||||
child: Text('Ingredients', style: headingStyle),
|
||||
),
|
||||
]
|
||||
),
|
||||
...recipe.ingredients.map<TableRow>((RecipeIngredient ingredient) {
|
||||
return _buildItemRow(ingredient.amount, ingredient.description);
|
||||
}))
|
||||
..add(TableRow(children: <Widget>[
|
||||
const SizedBox(),
|
||||
Padding(
|
||||
}),
|
||||
TableRow(
|
||||
children: <Widget>[
|
||||
const SizedBox(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
|
||||
child: Text('Steps', style: headingStyle)),
|
||||
]))
|
||||
..addAll(recipe.steps.map<TableRow>((RecipeStep step) {
|
||||
child: Text('Steps', style: headingStyle),
|
||||
),
|
||||
]
|
||||
),
|
||||
...recipe.steps.map<TableRow>((RecipeStep step) {
|
||||
return _buildItemRow(step.duration ?? '', step.description);
|
||||
})),
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -537,16 +532,17 @@ class RecipeSheet extends StatelessWidget {
|
||||
}
|
||||
|
||||
class Recipe {
|
||||
const Recipe(
|
||||
{this.name,
|
||||
this.author,
|
||||
this.description,
|
||||
this.imagePath,
|
||||
this.imagePackage,
|
||||
this.ingredientsImagePath,
|
||||
this.ingredientsImagePackage,
|
||||
this.ingredients,
|
||||
this.steps});
|
||||
const Recipe({
|
||||
this.name,
|
||||
this.author,
|
||||
this.description,
|
||||
this.imagePath,
|
||||
this.imagePackage,
|
||||
this.ingredientsImagePath,
|
||||
this.ingredientsImagePackage,
|
||||
this.ingredients,
|
||||
this.steps,
|
||||
});
|
||||
|
||||
final String name;
|
||||
final String author;
|
||||
@@ -578,9 +574,10 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
name: 'Roasted Chicken',
|
||||
author: 'Peter Carlsson',
|
||||
ingredientsImagePath: 'food/icons/main.png',
|
||||
description:
|
||||
'The perfect dish to welcome your family and friends with on a crisp autumn night. Pair with roasted veggies to truly impress them.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'The perfect dish to welcome your family and friends with on a crisp autumn night. Pair with roasted veggies to truly impress them.',
|
||||
imagePath: 'food/roasted_chicken.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '1 whole', description: 'Chicken'),
|
||||
RecipeIngredient(amount: '1/2 cup', description: 'Butter'),
|
||||
@@ -597,11 +594,12 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
name: 'Chopped Beet Leaves',
|
||||
author: 'Trevor Hansen',
|
||||
ingredientsImagePath: 'food/icons/veggie.png',
|
||||
description:
|
||||
'This vegetable has more to offer than just its root. Beet greens can be tossed into a salad to add some variety or sauteed on its own with some oil and garlic.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'This vegetable has more to offer than just its root. Beet greens can be tossed into a salad to add some variety or sauteed on its own with some oil and garlic.',
|
||||
imagePath: 'food/chopped_beet_leaves.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '3 cups', description: 'Beet greens'),
|
||||
RecipeIngredient(amount: '3 cups', description: 'Beet greens'),
|
||||
],
|
||||
steps: <RecipeStep>[
|
||||
RecipeStep(duration: '5 min', description: 'Chop'),
|
||||
@@ -611,15 +609,15 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
name: 'Pesto Pasta',
|
||||
author: 'Ali Connors',
|
||||
ingredientsImagePath: 'food/icons/main.png',
|
||||
description:
|
||||
'With this pesto recipe, you can quickly whip up a meal to satisfy your savory needs. And if you\'re feeling festive, you can add bacon to taste.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'With this pesto recipe, you can quickly whip up a meal to satisfy your savory needs. And if you\'re feeling festive, you can add bacon to taste.',
|
||||
imagePath: 'food/pesto_pasta.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '1/4 cup ', description: 'Pasta'),
|
||||
RecipeIngredient(amount: '2 cups', description: 'Fresh basil leaves'),
|
||||
RecipeIngredient(amount: '1/2 cup', description: 'Parmesan cheese'),
|
||||
RecipeIngredient(
|
||||
amount: '1/2 cup', description: 'Extra virgin olive oil'),
|
||||
RecipeIngredient(amount: '1/2 cup', description: 'Extra virgin olive oil'),
|
||||
RecipeIngredient(amount: '1/3 cup', description: 'Pine nuts'),
|
||||
RecipeIngredient(amount: '1/4 cup', description: 'Lemon juice'),
|
||||
RecipeIngredient(amount: '3 cloves', description: 'Garlic'),
|
||||
@@ -635,13 +633,13 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
name: 'Cherry Pie',
|
||||
author: 'Sandra Adams',
|
||||
ingredientsImagePath: 'food/icons/main.png',
|
||||
description:
|
||||
'Sometimes when you\'re craving some cheer in your life you can jumpstart your day with some cherry pie. Dessert for breakfast is perfectly acceptable.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'Sometimes when you\'re craving some cheer in your life you can jumpstart your day with some cherry pie. Dessert for breakfast is perfectly acceptable.',
|
||||
imagePath: 'food/cherry_pie.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '1', description: 'Pie crust'),
|
||||
RecipeIngredient(
|
||||
amount: '4 cups', description: 'Fresh or frozen cherries'),
|
||||
RecipeIngredient(amount: '4 cups', description: 'Fresh or frozen cherries'),
|
||||
RecipeIngredient(amount: '1 cup', description: 'Granulated sugar'),
|
||||
RecipeIngredient(amount: '4 tbsp', description: 'Cornstarch'),
|
||||
RecipeIngredient(amount: '1½ tbsp', description: 'Butter'),
|
||||
@@ -655,9 +653,10 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
name: 'Spinach Salad',
|
||||
author: 'Peter Carlsson',
|
||||
ingredientsImagePath: 'food/icons/spicy.png',
|
||||
description:
|
||||
'Everyone\'s favorite leafy green is back. Paired with fresh sliced onion, it\'s ready to tackle any dish, whether it be a salad or an egg scramble.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'Everyone\'s favorite leafy green is back. Paired with fresh sliced onion, it\'s ready to tackle any dish, whether it be a salad or an egg scramble.',
|
||||
imagePath: 'food/spinach_onion_salad.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '4 cups', description: 'Spinach'),
|
||||
RecipeIngredient(amount: '1 cup', description: 'Sliced onion'),
|
||||
@@ -670,9 +669,10 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
name: 'Butternut Squash Soup',
|
||||
author: 'Ali Connors',
|
||||
ingredientsImagePath: 'food/icons/healthy.png',
|
||||
description:
|
||||
'This creamy butternut squash soup will warm you on the chilliest of winter nights and bring a delightful pop of orange to the dinner table.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'This creamy butternut squash soup will warm you on the chilliest of winter nights and bring a delightful pop of orange to the dinner table.',
|
||||
imagePath: 'food/butternut_squash_soup.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '1', description: 'Butternut squash'),
|
||||
RecipeIngredient(amount: '4 cups', description: 'Chicken stock'),
|
||||
@@ -686,16 +686,17 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
steps: <RecipeStep>[
|
||||
RecipeStep(duration: '10 min', description: 'Prep vegetables'),
|
||||
RecipeStep(duration: '5 min', description: 'Stir'),
|
||||
RecipeStep(duration: '1 hr 10 min', description: 'Cook')
|
||||
RecipeStep(duration: '1 hr 10 min', description: 'Cook'),
|
||||
],
|
||||
),
|
||||
Recipe(
|
||||
name: 'Spanakopita',
|
||||
author: 'Trevor Hansen',
|
||||
ingredientsImagePath: 'food/icons/quick.png',
|
||||
description:
|
||||
'You \'feta\' believe this is a crowd-pleaser! Flaky phyllo pastry surrounds a delicious mixture of spinach and cheeses to create the perfect appetizer.',
|
||||
ingredientsImagePackage: _kGalleryAssetsPackage,
|
||||
description: 'You \'feta\' believe this is a crowd-pleaser! Flaky phyllo pastry surrounds a delicious mixture of spinach and cheeses to create the perfect appetizer.',
|
||||
imagePath: 'food/spanakopita.png',
|
||||
imagePackage: _kGalleryAssetsPackage,
|
||||
ingredients: <RecipeIngredient>[
|
||||
RecipeIngredient(amount: '1 lb', description: 'Spinach'),
|
||||
RecipeIngredient(amount: '½ cup', description: 'Feta cheese'),
|
||||
@@ -706,13 +707,9 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
||||
],
|
||||
steps: <RecipeStep>[
|
||||
RecipeStep(duration: '5 min', description: 'Sauté vegetables'),
|
||||
RecipeStep(
|
||||
duration: '3 min',
|
||||
description: 'Stir vegetables and other filling ingredients'),
|
||||
RecipeStep(
|
||||
duration: '10 min',
|
||||
description: 'Fill phyllo squares half-full with filling and fold.'),
|
||||
RecipeStep(duration: '40 min', description: 'Bake')
|
||||
RecipeStep(duration: '3 min', description: 'Stir vegetables and other filling ingredients'),
|
||||
RecipeStep(duration: '10 min', description: 'Fill phyllo squares half-full with filling and fold.'),
|
||||
RecipeStep(duration: '40 min', description: 'Bake'),
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user