Fix the logo widget (#5414)

Some tweaks to the logo widget:

* remove bad assert
* allow text color to be configured
* make logo pretty in dark mode in gallery
* fix some docs
This commit is contained in:
Ian Hickson
2016-08-15 16:02:53 -07:00
committed by GitHub
parent f9876cba4c
commit 0d7363322f
3 changed files with 43 additions and 13 deletions

View File

@@ -19,7 +19,9 @@ class LinkTextSpan extends TextSpan {
}
class GalleryDrawerHeader extends StatefulWidget {
const GalleryDrawerHeader({ Key key }) : super(key: key);
const GalleryDrawerHeader({ Key key, this.light }) : super(key: key);
final bool light;
@override
_GalleryDrawerHeaderState createState() => new _GalleryDrawerHeaderState();
@@ -41,6 +43,7 @@ class _GalleryDrawerHeaderState extends State<GalleryDrawerHeader> {
: FlutterLogoStyle.stacked
: FlutterLogoStyle.markOnly,
swatch: _swatch,
textColor: config.light ? const Color(0xFF616161) : const Color(0xFF9E9E9E),
),
duration: const Duration(milliseconds: 750),
child: new GestureDetector(
@@ -113,7 +116,7 @@ class GalleryDrawer extends StatelessWidget {
return new Drawer(
child: new Block(
children: <Widget>[
new GalleryDrawerHeader(),
new GalleryDrawerHeader(light: useLightTheme),
new DrawerItem(
icon: new Icon(Icons.brightness_5),
onPressed: () { onThemeChanged(true); },