1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-30 10:59:25 +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:
John Ryan
2019-09-10 09:49:58 -07:00
committed by GitHub
parent 16fa475ff8
commit 317d459a58
746 changed files with 14607 additions and 61610 deletions

View File

@@ -2,10 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_web/gestures.dart';
import 'package:flutter_web/material.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/foundation.dart' show defaultTargetPlatform;
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class _LinkTextSpan extends TextSpan {
// Beware!
//
// This class is only safe because the TapGestureRecognizer is not
@@ -19,27 +23,25 @@ class _LinkTextSpan extends TextSpan {
// manage the recognizer from outside the TextSpan, e.g. in the State of a
// stateful widget that then hands the recognizer to the TextSpan.
_LinkTextSpan({TextStyle style, String url, String text})
: super(
style: style,
text: text ?? url,
recognizer: TapGestureRecognizer()
..onTap = () {
//launch(url, forceSafariVC: false);
});
_LinkTextSpan({ TextStyle style, String url, String text }) : super(
style: style,
text: text ?? url,
recognizer: TapGestureRecognizer()..onTap = () {
launch(url, forceSafariVC: false);
}
);
}
void showGalleryAboutDialog(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final TextStyle aboutTextStyle = themeData.textTheme.body2;
final TextStyle linkStyle =
themeData.textTheme.body2.copyWith(color: themeData.accentColor);
final TextStyle linkStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor);
showAboutDialog(
context: context,
applicationVersion: '2018 Preview',
//applicationIcon: const FlutterLogo(),
applicationLegalese: '© 2018 The Chromium Authors',
applicationVersion: 'January 2019',
applicationIcon: const FlutterLogo(),
applicationLegalese: '© 2019 The Chromium Authors',
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 24.0),
@@ -47,18 +49,21 @@ void showGalleryAboutDialog(BuildContext context) {
text: TextSpan(
children: <TextSpan>[
TextSpan(
style: aboutTextStyle,
text: 'Flutter web is an early-stage, web framework. '
'This gallery is a preview of '
"Flutter's many widgets, behaviors, animations, layouts, "
'and more. Learn more about Flutter at '),
style: aboutTextStyle,
text: 'Flutter is an open-source project to help developers '
'build high-performance, high-fidelity, mobile apps for '
'${defaultTargetPlatform == TargetPlatform.iOS ? 'multiple platforms' : 'iOS and Android'} '
'from a single codebase. This design lab is a playground '
"and showcase of Flutter's many widgets, behaviors, "
'animations, layouts, and more. Learn more about Flutter at ',
),
_LinkTextSpan(
style: linkStyle,
url: 'https://flutter.io',
url: 'https://flutter.dev',
),
TextSpan(
style: aboutTextStyle,
text: '.\n\nTo see the source code for flutter ',
text: '.\n\nTo see the source code for this app, please visit the ',
),
_LinkTextSpan(
style: linkStyle,