• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Raw data for the animation demo.
6
7import 'package:flutter/material.dart';
8
9const Color _mariner = Color(0xFF3B5F8F);
10const Color _mediumPurple = Color(0xFF8266D4);
11const Color _tomato = Color(0xFFF95B57);
12const Color _mySin = Color(0xFFF3A646);
13
14const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
15
16class SectionDetail {
17  const SectionDetail({
18    this.title,
19    this.subtitle,
20    this.imageAsset,
21    this.imageAssetPackage,
22  });
23  final String title;
24  final String subtitle;
25  final String imageAsset;
26  final String imageAssetPackage;
27}
28
29class Section {
30  const Section({
31    this.title,
32    this.backgroundAsset,
33    this.backgroundAssetPackage,
34    this.leftColor,
35    this.rightColor,
36    this.details,
37  });
38  final String title;
39  final String backgroundAsset;
40  final String backgroundAssetPackage;
41  final Color leftColor;
42  final Color rightColor;
43  final List<SectionDetail> details;
44
45  @override
46  bool operator==(Object other) {
47    if (other is! Section)
48      return false;
49    final Section otherSection = other;
50    return title == otherSection.title;
51  }
52
53  @override
54  int get hashCode => title.hashCode;
55}
56
57// TODO(hansmuller): replace the SectionDetail images and text. Get rid of
58// the const vars like _eyeglassesDetail and insert a variety of titles and
59// image SectionDetails in the allSections list.
60
61const SectionDetail _eyeglassesDetail = SectionDetail(
62  imageAsset: 'products/sunnies.png',
63  imageAssetPackage: _kGalleryAssetsPackage,
64  title: 'Flutter enables interactive animation',
65  subtitle: '3K views - 5 days',
66);
67
68const SectionDetail _eyeglassesImageDetail = SectionDetail(
69  imageAsset: 'products/sunnies.png',
70  imageAssetPackage: _kGalleryAssetsPackage,
71);
72
73const SectionDetail _seatingDetail = SectionDetail(
74  imageAsset: 'products/table.png',
75  imageAssetPackage: _kGalleryAssetsPackage,
76  title: 'Flutter enables interactive animation',
77  subtitle: '3K views - 5 days',
78);
79
80const SectionDetail _seatingImageDetail = SectionDetail(
81  imageAsset: 'products/table.png',
82  imageAssetPackage: _kGalleryAssetsPackage,
83);
84
85const SectionDetail _decorationDetail = SectionDetail(
86  imageAsset: 'products/earrings.png',
87  imageAssetPackage: _kGalleryAssetsPackage,
88  title: 'Flutter enables interactive animation',
89  subtitle: '3K views - 5 days',
90);
91
92const SectionDetail _decorationImageDetail = SectionDetail(
93  imageAsset: 'products/earrings.png',
94  imageAssetPackage: _kGalleryAssetsPackage,
95);
96
97const SectionDetail _protectionDetail = SectionDetail(
98  imageAsset: 'products/hat.png',
99  imageAssetPackage: _kGalleryAssetsPackage,
100  title: 'Flutter enables interactive animation',
101  subtitle: '3K views - 5 days',
102);
103
104const SectionDetail _protectionImageDetail = SectionDetail(
105  imageAsset: 'products/hat.png',
106  imageAssetPackage: _kGalleryAssetsPackage,
107);
108
109final List<Section> allSections = <Section>[
110  const Section(
111    title: 'SUNGLASSES',
112    leftColor: _mediumPurple,
113    rightColor: _mariner,
114    backgroundAsset: 'products/sunnies.png',
115    backgroundAssetPackage: _kGalleryAssetsPackage,
116    details: <SectionDetail>[
117      _eyeglassesDetail,
118      _eyeglassesImageDetail,
119      _eyeglassesDetail,
120      _eyeglassesDetail,
121      _eyeglassesDetail,
122      _eyeglassesDetail,
123    ],
124  ),
125  const Section(
126    title: 'FURNITURE',
127    leftColor: _tomato,
128    rightColor: _mediumPurple,
129    backgroundAsset: 'products/table.png',
130    backgroundAssetPackage: _kGalleryAssetsPackage,
131    details: <SectionDetail>[
132      _seatingDetail,
133      _seatingImageDetail,
134      _seatingDetail,
135      _seatingDetail,
136      _seatingDetail,
137      _seatingDetail,
138    ],
139  ),
140  const Section(
141    title: 'JEWELRY',
142    leftColor: _mySin,
143    rightColor: _tomato,
144    backgroundAsset: 'products/earrings.png',
145    backgroundAssetPackage: _kGalleryAssetsPackage,
146    details: <SectionDetail>[
147      _decorationDetail,
148      _decorationImageDetail,
149      _decorationDetail,
150      _decorationDetail,
151      _decorationDetail,
152      _decorationDetail,
153    ],
154  ),
155  const Section(
156    title: 'HEADWEAR',
157    leftColor: Colors.white,
158    rightColor: _tomato,
159    backgroundAsset: 'products/hat.png',
160    backgroundAssetPackage: _kGalleryAssetsPackage,
161    details: <SectionDetail>[
162      _protectionDetail,
163      _protectionImageDetail,
164      _protectionDetail,
165      _protectionDetail,
166      _protectionDetail,
167      _protectionDetail,
168    ],
169  ),
170];
171