Commit 0a4f96e2 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Gallery about box: state Flutter's status and link to our website (#4746)

parent ae835f08
...@@ -2,7 +2,19 @@ ...@@ -2,7 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class LinkTextSpan extends TextSpan {
LinkTextSpan({ TextStyle style, String url, String text }) : super(
style: style,
text: text ?? url,
recognizer: new TapGestureRecognizer()..onTap = () {
UrlLauncher.launch(url);
}
);
}
class GalleryDrawer extends StatelessWidget { class GalleryDrawer extends StatelessWidget {
GalleryDrawer({ GalleryDrawer({
...@@ -29,6 +41,10 @@ class GalleryDrawer extends StatelessWidget { ...@@ -29,6 +41,10 @@ class GalleryDrawer extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context);
TextStyle aboutTextStyle = themeData.textTheme.body2;
TextStyle aboutLinkStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor);
return new Drawer( return new Drawer(
child: new Block( child: new Block(
children: <Widget>[ children: <Widget>[
...@@ -100,12 +116,41 @@ class GalleryDrawer extends StatelessWidget { ...@@ -100,12 +116,41 @@ class GalleryDrawer extends StatelessWidget {
applicationLegalese: '© 2016 The Chromium Authors', applicationLegalese: '© 2016 The Chromium Authors',
aboutBoxChildren: <Widget>[ aboutBoxChildren: <Widget>[
new Padding( new Padding(
padding: const EdgeInsets.only(top: 24.0, bottom: 8.0), padding: const EdgeInsets.only(top: 24.0),
child: new Center(child: new CircularProgressIndicator()) child: new RichText(
text: new TextSpan(
children: <TextSpan>[
new TextSpan(
style: aboutTextStyle,
text: "Flutter is an early-stage, open-source project to help "
"developers build high-performance, high-fidelity, mobile "
"apps for iOS and Android from a single codebase. This "
"gallery is a preview of Flutter's many widgets, behaviors, "
"animations, layouts, and more. Learn more about Flutter at "
), ),
new Text('Awaiting fix for issue 4512.', textAlign: TextAlign.center), new LinkTextSpan(
] style: aboutLinkStyle,
url: 'https://flutter.io'
),
new TextSpan(
style: aboutTextStyle,
text: ".\n\nTo see the source code for this app, please visit the "
),
new LinkTextSpan(
style: aboutLinkStyle,
url: 'https://goo.gl/iv1p4G',
text: 'flutter github repo'
), ),
new TextSpan(
style: aboutTextStyle,
text: "."
)
]
)
)
)
]
)
] ]
) )
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment