mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 23:39:14 +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,8 +1,8 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// Copyright 2017 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/material.dart';
|
||||
|
||||
import 'sections.dart';
|
||||
|
||||
@@ -10,9 +10,9 @@ const double kSectionIndicatorWidth = 32.0;
|
||||
|
||||
// The card for a single section. Displays the section's gradient and background image.
|
||||
class SectionCard extends StatelessWidget {
|
||||
const SectionCard({Key key, @required this.section})
|
||||
: assert(section != null),
|
||||
super(key: key);
|
||||
const SectionCard({ Key key, @required this.section })
|
||||
: assert(section != null),
|
||||
super(key: key);
|
||||
|
||||
final Section section;
|
||||
|
||||
@@ -32,17 +32,12 @@ class SectionCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
// TODO(b:119312219): Remove Opacity layer when Image Color Filter
|
||||
// is implemented in paintImage.
|
||||
child: Opacity(
|
||||
opacity: 0.075,
|
||||
child: Image.asset(
|
||||
section.backgroundAsset,
|
||||
package: section.backgroundAssetPackage,
|
||||
color: const Color.fromRGBO(255, 255, 255, 0.075),
|
||||
colorBlendMode: BlendMode.modulate,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
child: Image.asset(
|
||||
section.backgroundAsset,
|
||||
package: section.backgroundAssetPackage,
|
||||
color: const Color.fromRGBO(255, 255, 255, 0.075),
|
||||
colorBlendMode: BlendMode.modulate,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -57,10 +52,10 @@ class SectionTitle extends StatelessWidget {
|
||||
@required this.section,
|
||||
@required this.scale,
|
||||
@required this.opacity,
|
||||
}) : assert(section != null),
|
||||
assert(scale != null),
|
||||
assert(opacity != null && opacity >= 0.0 && opacity <= 1.0),
|
||||
super(key: key);
|
||||
}) : assert(section != null),
|
||||
assert(scale != null),
|
||||
assert(opacity != null && opacity >= 0.0 && opacity <= 1.0),
|
||||
super(key: key);
|
||||
|
||||
final Section section;
|
||||
final double scale;
|
||||
@@ -104,7 +99,7 @@ class SectionTitle extends StatelessWidget {
|
||||
|
||||
// Small horizontal bar that indicates the selected section.
|
||||
class SectionIndicator extends StatelessWidget {
|
||||
const SectionIndicator({Key key, this.opacity = 1.0}) : super(key: key);
|
||||
const SectionIndicator({ Key key, this.opacity = 1.0 }) : super(key: key);
|
||||
|
||||
final double opacity;
|
||||
|
||||
@@ -122,10 +117,10 @@ class SectionIndicator extends StatelessWidget {
|
||||
|
||||
// Display a single SectionDetail.
|
||||
class SectionDetailView extends StatelessWidget {
|
||||
SectionDetailView({Key key, @required this.detail})
|
||||
: assert(detail != null && detail.imageAsset != null),
|
||||
assert((detail.imageAsset ?? detail.title) != null),
|
||||
super(key: key);
|
||||
SectionDetailView({ Key key, @required this.detail })
|
||||
: assert(detail != null && detail.imageAsset != null),
|
||||
assert((detail.imageAsset ?? detail.title) != null),
|
||||
super(key: key);
|
||||
|
||||
final SectionDetail detail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user