This auto-formats all *.dart files in the repository outside of the `engine` subdirectory and enforces that these files stay formatted with a presubmit check. **Reviewers:** Please carefully review all the commits except for the one titled "formatted". The "formatted" commit was auto-generated by running `dev/tools/format.sh -a -f`. The other commits were hand-crafted to prepare the repo for the formatting change. I recommend reviewing the commits one-by-one via the "Commits" tab and avoiding Github's "Files changed" tab as it will likely slow down your browser because of the size of this PR. --------- Co-authored-by: Kate Lovett <katelovett@google.com> Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
64 lines
2.0 KiB
Dart
64 lines
2.0 KiB
Dart
// Copyright 2014 The Flutter 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 '../../data/gallery_options.dart';
|
|
import '../../gallery_localizations.dart';
|
|
import 'home.dart';
|
|
import 'routes.dart' as routes;
|
|
|
|
const Color _primaryColor = Color(0xFF6200EE);
|
|
|
|
class StarterApp extends StatelessWidget {
|
|
const StarterApp({super.key});
|
|
|
|
static const String defaultRoute = routes.defaultRoute;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
restorationScopeId: 'starter_app',
|
|
title: GalleryLocalizations.of(context)!.starterAppTitle,
|
|
debugShowCheckedModeBanner: false,
|
|
localizationsDelegates: GalleryLocalizations.localizationsDelegates,
|
|
supportedLocales: GalleryLocalizations.supportedLocales,
|
|
locale: GalleryOptions.of(context).locale,
|
|
initialRoute: StarterApp.defaultRoute,
|
|
routes: <String, WidgetBuilder>{
|
|
StarterApp.defaultRoute: (BuildContext context) => const _Home(),
|
|
},
|
|
theme: ThemeData(
|
|
highlightColor: Colors.transparent,
|
|
colorScheme: const ColorScheme(
|
|
primary: _primaryColor,
|
|
primaryContainer: Color(0xFF3700B3),
|
|
secondary: Color(0xFF03DAC6),
|
|
secondaryContainer: Color(0xFF018786),
|
|
background: Colors.white,
|
|
surface: Colors.white,
|
|
onBackground: Colors.black,
|
|
error: Color(0xFFB00020),
|
|
onError: Colors.white,
|
|
onPrimary: Colors.white,
|
|
onSecondary: Colors.black,
|
|
onSurface: Colors.black,
|
|
brightness: Brightness.light,
|
|
),
|
|
dividerTheme: const DividerThemeData(thickness: 1, color: Color(0xFFE5E5E5)),
|
|
platform: GalleryOptions.of(context).platform,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _Home extends StatelessWidget {
|
|
const _Home();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const ApplyTextOptions(child: HomePage());
|
|
}
|
|
}
|