pesto_demo.dart 32.6 KB
Newer Older
1 2 3 4 5
// 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/material.dart';
6
import 'package:flutter/rendering.dart';
7

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

  static const String routeName = '/pesto';

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

17 18 19

const String _kSmallLogoImage = 'pesto/logo_small.png';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
20
const double _kAppBarHeight = 128.0;
21
const double _kFabHalfSize = 28.0; // TODO(mpcomplete): needs to adapt to screen size
22 23 24
const double _kRecipePageMaxWidth = 500.0;

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

26
final ThemeData _kTheme = new ThemeData(
27
  brightness: Brightness.light,
28
  primarySwatch: Colors.teal,
29
  accentColor: Colors.redAccent,
30 31
);

32 33 34
class PestoHome extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
35
    return const RecipeGridPage(recipes: kPestoRecipes);
36 37 38 39 40 41
  }
}

class PestoFavorites extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
42
    return new RecipeGridPage(recipes: _favoriteRecipes.toList());
43 44
  }
}
45

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

65 66
// Displays a grid of recipe cards.
class RecipeGridPage extends StatefulWidget {
67
  const RecipeGridPage({ Key key, this.recipes }) : super(key: key);
68

69
  final List<Recipe> recipes;
70 71

  @override
72
  _RecipeGridPageState createState() => new _RecipeGridPageState();
73 74
}

75 76
class _RecipeGridPageState extends State<RecipeGridPage> {
  final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
77 78 79

  @override
  Widget build(BuildContext context) {
80
    final double statusBarHeight = MediaQuery.of(context).padding.top;
81
    return new Theme(
82
      data: _kTheme.copyWith(platform: Theme.of(context).platform),
83
      child: new Scaffold(
84
        key: scaffoldKey,
85
        floatingActionButton: new FloatingActionButton(
86
          child: const Icon(Icons.edit),
87
          onPressed: () {
88
            scaffoldKey.currentState.showSnackBar(const SnackBar(
89
              content: const Text('Not supported.'),
90
            ));
91
          },
92
        ),
93 94 95 96 97 98
        body: new CustomScrollView(
          slivers: <Widget>[
            _buildAppBar(context, statusBarHeight),
            _buildBody(context, statusBarHeight),
          ],
        ),
99 100 101 102
      )
    );
  }

103
  Widget _buildAppBar(BuildContext context, double statusBarHeight) {
104 105
    return new SliverAppBar(
      pinned: true,
106
      expandedHeight: _kAppBarHeight,
107 108
      actions: <Widget>[
        new IconButton(
109
          icon: const Icon(Icons.search),
110 111
          tooltip: 'Search',
          onPressed: () {
112
            scaffoldKey.currentState.showSnackBar(const SnackBar(
113
              content: const Text('Not supported.'),
114
            ));
115 116
          },
        ),
117 118
      ],
      flexibleSpace: new LayoutBuilder(
119 120
        builder: (BuildContext context, BoxConstraints constraints) {
          final Size size = constraints.biggest;
121
          final double appBarHeight = size.height - statusBarHeight;
122 123
          final double t = (appBarHeight - kToolbarHeight) / (_kAppBarHeight - kToolbarHeight);
          final double extraPadding = new Tween<double>(begin: 10.0, end: 24.0).lerp(t);
124
          final double logoHeight = appBarHeight - 1.5 * extraPadding;
125
          return new Padding(
126 127
            padding: new EdgeInsets.only(
              top: statusBarHeight + 0.5 * extraPadding,
128
              bottom: extraPadding,
129
            ),
130
            child: new Center(
131
              child: new PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0))
132
            ),
133
          );
134 135
        },
      ),
136 137 138
    );
  }

139
  Widget _buildBody(BuildContext context, double statusBarHeight) {
140 141 142 143 144 145 146
    final EdgeInsets mediaPadding = MediaQuery.of(context).padding;
    final EdgeInsets padding = new EdgeInsets.only(
      top: 8.0,
      left: 8.0 + mediaPadding.left,
      right: 8.0 + mediaPadding.right,
      bottom: 8.0
    );
147 148
    return new SliverPadding(
      padding: padding,
149
      sliver: new SliverGrid(
150
        gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
151 152 153 154 155 156
          maxCrossAxisExtent: _kRecipePageMaxWidth,
          crossAxisSpacing: 8.0,
          mainAxisSpacing: 8.0,
        ),
        delegate: new SliverChildBuilderDelegate(
          (BuildContext context, int index) {
157
            final Recipe recipe = widget.recipes[index];
158 159 160 161
            return new RecipeCard(
              recipe: recipe,
              onTap: () { showRecipePage(context, recipe); },
            );
Ian Hickson's avatar
Ian Hickson committed
162
          },
163
          childCount: widget.recipes.length,
164
        ),
165 166 167 168
      ),
    );
  }

169
  void showFavoritesPage(BuildContext context) {
170
    Navigator.push(context, new MaterialPageRoute<void>(
171
      settings: const RouteSettings(name: '/pesto/favorites'),
172
      builder: (BuildContext context) => new PestoFavorites(),
173 174 175
    ));
  }

176
  void showRecipePage(BuildContext context, Recipe recipe) {
177
    Navigator.push(context, new MaterialPageRoute<void>(
178
      settings: const RouteSettings(name: '/pesto/recipe'),
179 180
      builder: (BuildContext context) {
        return new Theme(
181
          data: _kTheme.copyWith(platform: Theme.of(context).platform),
182
          child: new RecipePage(recipe: recipe),
183
        );
184
      },
185 186
    ));
  }
187 188 189
}

class PestoLogo extends StatefulWidget {
190
  const PestoLogo({this.height, this.t});
191 192

  final double height;
193
  final double t;
194 195 196 197 198 199 200 201 202 203 204 205

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

class _PestoLogoState extends State<PestoLogo> {
  // Native sizes for logo and its image/text components.
  static const double kLogoHeight = 162.0;
  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);
206 207 208 209
  final RectTween _textRectTween = new RectTween(
    begin: new Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight),
    end: new Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight)
  );
210
  final Curve _textOpacity = const Interval(0.4, 1.0, curve: Curves.easeInOut);
211 212
  final RectTween _imageRectTween = new RectTween(
    begin: new Rect.fromLTWH(0.0, 0.0, kLogoWidth, kLogoHeight),
213
    end: new Rect.fromLTWH(0.0, 0.0, kLogoWidth, kImageHeight),
214
  );
215 216 217 218

  @override
  Widget build(BuildContext context) {
    return new Transform(
219
      transform: new Matrix4.identity()..scale(widget.height / kLogoHeight),
220
      alignment: Alignment.topCenter,
221 222 223 224 225
      child: new SizedBox(
        width: kLogoWidth,
        child: new Stack(
          overflow: Overflow.visible,
          children: <Widget>[
226
            new Positioned.fromRect(
227
              rect: _imageRectTween.lerp(widget.t),
228 229 230 231 232
              child: new Image.asset(
                _kSmallLogoImage,
                package: _kGalleryAssetsPackage,
                fit: BoxFit.contain,
              ),
233 234
            ),
            new Positioned.fromRect(
235
              rect: _textRectTween.lerp(widget.t),
236
              child: new Opacity(
237
                opacity: _textOpacity.transform(widget.t),
238
                child: new Text('PESTO', style: titleStyle, textAlign: TextAlign.center),
239 240 241 242 243
              ),
            ),
          ],
        ),
      ),
244 245
    );
  }
246 247
}

248 249 250 251
// 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);
252

253
  const RecipeCard({ Key key, this.recipe, this.onTap }) : super(key: key);
254 255 256 257 258 259

  final Recipe recipe;
  final VoidCallback onTap;

  @override
  Widget build(BuildContext context) {
260 261 262 263 264 265 266 267 268 269 270 271
    return new GestureDetector(
      onTap: onTap,
      child: new Card(
        child: new Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            new Hero(
              tag: 'packages/$_kGalleryAssetsPackage/${recipe.imagePath}',
              child: new Image.asset(
                recipe.imagePath,
                package: recipe.imagePackage,
                fit: BoxFit.contain,
272
              ),
273 274 275 276 277 278 279 280 281 282 283
            ),
            new Expanded(
              child: new Row(
                children: <Widget>[
                  new Padding(
                    padding: const EdgeInsets.all(16.0),
                    child: new Image.asset(
                      recipe.ingredientsImagePath,
                      package: recipe.ingredientsImagePackage,
                      width: 48.0,
                      height: 48.0,
284
                    ),
285 286 287 288 289 290 291 292 293
                  ),
                  new Expanded(
                    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),
                      ],
294
                    ),
295 296
                  ),
                ],
297
              ),
298 299
            ),
          ],
300 301
        ),
      ),
302 303 304 305
    );
  }
}

306 307
// Displays one recipe. Includes the recipe sheet with a background image.
class RecipePage extends StatefulWidget {
308
  const 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
  final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
318
  final TextStyle menuItemStyle = const PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0);
319

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

322 323
  @override
  Widget build(BuildContext context) {
324 325 326 327
    // 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.
    final double appBarHeight = _getAppBarHeight(context);
328
    final Size screenSize = MediaQuery.of(context).size;
329
    final bool fullWidth = screenSize.width < _kRecipePageMaxWidth;
330
    final bool isFavorite = _favoriteRecipes.contains(widget.recipe);
331 332 333 334 335 336 337 338 339 340
    return new Scaffold(
      key: _scaffoldKey,
      body: new Stack(
        children: <Widget>[
          new Positioned(
            top: 0.0,
            left: 0.0,
            right: 0.0,
            height: appBarHeight + _kFabHalfSize,
            child: new Hero(
341
              tag: 'packages/$_kGalleryAssetsPackage/${widget.recipe.imagePath}',
342
              child: new Image.asset(
343
                widget.recipe.imagePath,
344
                package: widget.recipe.imagePackage,
345
                fit: fullWidth ? BoxFit.fitWidth : BoxFit.cover,
346
              ),
347 348
            ),
          ),
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
          new CustomScrollView(
            slivers: <Widget>[
              new SliverAppBar(
                expandedHeight: appBarHeight - _kFabHalfSize,
                backgroundColor: Colors.transparent,
                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'),
                    ],
                  ),
                ],
365 366 367 368
                flexibleSpace: const FlexibleSpaceBar(
                  background: const DecoratedBox(
                    decoration: const BoxDecoration(
                      gradient: const LinearGradient(
369 370
                        begin: const Alignment(0.0, -1.0),
                        end: const Alignment(0.0, -0.2),
371
                        colors: const<Color>[const Color(0x60000000), const Color(0x00000000)],
372 373 374 375 376 377
                      ),
                    ),
                  ),
                ),
              ),
              new SliverToBoxAdapter(
378 379
                child: new Stack(
                  children: <Widget>[
380
                    new Container(
381
                      padding: const EdgeInsets.only(top: _kFabHalfSize),
382
                      width: fullWidth ? null : _kRecipePageMaxWidth,
383
                      child: new RecipeSheet(recipe: widget.recipe),
384 385 386 387 388
                    ),
                    new Positioned(
                      right: 16.0,
                      child: new FloatingActionButton(
                        child: new Icon(isFavorite ? Icons.favorite : Icons.favorite_border),
389 390 391 392
                        onPressed: _toggleFavorite,
                      ),
                    ),
                  ],
393
                )
394
              ),
395
            ],
396
          ),
397 398
        ],
      ),
399 400 401 402 403 404 405 406 407
    );
  }

  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
408
            child: new Icon(icon, color: Colors.black54)
409
          ),
410 411 412
          new Text(label, style: menuItemStyle),
        ],
      ),
413 414 415 416 417
    );
  }

  void _toggleFavorite() {
    setState(() {
418 419
      if (_favoriteRecipes.contains(widget.recipe))
        _favoriteRecipes.remove(widget.recipe);
420
      else
421
        _favoriteRecipes.add(widget.recipe);
422 423 424 425
    });
  }
}

426 427 428 429 430 431 432
/// 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);
433

434
  RecipeSheet({ Key key, this.recipe }) : super(key: key);
435 436 437 438 439 440

  final Recipe recipe;

  @override
  Widget build(BuildContext context) {
    return new Material(
441 442 443 444 445 446
      child: new SafeArea(
        top: false,
        bottom: false,
        child: new Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
          child: new Table(
447
            columnWidths: const <int, TableColumnWidth>{
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 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
              0: const FixedColumnWidth(64.0)
            },
            children: <TableRow>[
              new TableRow(
                children: <Widget>[
                  new TableCell(
                    verticalAlignment: TableCellVerticalAlignment.middle,
                    child: new Image.asset(
                      recipe.ingredientsImagePath,
                      package: recipe.ingredientsImagePackage,
                      width: 32.0,
                      height: 32.0,
                      alignment: Alignment.centerLeft,
                      fit: BoxFit.scaleDown
                    )
                  ),
                  new TableCell(
                    verticalAlignment: TableCellVerticalAlignment.middle,
                    child: new Text(recipe.name, style: titleStyle)
                  ),
                ]
              ),
              new TableRow(
                children: <Widget>[
                  const SizedBox(),
                  new Padding(
                    padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
                    child: new Text(recipe.description, style: descriptionStyle)
                  ),
                ]
              ),
              new TableRow(
                children: <Widget>[
                  const 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>[
                  const 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);
              }
            )),
          ),
508 509
        ),
      ),
510 511 512 513 514 515 516 517
    );
  }

  TableRow _buildItemRow(String left, String right) {
    return new TableRow(
      children: <Widget>[
        new Padding(
          padding: const EdgeInsets.symmetric(vertical: 4.0),
518
          child: new Text(left, style: itemAmountStyle),
519 520 521
        ),
        new Padding(
          padding: const EdgeInsets.symmetric(vertical: 4.0),
522 523 524
          child: new Text(right, style: itemStyle),
        ),
      ],
525 526 527 528 529 530 531 532 533 534
    );
  }
}

class Recipe {
  const Recipe({
    this.name,
    this.author,
    this.description,
    this.imagePath,
535
    this.imagePackage,
536
    this.ingredientsImagePath,
537
    this.ingredientsImagePackage,
538 539 540 541 542 543 544 545
    this.ingredients,
    this.steps
  });

  final String name;
  final String author;
  final String description;
  final String imagePath;
546
  final String imagePackage;
547
  final String ingredientsImagePath;
548
  final String ingredientsImagePackage;
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
  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;
}

567
const List<Recipe> kPestoRecipes = const <Recipe>[
568
  const Recipe(
569
    name: 'Pesto Bruschetta',
570
    author: 'Peter Carlsson',
571 572
    ingredientsImagePath: 'pesto/quick.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
573
    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.',
574 575
    imagePath: 'pesto/image1.jpg',
    imagePackage: _kGalleryAssetsPackage,
576 577 578 579 580 581 582 583 584
    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'),
585 586
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
587 588 589 590
  ),
  const Recipe(
    name: 'Rustic purple mash',
    author: 'Trevor Hansen',
591 592
    ingredientsImagePath: 'pesto/veggie.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
593
    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.',
594 595
    imagePath: 'pesto/image2.jpg',
    imagePackage: _kGalleryAssetsPackage,
596 597 598 599 600 601 602 603 604
    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'),
605 606
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
607 608 609 610
  ),
  const Recipe(
    name: 'Bacon Sprouts',
    author: 'Ali Connors',
611 612
    ingredientsImagePath: 'pesto/main.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
613
    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.',
614 615
    imagePath: 'pesto/image3.jpg',
    imagePackage: _kGalleryAssetsPackage,
616 617 618 619 620 621 622 623 624 625
    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'),
626 627
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
628 629 630 631
  ),
  const Recipe(
    name: 'Oven Sausage',
    author: 'Sandra Adams',
632 633
    ingredientsImagePath: 'pesto/meat.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
634
    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.',
635 636
    imagePath: 'pesto/image4.jpg',
    imagePackage: _kGalleryAssetsPackage,
637 638 639 640 641 642
    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'),
643 644
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
645 646 647 648
  ),
  const Recipe(
    name: 'Chicken tostadas',
    author: 'Peter Carlsson',
649 650
    ingredientsImagePath: 'pesto/spicy.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
651
    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.',
652 653
    imagePath: 'pesto/image5.jpg',
    imagePackage: _kGalleryAssetsPackage,
654 655 656 657 658 659 660 661
    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'),
662 663
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
664 665 666 667
  ),
  const Recipe(
    name: 'Coconut rice',
    author: 'Ali Connors',
668 669
    ingredientsImagePath: 'pesto/healthy.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
670
    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.',
671 672
    imagePath: 'pesto/image6.jpg',
    imagePackage: _kGalleryAssetsPackage,
673 674 675 676 677 678 679 680 681 682
    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')
683
    ],
684 685 686 687
  ),
  const Recipe(
    name: 'Gin basil cocktail',
    author: 'Trevor Hansen',
688 689
    ingredientsImagePath: 'pesto/quick.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
690
    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.',
691 692
    imagePath: 'pesto/image7.jpg',
    imagePackage: _kGalleryAssetsPackage,
693 694 695 696 697 698 699 700
    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'),
701 702
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
703 704 705 706
  ),
  const Recipe(
    name: 'Seared sesame fish',
    author: 'Ali Connors',
707 708
    ingredientsImagePath: 'pesto/fish.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
709
    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.',
710 711
    imagePath: 'pesto/image8.jpg',
    imagePackage: _kGalleryAssetsPackage,
712 713 714 715 716 717 718 719 720 721
    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'),
722 723
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
724 725 726 727
  ),
  const Recipe(
    name: 'Herb artichoke',
    author: 'Sandra Adams',
728 729
    ingredientsImagePath: 'pesto/healthy.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
730
    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.',
731 732
    imagePath: 'pesto/image9.jpg',
    imagePackage: _kGalleryAssetsPackage,
733 734
    ingredients: const<RecipeIngredient>[
      const RecipeIngredient(amount: '1', description: 'Small garlic clove, peeled'),
735
      const RecipeIngredient(amount: '2', description: 'Whole artichokes'),
736 737 738 739 740 741 742
      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'),
743 744
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
745 746 747 748
  ),
  const Recipe(
    name: 'Pesto bruschetta',
    author: 'Trevor Hansen',
749 750
    ingredientsImagePath: 'pesto/veggie.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
751
    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.',
752 753
    imagePath: 'pesto/image10.jpg',
    imagePackage: _kGalleryAssetsPackage,
754 755 756 757 758 759 760 761 762 763 764 765
    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'),
766 767
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
768 769 770 771
  ),
  const Recipe(
    name: 'Garlic bok choy',
    author: 'Sandra Adams',
772 773
    ingredientsImagePath: 'pesto/spicy.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
774
    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.',
775 776
    imagePath: 'pesto/image11.jpg',
    imagePackage: _kGalleryAssetsPackage,
777 778 779 780 781 782 783 784 785
    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'),
786 787
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
788 789 790 791
  ),
  const Recipe(
    name: 'Fresh Fettuccine',
    author: 'Ali Connors',
792 793
    ingredientsImagePath: 'pesto/main.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
794
    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.',
795 796
    imagePath: 'pesto/image12.jpg',
    imagePackage: _kGalleryAssetsPackage,
797 798 799 800 801 802 803 804 805 806
    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'),
807 808
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
809 810 811 812
  ),
  const Recipe(
    name: 'Sicilian-Style sardines',
    author: 'Peter Carlsson',
813 814
    ingredientsImagePath: 'pesto/quick.png',
    ingredientsImagePackage: _kGalleryAssetsPackage,
815
    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.',
816 817
    imagePath: 'pesto/image13.jpg',
    imagePackage: _kGalleryAssetsPackage,
818 819 820 821 822 823 824 825 826 827
    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'),
828 829
      const RecipeStep(duration: '45 min', description: 'Cook'),
    ],
830 831
  ),
];