// Copyright 2015 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/material.dart';import'home.dart';classGalleryAppextendsStatefulComponent{GalleryApp({Keykey}):super(key:key);staticGalleryAppStateof(BuildContextcontext)=>context.ancestorStateOfType(constTypeMatcher<GalleryAppState>());GalleryAppStatecreateState()=>newGalleryAppState();}classGalleryAppStateextendsState<GalleryApp>{bool_lightTheme=true;boolgetlightTheme=>_lightTheme;voidsetlightTheme(boolvalue){setState((){_lightTheme=value;});}Widgetbuild(BuildContextcontext){returnnewMaterialApp(title:'Flutter Material Gallery',theme:lightTheme?newThemeData.light():newThemeData.dark(),routes:{'/':(RouteArgumentsargs)=>newGalleryHome()});}}