Gallery shrine demo uses image assets (#4544)
This commit is contained in:
parent
2cdda9e679
commit
ebaf9e29a0
@ -11,7 +11,7 @@ dependencies:
|
||||
flutter_gallery_assets:
|
||||
git:
|
||||
url: https://flutter.googlesource.com/gallery-assets
|
||||
ref: ea2c9c344c8b6b318341590e2af0707f8a6649f1
|
||||
ref: 3e55082f0128cb4ef95e0e8d2c14e941024d6da9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
@ -9,7 +9,7 @@ dependencies:
|
||||
flutter_gallery_assets:
|
||||
git:
|
||||
url: https://flutter.googlesource.com/gallery-assets
|
||||
ref: ea2c9c344c8b6b318341590e2af0707f8a6649f1
|
||||
ref: 3e55082f0128cb4ef95e0e8d2c14e941024d6da9
|
||||
|
||||
dev_dependencies:
|
||||
test: any # flutter_test provides the version constraints
|
||||
|
@ -8,6 +8,7 @@ assets:
|
||||
- assets/section_components.png
|
||||
- assets/section_patterns.png
|
||||
- assets/section_usability.png
|
||||
- lib/gallery/example_code.dart
|
||||
- packages/flutter_gallery_assets/appbar_background.jpg
|
||||
- packages/flutter_gallery_assets/pesto/avatar.jpg
|
||||
- packages/flutter_gallery_assets/pesto/image10.jpg
|
||||
@ -48,7 +49,25 @@ assets:
|
||||
- packages/flutter_gallery_assets/landscape_9.jpg
|
||||
- packages/flutter_gallery_assets/landscape_10.jpg
|
||||
- packages/flutter_gallery_assets/landscape_11.jpg
|
||||
- lib/gallery/example_code.dart
|
||||
- packages/flutter_gallery_assets/shrine/products/backpack.png
|
||||
- packages/flutter_gallery_assets/shrine/products/beachball.png
|
||||
- packages/flutter_gallery_assets/shrine/products/binoculars.png
|
||||
- packages/flutter_gallery_assets/shrine/products/brush.png
|
||||
- packages/flutter_gallery_assets/shrine/products/chair.png
|
||||
- packages/flutter_gallery_assets/shrine/products/chucks.png
|
||||
- packages/flutter_gallery_assets/shrine/products/clock.png
|
||||
- packages/flutter_gallery_assets/shrine/products/fish_bowl.png
|
||||
- packages/flutter_gallery_assets/shrine/products/flippers.png
|
||||
- packages/flutter_gallery_assets/shrine/products/green-shoes.png
|
||||
- packages/flutter_gallery_assets/shrine/products/heels.png
|
||||
- packages/flutter_gallery_assets/shrine/products/helmet.png
|
||||
- packages/flutter_gallery_assets/shrine/products/lawn_chair.png
|
||||
- packages/flutter_gallery_assets/shrine/products/lipstick.png
|
||||
- packages/flutter_gallery_assets/shrine/products/popsicle.png
|
||||
- packages/flutter_gallery_assets/shrine/products/radio.png
|
||||
- packages/flutter_gallery_assets/shrine/products/sunnies.png
|
||||
- packages/flutter_gallery_assets/shrine/products/surfboard.png
|
||||
- packages/flutter_gallery_assets/shrine/products/teapot.png
|
||||
- packages/flutter_gallery_assets/shrine/vendors/16c477b.jpg
|
||||
- packages/flutter_gallery_assets/shrine/vendors/ali-connors.png
|
||||
- packages/flutter_gallery_assets/shrine/vendors/peter-carlsson.png
|
||||
|
@ -51,7 +51,7 @@ const Vendor _stella = const Vendor(
|
||||
const List<Product> _allProducts = const <Product> [
|
||||
const Product(
|
||||
name: 'Vintage Bluetooth Radio',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/radio.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/radio.png',
|
||||
categories: const <String>['furniture', 'latest'],
|
||||
price: 300.00,
|
||||
vendor: _sandra,
|
||||
@ -62,7 +62,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Sunglasses',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/sunnies.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/sunnies.png',
|
||||
categories: const <String>['travel', 'fashion', 'beauty'],
|
||||
price: 70.00,
|
||||
vendor: _trevor,
|
||||
@ -74,7 +74,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Clock',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/clock.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/clock.png',
|
||||
categories: const <String>['furniture'],
|
||||
price: 120.00,
|
||||
vendor: _trevor,
|
||||
@ -85,7 +85,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Red popsicle',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/popsicle.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/popsicle.png',
|
||||
categories: const <String>['food', 'fashion'],
|
||||
price: 300.00,
|
||||
vendor: _stella,
|
||||
@ -96,7 +96,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Folding Chair',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/lawn_chair.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/lawn_chair.png',
|
||||
categories: const <String>['furniture'],
|
||||
price: 63.00,
|
||||
vendor: _stella,
|
||||
@ -105,7 +105,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Green comfort chair',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/chair.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/chair.png',
|
||||
categories: const <String>['furniture'],
|
||||
price: 36.00,
|
||||
vendor: _ali,
|
||||
@ -114,7 +114,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Better wearing heels',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/heels.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/heels.png',
|
||||
categories: const <String>['fashion'],
|
||||
price: 125.00,
|
||||
vendor: _peter,
|
||||
@ -123,7 +123,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Green Slip-ons',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/green-shoes.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/green-shoes.png',
|
||||
categories: const <String>['travel', 'fashion'],
|
||||
price: 75.00,
|
||||
vendor: _sandra,
|
||||
@ -134,7 +134,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Teapot',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/teapot.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/teapot.png',
|
||||
categories: const <String>['furniture', 'fashion'],
|
||||
price: 210.00,
|
||||
vendor: _trevor,
|
||||
@ -148,7 +148,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Blue suede shoes',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/chucks.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/chucks.png',
|
||||
categories: const <String>['travel', 'fashion'],
|
||||
price: 89.00,
|
||||
vendor: _trevor,
|
||||
@ -158,7 +158,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Dipped Brush',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/brush.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/brush.png',
|
||||
categories: const <String>['fashion', 'beauty'],
|
||||
price: 25.00,
|
||||
vendor: _stella,
|
||||
@ -169,7 +169,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Perfect Goldfish Bowl',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/fish_bowl.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/fish_bowl.png',
|
||||
categories: const <String>['latest', 'furniture'],
|
||||
price: 25.00,
|
||||
vendor: _ali,
|
||||
@ -180,7 +180,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Red Lipstick Set',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/lipstick.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/lipstick.png',
|
||||
categories: const <String>['fashion', 'beauty'],
|
||||
price: 25.00,
|
||||
vendor: _sandra,
|
||||
@ -191,7 +191,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Backpack',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/backpack.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/backpack.png',
|
||||
categories: const <String>['travel', 'fashion'],
|
||||
price: 25.00,
|
||||
vendor: _peter,
|
||||
@ -202,7 +202,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Half Shield Helmet',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/helmet.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/helmet.png',
|
||||
categories: const <String>['travel', 'fashion', 'latest'],
|
||||
price: 25.00,
|
||||
vendor: _ali,
|
||||
@ -213,7 +213,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Beachball',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/beachball.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/beachball.png',
|
||||
categories: const <String>['latest'],
|
||||
price: 17.00,
|
||||
vendor: _peter,
|
||||
@ -224,7 +224,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Old Binoculars',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/binoculars.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/binoculars.png',
|
||||
categories: const <String>['travel', 'fashion', 'latest'],
|
||||
price: 25.00,
|
||||
vendor: _stella,
|
||||
@ -236,7 +236,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Lime Flippers',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/flippers.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/flippers.png',
|
||||
categories: const <String>['travel', 'fashion', 'beauty'],
|
||||
price: 25.00,
|
||||
vendor: _peter,
|
||||
@ -247,7 +247,7 @@ const List<Product> _allProducts = const <Product> [
|
||||
),
|
||||
const Product(
|
||||
name: 'Surfboard',
|
||||
imageUrl: 'https://www.gstatic.com/angular/material-adaptive/shrine/surfboard.png',
|
||||
imageAsset: 'packages/flutter_gallery_assets/shrine/products/surfboard.png',
|
||||
categories: const <String>[ 'travel', 'latest'],
|
||||
price: 25.00,
|
||||
vendor: _stella,
|
||||
|
@ -140,9 +140,9 @@ class FeatureItem extends StatelessWidget {
|
||||
minHeight: 340.0,
|
||||
maxHeight: 340.0,
|
||||
alignment: FractionalOffset.topRight,
|
||||
child: new NetworkImage(
|
||||
child: new AssetImage(
|
||||
fit: ImageFit.cover,
|
||||
src: product.imageUrl
|
||||
name: product.imageAsset
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -205,9 +205,9 @@ class ProductItem extends StatelessWidget {
|
||||
new Hero(
|
||||
tag: productHeroTag,
|
||||
key: new ObjectKey(product),
|
||||
child: new NetworkImage(
|
||||
child: new AssetImage(
|
||||
fit: ImageFit.contain,
|
||||
src: product.imageUrl
|
||||
name: product.imageAsset
|
||||
)
|
||||
),
|
||||
new Material(
|
||||
@ -280,7 +280,7 @@ class _ShrineHomeState extends State<ShrineHome> {
|
||||
rowSpacing: 8.0,
|
||||
columnSpacing: 8.0,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
tileAspectRatio: 160.0 / 216.0, // width/height
|
||||
tileAspectRatio: 160.0 / 224.0, // width/height
|
||||
children: _products.map((Product product) {
|
||||
return new RepaintBoundary(
|
||||
child: new ProductItem(
|
||||
|
@ -41,9 +41,9 @@ class OrderItem extends StatelessWidget {
|
||||
height: 248.0,
|
||||
child: new Hero(
|
||||
tag: productHeroTag,
|
||||
child: new NetworkImage(
|
||||
child: new AssetImage(
|
||||
fit: ImageFit.contain,
|
||||
src: product.imageUrl
|
||||
name: product.imageAsset
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -192,9 +192,9 @@ class _OrderPageState extends State<OrderPage> {
|
||||
.map((Product product) {
|
||||
return new Card(
|
||||
elevation: 0,
|
||||
child: new NetworkImage(
|
||||
child: new AssetImage(
|
||||
fit: ImageFit.contain,
|
||||
src: product.imageUrl
|
||||
name: product.imageAsset
|
||||
)
|
||||
);
|
||||
}).toList()
|
||||
|
@ -33,7 +33,7 @@ class Product {
|
||||
this.description,
|
||||
this.featureTitle,
|
||||
this.featureDescription,
|
||||
this.imageUrl,
|
||||
this.imageAsset,
|
||||
this.categories,
|
||||
this.price,
|
||||
this.vendor
|
||||
@ -43,7 +43,7 @@ class Product {
|
||||
final String description;
|
||||
final String featureTitle;
|
||||
final String featureDescription;
|
||||
final String imageUrl;
|
||||
final String imageAsset;
|
||||
final List<String> categories;
|
||||
final double price;
|
||||
final Vendor vendor;
|
||||
@ -53,7 +53,7 @@ class Product {
|
||||
bool isValid() {
|
||||
return name != null &&
|
||||
description != null &&
|
||||
imageUrl != null &&
|
||||
imageAsset != null &&
|
||||
categories != null &&
|
||||
categories.length > 0 &&
|
||||
price != null &&
|
||||
|
@ -13,7 +13,7 @@ dependencies:
|
||||
flutter_gallery_assets:
|
||||
git:
|
||||
url: https://flutter.googlesource.com/gallery-assets
|
||||
ref: ea2c9c344c8b6b318341590e2af0707f8a6649f1
|
||||
ref: 3e55082f0128cb4ef95e0e8d2c14e941024d6da9
|
||||
|
||||
dev_dependencies:
|
||||
test: any # flutter_test provides the version constraints
|
||||
|
Loading…
x
Reference in New Issue
Block a user