Auto-format Framework (#160545)
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>
This commit is contained in:
committed by
GitHub
parent
8e0993eda8
commit
5491c8c146
@@ -15,14 +15,14 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Autocomplete Basic'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Autocomplete Basic')),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('Type below to autocomplete the following possible results: ${AutocompleteBasicExample._kOptions}.'),
|
||||
Text(
|
||||
'Type below to autocomplete the following possible results: ${AutocompleteBasicExample._kOptions}.',
|
||||
),
|
||||
const AutocompleteBasicExample(),
|
||||
],
|
||||
),
|
||||
@@ -35,11 +35,7 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
class AutocompleteBasicExample extends StatelessWidget {
|
||||
const AutocompleteBasicExample({super.key});
|
||||
|
||||
static const List<String> _kOptions = <String>[
|
||||
'aardvark',
|
||||
'bobcat',
|
||||
'chameleon',
|
||||
];
|
||||
static const List<String> _kOptions = <String>['aardvark', 'bobcat', 'chameleon'];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -15,14 +15,14 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Autocomplete Basic User'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Autocomplete Basic User')),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('Type below to autocomplete the following possible results: ${AutocompleteBasicUserExample._userOptions}.'),
|
||||
Text(
|
||||
'Type below to autocomplete the following possible results: ${AutocompleteBasicUserExample._userOptions}.',
|
||||
),
|
||||
const AutocompleteBasicUserExample(),
|
||||
],
|
||||
),
|
||||
@@ -34,10 +34,7 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
|
||||
@immutable
|
||||
class User {
|
||||
const User({
|
||||
required this.email,
|
||||
required this.name,
|
||||
});
|
||||
const User({required this.email, required this.name});
|
||||
|
||||
final String email;
|
||||
final String name;
|
||||
|
||||
@@ -18,14 +18,14 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Autocomplete - async'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Autocomplete - async')),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('Type below to autocomplete the following possible results: ${_FakeAPI._kOptions}.'),
|
||||
Text(
|
||||
'Type below to autocomplete the following possible results: ${_FakeAPI._kOptions}.',
|
||||
),
|
||||
const _AsyncAutocomplete(),
|
||||
],
|
||||
),
|
||||
@@ -39,10 +39,10 @@ class _AsyncAutocomplete extends StatefulWidget {
|
||||
const _AsyncAutocomplete();
|
||||
|
||||
@override
|
||||
State<_AsyncAutocomplete > createState() => _AsyncAutocompleteState();
|
||||
State<_AsyncAutocomplete> createState() => _AsyncAutocompleteState();
|
||||
}
|
||||
|
||||
class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
class _AsyncAutocompleteState extends State<_AsyncAutocomplete> {
|
||||
// The query currently being searched for. If null, there is no pending
|
||||
// request.
|
||||
String? _searchingWithQuery;
|
||||
@@ -76,11 +76,7 @@ class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
|
||||
// Mimics a remote API.
|
||||
class _FakeAPI {
|
||||
static const List<String> _kOptions = <String>[
|
||||
'aardvark',
|
||||
'bobcat',
|
||||
'chameleon',
|
||||
];
|
||||
static const List<String> _kOptions = <String>['aardvark', 'bobcat', 'chameleon'];
|
||||
|
||||
// Searches the options, but injects a fake "network" delay.
|
||||
static Future<Iterable<String>> search(String query) async {
|
||||
|
||||
@@ -21,14 +21,14 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Autocomplete - async and debouncing'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Autocomplete - async and debouncing')),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('Type below to autocomplete the following possible results: ${_FakeAPI._kOptions}.'),
|
||||
Text(
|
||||
'Type below to autocomplete the following possible results: ${_FakeAPI._kOptions}.',
|
||||
),
|
||||
const _AsyncAutocomplete(),
|
||||
],
|
||||
),
|
||||
@@ -42,10 +42,10 @@ class _AsyncAutocomplete extends StatefulWidget {
|
||||
const _AsyncAutocomplete();
|
||||
|
||||
@override
|
||||
State<_AsyncAutocomplete > createState() => _AsyncAutocompleteState();
|
||||
State<_AsyncAutocomplete> createState() => _AsyncAutocompleteState();
|
||||
}
|
||||
|
||||
class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
class _AsyncAutocompleteState extends State<_AsyncAutocomplete> {
|
||||
// The query currently being searched for. If null, there is no pending
|
||||
// request.
|
||||
String? _currentQuery;
|
||||
@@ -98,11 +98,7 @@ class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
|
||||
// Mimics a remote API.
|
||||
class _FakeAPI {
|
||||
static const List<String> _kOptions = <String>[
|
||||
'aardvark',
|
||||
'bobcat',
|
||||
'chameleon',
|
||||
];
|
||||
static const List<String> _kOptions = <String>['aardvark', 'bobcat', 'chameleon'];
|
||||
|
||||
// Searches the options, but injects a fake "network" delay.
|
||||
static Future<Iterable<String>> search(String query) async {
|
||||
@@ -141,8 +137,7 @@ _Debounceable<S, T> _debounce<S, T>(_Debounceable<S?, T> function) {
|
||||
|
||||
// A wrapper around Timer used for debouncing.
|
||||
class _DebounceTimer {
|
||||
_DebounceTimer(
|
||||
) {
|
||||
_DebounceTimer() {
|
||||
_timer = Timer(debounceDuration, _onComplete);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@ class AutocompleteExampleApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Autocomplete - async, debouncing, and network errors'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Autocomplete - async, debouncing, and network errors')),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('Type below to autocomplete the following possible results: ${_FakeAPI._kOptions}.'),
|
||||
Text(
|
||||
'Type below to autocomplete the following possible results: ${_FakeAPI._kOptions}.',
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
const _AsyncAutocomplete(),
|
||||
],
|
||||
@@ -44,10 +44,10 @@ class _AsyncAutocomplete extends StatefulWidget {
|
||||
const _AsyncAutocomplete();
|
||||
|
||||
@override
|
||||
State<_AsyncAutocomplete > createState() => _AsyncAutocompleteState();
|
||||
State<_AsyncAutocomplete> createState() => _AsyncAutocompleteState();
|
||||
}
|
||||
|
||||
class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
class _AsyncAutocompleteState extends State<_AsyncAutocomplete> {
|
||||
// The query currently being searched for. If null, there is no pending
|
||||
// request.
|
||||
String? _currentQuery;
|
||||
@@ -113,11 +113,14 @@ class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 32.0,
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
Autocomplete<String>(
|
||||
fieldViewBuilder: (BuildContext context, TextEditingController controller, FocusNode focusNode, VoidCallback onFieldSubmitted) {
|
||||
fieldViewBuilder: (
|
||||
BuildContext context,
|
||||
TextEditingController controller,
|
||||
FocusNode focusNode,
|
||||
VoidCallback onFieldSubmitted,
|
||||
) {
|
||||
return TextFormField(
|
||||
decoration: InputDecoration(
|
||||
errorText: _networkError ? 'Network error, please try again.' : null,
|
||||
@@ -151,11 +154,7 @@ class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
|
||||
// Mimics a remote API.
|
||||
class _FakeAPI {
|
||||
static const List<String> _kOptions = <String>[
|
||||
'aardvark',
|
||||
'bobcat',
|
||||
'chameleon',
|
||||
];
|
||||
static const List<String> _kOptions = <String>['aardvark', 'bobcat', 'chameleon'];
|
||||
|
||||
// Searches the options, but injects a fake "network" delay.
|
||||
static Future<Iterable<String>> search(String query, bool networkEnabled) async {
|
||||
@@ -197,8 +196,7 @@ _Debounceable<S, T> _debounce<S, T>(_Debounceable<S?, T> function) {
|
||||
|
||||
// A wrapper around Timer used for debouncing.
|
||||
class _DebounceTimer {
|
||||
_DebounceTimer(
|
||||
) {
|
||||
_DebounceTimer() {
|
||||
_timer = Timer(debounceDuration, _onComplete);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user