pesto_demo.dart 32 KB
Newer Older
1 2 3 4
// 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.

5 6
import 'dart:math';

7 8
import 'package:flutter/material.dart';

9 10 11 12 13 14 15 16 17
class PestoDemo extends StatelessWidget {
  PestoDemo({ Key key }) : super(key: key);

  static const String routeName = '/pesto';

  @override
  Widget build(BuildContext context) => new PestoHome();
}

18
const String _kUserName = 'Jonathan';
19
const String _kUserEmail = 'jonathan@example.com';
20
const String _kUserImage = 'packages/flutter_gallery_assets/pesto/avatar.jpg';
21 22
const String _kSmallLogoImage = 'packages/flutter_gallery_assets/pesto/logo_small.png';
const String _kMediumLogoImage = 'packages/flutter_gallery_assets/pesto/logo_medium.png';
23 24 25 26
const double _kAppBarHeight = 128.0;
const double _kRecipePageMaxWidth = 500.0;

final Set<Recipe> _favoriteRecipes = new Set<Recipe>();
27

28
final ThemeData _kTheme = new ThemeData(
29
  brightness: Brightness.light,
30 31 32 33
  primarySwatch: Colors.teal,
  accentColor: Colors.redAccent[200]
);

34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
class PestoHome extends StatelessWidget {
  static final GlobalKey<ScrollableState> scrollableKey = new GlobalKey<ScrollableState>();

  @override
  Widget build(BuildContext context) {
    return new RecipeGridPage(recipes: kPestoRecipes, scrollableKey: scrollableKey);
  }
}

class PestoFavorites extends StatelessWidget {
  static final GlobalKey<ScrollableState> scrollableKey = new GlobalKey<ScrollableState>();

  @override
  Widget build(BuildContext context) {
    return new RecipeGridPage(recipes: _favoriteRecipes.toList(), scrollableKey: scrollableKey);
  }
}
51

52 53 54 55 56 57 58
class PestoStyle extends TextStyle {
  const PestoStyle({
    double fontSize: 12.0,
    FontWeight fontWeight,
    Color color: Colors.black87,
    double height
  }) : super(
59
    inherit: false,
60
    color: color,
61
    fontFamily: 'Raleway',
62 63 64 65
    fontSize: fontSize,
    fontWeight: fontWeight,
    textBaseline: TextBaseline.alphabetic,
    height: height
66 67 68
  );
}

69 70 71
// Displays a grid of recipe cards.
class RecipeGridPage extends StatefulWidget {
  RecipeGridPage({ Key key, this.recipes, this.scrollableKey }) : super(key: key);
72

73 74
  final List<Recipe> recipes;
  final GlobalKey<ScrollableState> scrollableKey;
75 76

  @override
77
  _RecipeGridPageState createState() => new _RecipeGridPageState();
78 79
}

80 81 82 83 84 85 86
class _RecipeGridPageState extends State<RecipeGridPage> {
  final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
  final TextStyle favoritesMessageStyle = const PestoStyle(fontSize: 16.0);
  final TextStyle userStyle = const PestoStyle(fontWeight: FontWeight.bold);
  final TextStyle emailStyle = const PestoStyle(color: Colors.black54);

  bool showFavorites = false;
87 88 89

  @override
  Widget build(BuildContext context) {
90
    final double statusBarHeight = MediaQuery.of(context).padding.top;
91 92 93
    return new Theme(
      data: _kTheme,
      child: new Scaffold(
94 95
        key: scaffoldKey,
        scrollableKey: config.scrollableKey,
96
        appBarBehavior: AppBarBehavior.under,
97 98
        appBar: buildAppBar(context, statusBarHeight),
        drawer: buildDrawer(context),
99
        floatingActionButton: new FloatingActionButton(
Ian Hickson's avatar
Ian Hickson committed
100
          child: new Icon(Icons.edit),
101 102 103 104 105
          onPressed: () {
            scaffoldKey.currentState.showSnackBar(new SnackBar(
              content: new Text('Not supported.')
            ));
          }
106
        ),
107
        body: buildBody(context, statusBarHeight)
108 109 110 111
      )
    );
  }

112
  Widget buildAppBar(BuildContext context, double statusBarHeight) {
113
    return new AppBar(
114
      expandedHeight: _kAppBarHeight,
115 116
      actions: <Widget>[
        new IconButton(
Ian Hickson's avatar
Ian Hickson committed
117
          icon: new Icon(Icons.search),
118 119
          tooltip: 'Search',
          onPressed: () {
120
            scaffoldKey.currentState.showSnackBar(new SnackBar(
121 122 123 124 125 126
              content: new Text('Not supported.')
            ));
          }
        )
      ],
      flexibleSpace: new LayoutBuilder(
127 128
        builder: (BuildContext context, BoxConstraints constraints) {
          final Size size = constraints.biggest;
129 130
          final double appBarHeight = size.height - statusBarHeight;
          final String logo = appBarHeight >= 70.0 ? _kMediumLogoImage : _kSmallLogoImage;
131 132
          // Extra padding. Calculated to give about 16px on the bottom for the
          // `small` logo at its native size, and 30px for the `medium`.
133
          final double extraPadding = min(0.19 * appBarHeight + 5.4, 40.0);
134
          return new Padding(
135 136 137 138
            padding: new EdgeInsets.only(
              top: statusBarHeight + 0.5 * extraPadding,
              bottom: extraPadding
            ),
139
            child: new Center(
140
              child: new Image.asset(logo, fit: ImageFit.scaleDown)
141 142 143 144 145 146 147
            )
          );
        }
      )
    );
  }

148
  Widget buildDrawer(BuildContext context) {
149 150 151 152
    return new Drawer(
      child: new Block(
        children: <Widget>[
          new DrawerHeader(
153 154
            child: new Column(
              mainAxisAlignment: MainAxisAlignment.center,
155 156 157 158 159 160 161 162 163
              children: <Widget>[
                new Container(
                  decoration: new BoxDecoration(
                    border: new Border.all(color: _kTheme.primaryColor, width: 2.0),
                    shape: BoxShape.circle
                  ),
                  width: 72.0,
                  height: 72.0,
                  padding: const EdgeInsets.all(2.0),
164
                  margin: const EdgeInsets.only(bottom: 16.0),
165
                  child: new ClipOval(
166
                    child: new Image.asset(_kUserImage, fit: ImageFit.contain)
167 168 169 170 171 172 173 174 175
                  )
                ),
                new Text(_kUserName, style: userStyle),
                new Text(_kUserEmail, style: emailStyle)
              ]
            )
          ),
          new DrawerItem(
            child: new Text('Home'),
176
            icon: new Icon(Icons.home),
177
            selected: !showFavorites,
Hans Muller's avatar
Hans Muller committed
178 179 180
            onPressed: () {
              Navigator.popUntil(context, ModalRoute.withName('/pesto'));
            }
181 182 183
          ),
          new DrawerItem(
            child: new Text('Favorites'),
184
            icon: new Icon(Icons.favorite),
185
            selected: showFavorites,
Hans Muller's avatar
Hans Muller committed
186
            onPressed: () {
187
              if (showFavorites)
Hans Muller's avatar
Hans Muller committed
188 189
                Navigator.pop(context);
              else
190
                showFavoritesPage(context);
Hans Muller's avatar
Hans Muller committed
191
            }
192 193 194 195
          ),
          new Divider(),
          new DrawerItem(
            child: new Text('Return to Gallery'),
196
            icon: new Icon(Icons.arrow_back),
197
            onPressed: () {
Hans Muller's avatar
Hans Muller committed
198
              Navigator.popUntil(context, ModalRoute.withName('/'));
199 200
            }
          ),
201 202 203 204 205
        ]
      )
    );
  }

206
  Widget buildBody(BuildContext context, double statusBarHeight) {
207 208
    final EdgeInsets padding = new EdgeInsets.fromLTRB(8.0, 8.0 + _kAppBarHeight + statusBarHeight, 8.0, 8.0);

209
    if (config.recipes.isEmpty) {
210 211 212 213 214 215 216
      return new Padding(
        padding: padding,
        child: new Text('Save your favorite recipes to see them here.', style: favoritesMessageStyle)
      );
    }

    return new ScrollableGrid(
217
      scrollableKey: config.scrollableKey,
218
      delegate: new MaxTileWidthGridDelegate(
219
        maxTileWidth: _kRecipePageMaxWidth,
220 221 222 223
        rowSpacing: 8.0,
        columnSpacing: 8.0,
        padding: padding
      ),
224 225
      children: config.recipes.map((Recipe recipe) {
        return new RecipeCard(
226
          recipe: recipe,
227 228 229
          onTap: () { showRecipePage(context, recipe); }
        );
      })
230 231 232
    );
  }

233
  void showFavoritesPage(BuildContext context) {
234
    Navigator.push(context, new MaterialPageRoute<Null>(
Hans Muller's avatar
Hans Muller committed
235
      settings: const RouteSettings(name: "/pesto/favorites"),
236
      builder: (BuildContext context) => new PestoFavorites()
237 238 239
    ));
  }

240
  void showRecipePage(BuildContext context, Recipe recipe) {
241
    Navigator.push(context, new MaterialPageRoute<Null>(
Hans Muller's avatar
Hans Muller committed
242
      settings: const RouteSettings(name: "/pesto/recipe"),
243 244 245
      builder: (BuildContext context) {
        return new Theme(
          data: _kTheme,
246
          child: new RecipePage(recipe: recipe)
247 248 249 250 251 252
        );
      }
    ));
  }
}

253 254 255 256
// A card with the recipe's image, author, and title.
class RecipeCard extends StatelessWidget {
  final TextStyle titleStyle = const PestoStyle(fontSize: 24.0, fontWeight: FontWeight.w600);
  final TextStyle authorStyle = const PestoStyle(fontWeight: FontWeight.w500, color: Colors.black54);
257

258
  RecipeCard({ Key key, this.recipe, this.onTap }) : super(key: key);
259 260 261 262 263 264

  final Recipe recipe;
  final VoidCallback onTap;

  @override
  Widget build(BuildContext context) {
265 266
    return new GestureDetector(
      onTap: onTap,
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
      child: new Card(
        child: new Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            new Hero(
              tag: recipe.imagePath,
              child: new Image.asset(recipe.imagePath, fit: ImageFit.contain)
            ),
            new Flexible(
              child: new Row(
                children: <Widget>[
                  new Padding(
                    padding: const EdgeInsets.all(16.0),
                    child: new Image.asset(
                      recipe.ingredientsImagePath,
                      width: 48.0,
                      height: 48.0
284
                    )
285
                  ),
286 287 288 289 290 291 292 293 294
                  new Flexible(
                    child: new Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: <Widget>[
                        new Text(recipe.name, style: titleStyle, softWrap: false, overflow: TextOverflow.ellipsis),
                        new Text(recipe.author, style: authorStyle),
                      ]
                    )
295 296
                  )
                ]
297
              )
298 299
            )
          ]
300 301 302 303 304 305
        )
      )
    );
  }
}

306 307 308
// Displays one recipe. Includes the recipe sheet with a background image.
class RecipePage extends StatefulWidget {
  RecipePage({ Key key, this.recipe }) : super(key: key);
309 310 311 312 313 314 315

  final Recipe recipe;

  @override
  _RecipePageState createState() => new _RecipePageState();
}

316
class _RecipePageState extends State<RecipePage> {
317 318
  final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
  final GlobalKey<ScrollableState> _scrollableKey = new GlobalKey<ScrollableState>();
319
  final TextStyle menuItemStyle = new PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
320

321 322
  double _getAppBarHeight(BuildContext context) => MediaQuery.of(context).size.height * 0.3;

323 324
  @override
  Widget build(BuildContext context) {
325 326
    return new Scaffold(
      key: _scaffoldKey,
327
      scrollableKey: _scrollableKey,
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
      appBarBehavior: AppBarBehavior.scroll,
      appBar: new AppBar(
        expandedHeight: _getAppBarHeight(context),
        backgroundColor: Colors.transparent,
        elevation: 0,
        leading: new IconButton(
          icon: new Icon(Icons.arrow_back),
          onPressed: () => Navigator.pop(context),
          tooltip: 'Back'
        ),
        actions: <Widget>[
          new PopupMenuButton<String>(
            onSelected: (String item) {},
            itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
              _buildMenuItem(Icons.share, 'Tweet recipe'),
              _buildMenuItem(Icons.email, 'Email recipe'),
              _buildMenuItem(Icons.message, 'Message recipe'),
              _buildMenuItem(Icons.people, 'Share on Facebook'),
            ]
347
          )
348 349 350 351 352 353
        ],
        // This empty space keeps the app bar from moving until the screen is
        // scrolled at least _getAppBarHeight().
        flexibleSpace: new Container()
      ),
      body: _buildContainer(context)
354 355 356 357 358 359 360
    );
  }

  // The full page content with the recipe's image behind it. This
  // adjusts based on the size of the screen. If the recipe sheet touches
  // the edge of the screen, use a slightly different layout.
  Widget _buildContainer(BuildContext context) {
361
    final bool isFavorite = _favoriteRecipes.contains(config.recipe);
362 363 364
    final Size screenSize = MediaQuery.of(context).size;
    final bool fullWidth = (screenSize.width < _kRecipePageMaxWidth);
    final double appBarHeight = _getAppBarHeight(context);
365
    const double fabHalfSize = 28.0;  // TODO(mpcomplete): needs to adapt to screen size
366 367 368 369 370 371
    return new Stack(
      children: <Widget>[
        new Positioned(
          top: 0.0,
          left: 0.0,
          right: 0.0,
372
          height: appBarHeight + fabHalfSize,
373 374 375 376 377 378
          child: new Hero(
            tag: config.recipe.imagePath,
            child: new Image.asset(
              config.recipe.imagePath,
              fit: fullWidth ? ImageFit.fitWidth : ImageFit.cover
            )
379 380
          )
        ),
381 382 383
        new ClampOverscrolls(
          value: true,
          child: new ScrollableViewport(
384
            scrollableKey: _scrollableKey,
385 386 387 388 389 390 391 392 393
            child: new RepaintBoundary(
              child: new Padding(
                padding: new EdgeInsets.only(top: appBarHeight),
                child: new Stack(
                  children: <Widget>[
                    new Padding(
                      padding: new EdgeInsets.only(top: fabHalfSize),
                      child: new SizedBox(
                        width: fullWidth ? null : _kRecipePageMaxWidth,
394
                        child: new RecipeSheet(recipe: config.recipe)
395 396 397 398 399 400 401 402
                      )
                    ),
                    new Positioned(
                      right: 16.0,
                      child: new FloatingActionButton(
                        child: new Icon(isFavorite ? Icons.favorite : Icons.favorite_border),
                        onPressed: _toggleFavorite
                      )
403
                    )
404 405
                  ]
                )
406
              )
407
            )
408
          )
409
        )
410
      ]
411 412 413 414 415 416 417 418 419
    );
  }

  PopupMenuItem<String> _buildMenuItem(IconData icon, String label) {
    return new PopupMenuItem<String>(
      child: new Row(
        children: <Widget>[
          new Padding(
            padding: const EdgeInsets.only(right: 24.0),
Ian Hickson's avatar
Ian Hickson committed
420
            child: new Icon(icon, color: Colors.black54)
421 422 423 424 425 426 427 428 429
          ),
          new Text(label, style: menuItemStyle)
        ]
      )
    );
  }

  void _toggleFavorite() {
    setState(() {
430 431
      if (_favoriteRecipes.contains(config.recipe))
        _favoriteRecipes.remove(config.recipe);
432
      else
433
        _favoriteRecipes.add(config.recipe);
434 435 436 437
    });
  }
}

438 439 440 441 442 443 444
/// Displays the recipe's name and instructions.
class RecipeSheet extends StatelessWidget {
  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 = new 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);
445

446
  RecipeSheet({ Key key, this.recipe }) : super(key: key);
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463

  final Recipe recipe;

  @override
  Widget build(BuildContext context) {
    return new Material(
      child: new Padding(
        padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
        child: new Table(
          columnWidths: <int, TableColumnWidth>{
            0: const FixedColumnWidth(64.0)
          },
          children: <TableRow>[
            new TableRow(
              children: <Widget>[
                new TableCell(
                  verticalAlignment: TableCellVerticalAlignment.middle,
464 465
                  child: new Image.asset(
                    recipe.ingredientsImagePath,
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
                    width: 32.0,
                    height: 32.0,
                    alignment: FractionalOffset.centerLeft,
                    fit: ImageFit.scaleDown
                  )
                ),
                new TableCell(
                  verticalAlignment: TableCellVerticalAlignment.middle,
                  child: new Text(recipe.name, style: titleStyle)
                ),
              ]
            ),
            new TableRow(
              children: <Widget>[
                new SizedBox(),
                new Padding(
                  padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
                  child: new Text(recipe.description, style: descriptionStyle)
                ),
              ]
            ),
            new TableRow(
              children: <Widget>[
                new SizedBox(),
                new Padding(
                  padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
                  child: new Text('Ingredients', style: headingStyle)
                ),
              ]
            ),
          ]..addAll(recipe.ingredients.map(
            (RecipeIngredient ingredient) {
              return _buildItemRow(ingredient.amount, ingredient.description);
            }
          ))..add(
            new TableRow(
              children: <Widget>[
                new SizedBox(),
                new Padding(
                  padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
                  child: new Text('Steps', style: headingStyle)
                ),
              ]
            )
          )..addAll(recipe.steps.map(
            (RecipeStep step) {
              return _buildItemRow(step.duration ?? '', step.description);
            }
          ))
        )
      )
    );
  }

  TableRow _buildItemRow(String left, String right) {
    return new TableRow(
      children: <Widget>[
        new Padding(
          padding: const EdgeInsets.symmetric(vertical: 4.0),
          child: new Text(left, style: itemAmountStyle)
        ),
        new Padding(
          padding: const EdgeInsets.symmetric(vertical: 4.0),
          child: new Text(right, style: itemStyle)
        )
      ]
    );
  }
}

class Recipe {
  const Recipe({
    this.name,
    this.author,
    this.description,
    this.imagePath,
    this.ingredientsImagePath,
    this.ingredients,
    this.steps
  });

  final String name;
  final String author;
  final String description;
  final String imagePath;
  final String ingredientsImagePath;
  final List<RecipeIngredient> ingredients;
  final List<RecipeStep> steps;
}

class RecipeIngredient {
  const RecipeIngredient({this.amount, this.description});

  final String amount;
  final String description;
}

class RecipeStep {
  const RecipeStep({this.duration, this.description});

  final String duration;
  final String description;
}

570
final List<Recipe> kPestoRecipes = <Recipe>[
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808
  const Recipe(
    name: 'Pesto Bruchetta',
    author: 'Peter Carlsson',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/quick.png',
    description: 'Bask in greens this season by trying this delightful take on traditional bruschetta. Top with a dollop of homemade pesto, and season with freshly ground sea salt and pepper.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image1.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '6 pieces', description: 'Mozzarella cheese'),
      const RecipeIngredient(amount: '6 pieces', description: 'Toasts'),
      const RecipeIngredient(amount: '⅔ cup', description: 'Homemade pesto'),
      const RecipeIngredient(amount: '1tbsp', description: 'Freshly ground pepper'),
      const RecipeIngredient(amount: '1 tsp', description: 'Salt'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(description: 'Put in oven'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Rustic purple mash',
    author: 'Trevor Hansen',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/veggie.png',
    description: 'Abundant in color, and healthy, delicious goodness, cooking with these South American purple potatoes is a treat. Boil, mash, bake, or roast them. For taste cook with chicken stock, and a dash of extra virgin olive oil.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image2.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '2 lbs', description: 'Purple potatoes, skin on'),
      const RecipeIngredient(amount: '1 tsp', description: 'Salt'),
      const RecipeIngredient(amount: '2 tsp', description: 'Lemon'),
      const RecipeIngredient(amount: '4 cups', description: 'Chicken stock'),
      const RecipeIngredient(amount: '1tbsp', description: 'Extra virgin olive oil')
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Bacon Sprouts',
    author: 'Ali Connors',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/main.png',
    description: 'This beautiful sprouts recipe is the most glorious side dish on a cold winter’s night. Construct it with bacon or fake-on, but always make sure the sprouts are deliciously seasoned and appropriately sautéed.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image3.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '2 lbs', description: 'Brussel sprouts'),
      const RecipeIngredient(amount: '3 lbs', description: 'Bacon'),
      const RecipeIngredient(amount: '⅔ cup', description: 'Shaved parmesan cheese'),
      const RecipeIngredient(amount: '1tbsp', description: 'Extra virgin olive oil'),
      const RecipeIngredient(amount: '1 tsp', description: 'Lemon juice'),
      const RecipeIngredient(amount: '1/2 cup', description: 'Sun dried tomatoes'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Oven Sausage',
    author: 'Sandra Adams',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/meat.png',
    description: 'Robust cuts of portuguese sausage add layers of flavour. Bake or fry until sausages are slightly browned and with a crispy skin. Serve warm and with cuts of pineapple for a delightful mix of sweet and savory flavour. This is the perfect dish after a swim in the sea.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image4.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1 1/2 lbs', description: 'Linguisa'),
      const RecipeIngredient(amount: '1 lbs', description: 'Pineapple or other fresh citrus fruit'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Chicken tostadas',
    author: 'Peter Carlsson',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/spicy.png',
    description: 'Crisp flavours and a bit of spice make this roasted chicken dish an easy go to when cooking for large groups. Top with Baja sauce for an extra kick of spice.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image5.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '4-6', description: 'Small corn tortillas'),
      const RecipeIngredient(amount: '½ cup', description: 'Chopped onion'),
      const RecipeIngredient(amount: '⅔', description: 'Cream'),
      const RecipeIngredient(amount: '3-4oz', description: 'Roasted, shredded chicken breast'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Coconut rice',
    author: 'Ali Connors',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/healthy.png',
    description: 'This dish is a terrific pairing to almost any main. Bonus- it’s quick, easy to make, and turns even the simplest of dishes into a delicacy. Sweet coconut cream will leave your mouth watering, with yummy caramelized  flecks of rice adding an extra bit of taste. Fluff with fork before serving for best results.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image6.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '2 cups', description: 'Jasmine rice'),
      const RecipeIngredient(amount: '1 1/2 cups', description: 'Water'),
      const RecipeIngredient(amount: '1 cup', description: 'Coconut milk'),
      const RecipeIngredient(amount: '1 1/2 tbsp', description: 'Sugar'),
      const RecipeIngredient(amount: '1tsp', description: 'Salt'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Gin basil cocktail',
    author: 'Trevor Hansen',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/quick.png',
    description: 'This mellow and herb filled blending of simple ingredients is easy enough to mix that a novice host will feel like a seasoned bartender. Top with crushed basil, shake or stir.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image7.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '3 parts', description: 'Gin'),
      const RecipeIngredient(amount: '1 part', description: 'Fresh lemon juice'),
      const RecipeIngredient(amount: '½ part', description: 'Simple syrup'),
      const RecipeIngredient(amount: '5', description: 'Basil leaves, crushed'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Seared sesame fish',
    author: 'Ali Connors',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/fish.png',
    description: 'Cuts of fish like this are perfect for simple searing with bright flavours. Try Sesame seeds on these fillets for crusty skin filled with crunch. For added flavour try dipping in a homemade ponzu sauce - delicious.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image8.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1 ½ lbs', description: 'Thin fish fillets'),
      const RecipeIngredient(amount: '1 lb', description: 'Salt and black pepper to taste'),
      const RecipeIngredient(amount: '3/4 cup', description: 'Sesame seeds'),
      const RecipeIngredient(amount: '2tbsp', description: 'Sesame oil'),
      const RecipeIngredient(amount: '1tbsp', description: 'Lime juice'),
      const RecipeIngredient(amount: '2 tbsp', description: 'Soy sauce'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Herb artichoke',
    author: 'Sandra Adams',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/healthy.png',
    description: 'This tasty and healthy veggie is a favorite. Artichoke like this can be paired with a hearty main or works well as a small meal with some white wine on the side. Simple and fresh, all foodies love tasty artichoke.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image9.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1', description: 'Small garlic clove, peeled'),
      const RecipeIngredient(amount: '2', description: 'Whole  artichokes'),
      const RecipeIngredient(amount: '4 tbsp', description: 'Fresh lemon juice'),
      const RecipeIngredient(amount: '4 tbsp', description: 'Unsalted butter'),
      const RecipeIngredient(amount: '2 tbsp', description: 'Extra-virgin olive oil'),
      const RecipeIngredient(amount: '1⁄4 tsp', description: 'Freshly ground black pepper'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Pesto bruschetta',
    author: 'Trevor Hansen',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/veggie.png',
    description: 'Life is good when you add amazingly warm bread, fresh pesto sauce, and roasted tomatoes to the table. This a  classic starter to break out in a pinch. It’s easy to make and extra tasty.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image10.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1 loaf', description: 'Sliced French bread'),
      const RecipeIngredient(amount: '½ cup', description: 'Cheese'),
      const RecipeIngredient(amount: '1 cup', description: 'Heirloom tomatoes'),
      const RecipeIngredient(amount: '1 cup', description: 'Fresh basil'),
      const RecipeIngredient(amount: '1 clove', description: 'Garlic '),
      const RecipeIngredient(amount: '½ tbsp', description: 'Olive oil'),
      const RecipeIngredient(amount: '3tsp', description: 'White wine vinegar'),
      const RecipeIngredient(amount: '¼ tsp', description: 'Sea salt'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Garlic bok choy',
    author: 'Sandra Adams',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/spicy.png',
    description: 'Great stir-fried bok choy starts at the market. For me, nothing says tasty like garlic and baby bok choy. Choose fresh, crisp greens. Once home, wash, chop, and then ready for the wok.  No family style spread is complete without these greens.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image11.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1/2 cup', description: 'Chick broth'),
      const RecipeIngredient(amount: '1 tbsp', description: 'Soy sauce'),
      const RecipeIngredient(amount: '¼ cup', description: 'Sliced garlic'),
      const RecipeIngredient(amount: '2-3 lbs', description: 'Bok choy'),
      const RecipeIngredient(amount: '2 tsp', description: 'Sesame oil'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Fresh Fettuccine',
    author: 'Ali Connors',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/main.png',
    description: 'Satisfy a need for rich, creamy homemade goodness with this classic. Creamy fettuccine alfredo will have you hitting the gym the next day, but it’s so good it’s worth it.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image12.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '¾ cup', description: 'Milk'),
      const RecipeIngredient(amount: '1 ½ tsp', description: 'Salt'),
      const RecipeIngredient(amount: '1 tbsp', description: 'Olive oil'),
      const RecipeIngredient(amount: '8oz', description: 'Fettuccine'),
      const RecipeIngredient(amount: '½ cup', description: 'Fresh basil'),
      const RecipeIngredient(amount: '½ cup', description: 'Fresh ground pepper'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
  const Recipe(
    name: 'Sicilian-Style sardines',
    author: 'Peter Carlsson',
    ingredientsImagePath: 'packages/flutter_gallery_assets/pesto/quick.png',
    description: 'My go to way to eat sardines is with a splash of tangy lemon and fresh fennel drizzled on top. The best thing about this dish is the flavour it packs. Prepaid with wild caught sardines or canned.',
    imagePath: 'packages/flutter_gallery_assets/pesto/image13.jpg',
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1/4 cup', description: 'Dry white wine'),
      const RecipeIngredient(amount: '1', description: 'Finely chopped shallot'),
      const RecipeIngredient(amount: '2 tbsp', description: 'Fresh lemon juice'),
      const RecipeIngredient(amount: '1 tbsp', description: 'Fennel seeds, crushed'),
      const RecipeIngredient(amount: '4 tbsp', description: 'Extra virgin olive oil, to taste'),
      const RecipeIngredient(amount: '2 cans', description: 'Sardines in oil, drained'),
    ],
    steps: const<RecipeStep>[
      const RecipeStep(duration: '3 min', description: 'Stir'),
      const RecipeStep(duration: '45 min', description: 'Cook')
    ]
  ),
];