Don't show the 'preview' banner on published gallery (#16727)

This commit is contained in:
xster
2018-04-19 16:18:05 -07:00
committed by GitHub
parent 133c98a85b
commit cdf80b642b
3 changed files with 42 additions and 10 deletions

View File

@@ -85,6 +85,10 @@ class GalleryHome extends StatefulWidget {
assert(onTimeDilationChanged != null),
super(key: key);
// In checked mode our MaterialApp will show the default "debug" banner.
// Otherwise show the "preview" banner.
static bool showPreviewBanner = true;
final GalleryTheme galleryTheme;
final ValueChanged<GalleryTheme> onThemeChanged;
@@ -206,15 +210,12 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
)
);
// In checked mode our MaterialApp will show the default "debug" banner.
// Otherwise show the "preview" banner.
bool showPreviewBanner = true;
assert(() {
showPreviewBanner = false;
GalleryHome.showPreviewBanner = false;
return true;
}());
if (showPreviewBanner) {
if (GalleryHome.showPreviewBanner) {
home = new Stack(
fit: StackFit.expand,
children: <Widget>[

View File

@@ -0,0 +1,13 @@
// Copyright 2018 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 'gallery/home.dart';
import 'main.dart' as other_main;
// This main chain-calls main.dart's main. This file is used for publishing
// the gallery and removes the 'PREVIEW' banner.
void main() {
GalleryHome.showPreviewBanner = false;
other_main.main();
}