mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 07:18:15 +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,43 +1,15 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// 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_web/material.dart';
|
||||
|
||||
import 'shrine/shrine_home.dart' show ShrineHome;
|
||||
import 'shrine/shrine_theme.dart' show ShrineTheme;
|
||||
|
||||
// This code would ordinarily be part of the MaterialApp's home. It's being
|
||||
// used by the ShrineDemo and by each route pushed from there because this
|
||||
// isn't a standalone app with its own main() and MaterialApp.
|
||||
Widget buildShrine(BuildContext context, Widget child) {
|
||||
return Theme(
|
||||
data: ThemeData(
|
||||
primarySwatch: Colors.grey,
|
||||
iconTheme: const IconThemeData(color: Color(0xFF707070)),
|
||||
platform: Theme.of(context).platform,
|
||||
),
|
||||
child: ShrineTheme(child: child));
|
||||
}
|
||||
|
||||
// In a standalone version of this app, MaterialPageRoute<T> could be used directly.
|
||||
class ShrinePageRoute<T> extends MaterialPageRoute<T> {
|
||||
ShrinePageRoute({
|
||||
WidgetBuilder builder,
|
||||
RouteSettings settings,
|
||||
}) : super(builder: builder, settings: settings);
|
||||
|
||||
@override
|
||||
Widget buildPage(BuildContext context, Animation<double> animation,
|
||||
Animation<double> secondaryAnimation) {
|
||||
return buildShrine(
|
||||
context, super.buildPage(context, animation, secondaryAnimation));
|
||||
}
|
||||
}
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gallery/demo/shrine/app.dart';
|
||||
|
||||
class ShrineDemo extends StatelessWidget {
|
||||
const ShrineDemo({ Key key }) : super(key: key);
|
||||
|
||||
static const String routeName = '/shrine'; // Used by the Gallery app.
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => buildShrine(context, ShrineHome());
|
||||
Widget build(BuildContext context) => ShrineApp();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user