Add missing trailing commas (#28673)

* add trailing commas on list/map/parameters

* add trailing commas on Invocation with nb of arg>1

* add commas for widget containing widgets

* add trailing commas if instantiation contains trailing comma

* revert bad change
This commit is contained in:
Alexandre Ardhuin 2019-03-01 08:17:55 +01:00 committed by GitHub
parent 046f960ae2
commit 387f885481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
626 changed files with 5183 additions and 5183 deletions

View File

@ -71,7 +71,7 @@ class TileScrollLayout extends StatelessWidget {
child: IconBar(),
),
);
}
},
),
drawer: const GalleryDrawer(),
);
@ -101,8 +101,8 @@ class ComplexLayoutState extends State<ComplexLayout> {
print('Pressed search');
},
),
TopBarMenu()
]
TopBarMenu(),
],
),
body: Column(
children: <Widget>[
@ -115,7 +115,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
else
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
},
)
),
),
BottomBar(),
],
@ -133,45 +133,45 @@ class TopBarMenu extends StatelessWidget {
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
const PopupMenuItem<String>(
value: 'Friends',
child: MenuItemWithIcon(Icons.people, 'Friends', '5 new')
child: MenuItemWithIcon(Icons.people, 'Friends', '5 new'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
child: MenuItemWithIcon(Icons.event, 'Events', '12 upcoming'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.group, 'Groups', '14')
child: MenuItemWithIcon(Icons.group, 'Groups', '14'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.image, 'Pictures', '12')
child: MenuItemWithIcon(Icons.image, 'Pictures', '12'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33'),
),
const PopupMenuItem<String>(
value: 'Friends',
child: MenuItemWithIcon(Icons.people, 'Friends', '5')
child: MenuItemWithIcon(Icons.people, 'Friends', '5'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.event, 'Events', '12')
child: MenuItemWithIcon(Icons.event, 'Events', '12'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.group, 'Groups', '14')
child: MenuItemWithIcon(Icons.group, 'Groups', '14'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.image, 'Pictures', '12')
child: MenuItemWithIcon(Icons.image, 'Pictures', '12'),
),
const PopupMenuItem<String>(
value: 'Events',
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
)
]
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33'),
),
],
);
}
}
@ -190,10 +190,10 @@ class MenuItemWithIcon extends StatelessWidget {
Icon(icon),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(title)
child: Text(title),
),
Text(subtitle, style: Theme.of(context).textTheme.caption)
]
Text(subtitle, style: Theme.of(context).textTheme.caption),
],
);
}
}
@ -213,11 +213,11 @@ class FancyImageItem extends StatelessWidget {
InfoBar(),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Divider()
child: Divider(),
),
IconBar(),
FatDivider()
]
FatDivider(),
],
);
}
}
@ -235,11 +235,11 @@ class FancyGalleryItem extends StatelessWidget {
InfoBar(),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Divider()
child: Divider(),
),
IconBar(),
FatDivider()
]
FatDivider(),
],
);
}
}
@ -253,9 +253,9 @@ class InfoBar extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
const MiniIconWithText(Icons.thumb_up, '42'),
Text('3 Comments', style: Theme.of(context).textTheme.caption)
]
)
Text('3 Comments', style: Theme.of(context).textTheme.caption),
],
),
);
}
}
@ -271,8 +271,8 @@ class IconBar extends StatelessWidget {
IconWithText(Icons.thumb_up, 'Like'),
IconWithText(Icons.comment, 'Comment'),
IconWithText(Icons.share, 'Share'),
]
)
],
),
);
}
}
@ -290,10 +290,10 @@ class IconWithText extends StatelessWidget {
children: <Widget>[
IconButton(
icon: Icon(icon),
onPressed: () { print('Pressed $title button'); }
onPressed: () { print('Pressed $title button'); },
),
Text(title)
]
Text(title),
],
);
}
}
@ -316,13 +316,13 @@ class MiniIconWithText extends StatelessWidget {
height: 16.0,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
shape: BoxShape.circle
shape: BoxShape.circle,
),
child: Icon(icon, color: Colors.white, size: 12.0)
)
child: Icon(icon, color: Colors.white, size: 12.0),
),
),
Text(title, style: Theme.of(context).textTheme.caption)
]
Text(title, style: Theme.of(context).textTheme.caption),
],
);
}
}
@ -354,8 +354,8 @@ class UserHeader extends StatelessWidget {
child: Image(
image: AssetImage('packages/flutter_gallery_assets/people/square/ali.png'),
width: 32.0,
height: 32.0
)
height: 32.0,
),
),
Expanded(
child: Column(
@ -367,21 +367,21 @@ class UserHeader extends StatelessWidget {
children: <TextSpan>[
TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)),
const TextSpan(text: ' shared a new '),
const TextSpan(text: 'photo', style: TextStyle(fontWeight: FontWeight.bold))
]
const TextSpan(text: 'photo', style: TextStyle(fontWeight: FontWeight.bold)),
],
)),
Row(
children: <Widget>[
Text('Yesterday at 11:55 • ', style: Theme.of(context).textTheme.caption),
Icon(Icons.people, size: 16.0, color: Theme.of(context).textTheme.caption.color)
]
)
]
)
Icon(Icons.people, size: 16.0, color: Theme.of(context).textTheme.caption.color),
],
),
],
),
),
TopBarMenu()
]
)
TopBarMenu(),
],
),
);
}
}
@ -391,7 +391,7 @@ class ItemDescription extends StatelessWidget {
Widget build(BuildContext context) {
return const Padding(
padding: EdgeInsets.all(8.0),
child: Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
child: Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'),
);
}
}
@ -411,7 +411,7 @@ class ItemImageBox extends StatelessWidget {
height: 230.0,
child: Image(
image: AssetImage('packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png')
)
),
),
Theme(
data: ThemeData.dark(),
@ -420,14 +420,14 @@ class ItemImageBox extends StatelessWidget {
children: <Widget>[
IconButton(
icon: const Icon(Icons.edit),
onPressed: () { print('Pressed edit button'); }
onPressed: () { print('Pressed edit button'); },
),
IconButton(
icon: const Icon(Icons.zoom_in),
onPressed: () { print('Pressed zoom button'); }
onPressed: () { print('Pressed zoom button'); },
),
]
)
],
),
),
Positioned(
bottom: 4.0,
@ -435,7 +435,7 @@ class ItemImageBox extends StatelessWidget {
child: Container(
decoration: BoxDecoration(
color: Colors.black54,
borderRadius: BorderRadius.circular(2.0)
borderRadius: BorderRadius.circular(2.0),
),
padding: const EdgeInsets.all(4.0),
child: const RichText(
@ -447,14 +447,14 @@ class ItemImageBox extends StatelessWidget {
),
TextSpan(
style: TextStyle(fontWeight: FontWeight.bold),
text: 'Chris Godley'
)
]
)
)
)
)
]
text: 'Chris Godley',
),
],
),
),
),
),
],
)
,
Padding(
@ -464,13 +464,13 @@ class ItemImageBox extends StatelessWidget {
children: <Widget>[
Text('Artisans of Southern India', style: Theme.of(context).textTheme.body2),
Text('Silk Spinners', style: Theme.of(context).textTheme.body1),
Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption)
]
)
)
]
)
)
Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption),
],
),
),
],
),
),
);
}
}
@ -483,7 +483,7 @@ class ItemGalleryBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
final List<String> tabNames = <String>[
'A', 'B', 'C', 'D'
'A', 'B', 'C', 'D',
];
return SizedBox(
@ -507,8 +507,8 @@ class ItemGalleryBox extends StatelessWidget {
color: Theme.of(context).primaryColor,
child: Center(
child: Text(tabName, style: Theme.of(context).textTheme.headline.copyWith(color: Colors.white)),
)
)
),
),
),
Row(
children: <Widget>[
@ -524,24 +524,24 @@ class ItemGalleryBox extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text('This is item $tabName'),
)
)
]
)
]
)
)
)
),
),
],
),
],
),
),
),
);
}).toList()
)
}).toList(),
),
),
Container(
child: const TabPageSelector()
)
]
)
)
child: const TabPageSelector(),
),
],
),
),
);
}
}
@ -554,9 +554,9 @@ class BottomBar extends StatelessWidget {
border: Border(
top: BorderSide(
color: Theme.of(context).dividerColor,
width: 1.0
)
)
width: 1.0,
),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -586,11 +586,11 @@ class BottomBarButton extends StatelessWidget {
children: <Widget>[
IconButton(
icon: Icon(icon),
onPressed: () { print('Pressed: $title'); }
onPressed: () { print('Pressed: $title'); },
),
Text(title, style: Theme.of(context).textTheme.caption)
]
)
Text(title, style: Theme.of(context).textTheme.caption),
],
),
);
}
}
@ -625,7 +625,7 @@ class GalleryDrawer extends StatelessWidget {
_changeScrollMode(context, currentMode == ScrollMode.complex ? ScrollMode.tile : ScrollMode.complex);
Navigator.pop(context);
},
trailing: Text(currentMode == ScrollMode.complex ? 'Tile' : 'Complex')
trailing: Text(currentMode == ScrollMode.complex ? 'Tile' : 'Complex'),
),
ListTile(
leading: const Icon(Icons.brightness_5),
@ -635,7 +635,7 @@ class GalleryDrawer extends StatelessWidget {
trailing: Radio<bool>(
value: true,
groupValue: ComplexLayoutApp.of(context).lightTheme,
onChanged: (bool value) { _changeTheme(context, value); }
onChanged: (bool value) { _changeTheme(context, value); },
),
),
ListTile(
@ -657,7 +657,7 @@ class GalleryDrawer extends StatelessWidget {
onTap: () { ComplexLayoutApp.of(context).toggleAnimationSpeed(); },
trailing: Checkbox(
value: timeDilation != 1.0,
onChanged: (bool value) { ComplexLayoutApp.of(context).toggleAnimationSpeed(); }
onChanged: (bool value) { ComplexLayoutApp.of(context).toggleAnimationSpeed(); },
),
),
],

View File

@ -47,7 +47,7 @@ class HomePage extends StatelessWidget {
onPressed: (){
Navigator.pushNamed(context, kCubicBezierRouteName);
},
)
),
],
),
);

View File

@ -263,7 +263,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
PathDetail(bezier2Path, translate: <double>[29.45, 151.0], rotation: -1.5708),
PathDetail(bezier3Path,
translate: <double>[53.0, 200.48], rotation: -3.14159),
PathDetail(bezier4Path, translate: <double>[122.48, 77.0], rotation: -4.71239)
PathDetail(bezier4Path, translate: <double>[122.48, 77.0], rotation: -4.71239),
];
}

View File

@ -11,6 +11,6 @@ void main() {
'cull_opacity_perf',
kCullOpacityRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10)
duration: const Duration(seconds: 10),
);
}

View File

@ -236,7 +236,7 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
}
Future<void> _runFlutterAnalyze(String workingDirectory, {
List<String> options = const <String>[]
List<String> options = const <String>[],
}) {
return runCommand(flutter, <String>['analyze', '--dartdocs']..addAll(options),
workingDirectory: workingDirectory,

View File

@ -58,7 +58,7 @@ Future<void> runCommand(String executable, List<String> arguments, {
if (printOutput) {
await Future.wait<void>(<Future<void>>[
stdout.addStream(process.stdout),
stderr.addStream(process.stderr)
stderr.addStream(process.stderr),
]);
} else {
savedStdout = process.stdout.toList();

View File

@ -309,7 +309,7 @@ Future<void> _runCoverage() async {
Future<void> _pubRunTest(
String workingDirectory, {
String testPath,
bool enableFlutterToolAsserts = false
bool enableFlutterToolAsserts = false,
}) {
final List<String> args = <String>['run', 'test', '-rcompact', '-j1'];
if (!hasColor)

View File

@ -103,7 +103,7 @@ class FakeProcessManager extends Mock implements ProcessManager {
when(runSync(
any,
environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory')
workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer(_nextResultSync);
when(runSync(any)).thenAnswer(_nextResultSync);

View File

@ -27,10 +27,10 @@ void main() {
test('start works', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', '')
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', '')
ProcessResult(0, 0, 'output2', ''),
],
};
processManager.fakeResults = calls;
@ -49,10 +49,10 @@ void main() {
test('run works', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', '')
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', '')
ProcessResult(0, 0, 'output2', ''),
],
};
processManager.fakeResults = calls;
@ -66,10 +66,10 @@ void main() {
test('runSync works', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', '')
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', '')
ProcessResult(0, 0, 'output2', ''),
],
};
processManager.fakeResults = calls;
@ -83,10 +83,10 @@ void main() {
test('captures stdin', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', '')
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', '')
ProcessResult(0, 0, 'output2', ''),
],
};
processManager.fakeResults = calls;

View File

@ -41,7 +41,7 @@ Future<TaskResult> createFlutterRunTask() async {
startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
<String>['run']..addAll(options),
environment: null
environment: null,
);
final Completer<void> finished = Completer<void>();
final StreamSubscription<void> subscription = device.logcat.listen((String line) {

View File

@ -276,7 +276,7 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task,
'./gradlew',
args,
workingDirectory: workingDirectory,
environment: <String, String>{ 'JAVA_HOME': javaHome }
environment: <String, String>{ 'JAVA_HOME': javaHome },
);
}

View File

@ -26,7 +26,7 @@ Future<void> main() async {
'--org',
'io.flutter.devicelab',
'--template=module',
'hello'
'hello',
],
);
});

View File

@ -100,7 +100,7 @@ void main() {
final Map<String, dynamic> req = <String, dynamic>{
'id': requestId,
'method': method,
'params': params
'params': params,
};
final String jsonEncoded = json.encode(<Map<String, dynamic>>[req]);
print('run:stdin: $jsonEncoded');

View File

@ -40,7 +40,7 @@ Future<void> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
final List<File> xcconfigFiles = <File>[
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')),
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Debug.xcconfig')),
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Release.xcconfig'))
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Release.xcconfig')),
];
bool xcconfigFileExists = false;

View File

@ -23,7 +23,7 @@ TaskFunction createHotModeTest() {
final File benchmarkFile = file(path.join(_editedFlutterGalleryDir.path, 'hot_benchmark.json'));
rm(benchmarkFile);
final List<String> options = <String>[
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident'
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident',
];
setLocalEngineOptionIfNecessary(options);
int hotReloadCount = 0;
@ -40,7 +40,7 @@ TaskFunction createHotModeTest() {
final Process process = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
<String>['run']..addAll(options),
environment: null
environment: null,
);
final Completer<void> stdoutDone = Completer<void>();
@ -53,11 +53,11 @@ TaskFunction createHotModeTest() {
if (hotReloadCount == 0) {
// Update the file and reload again.
final File appDartSource = file(path.join(
_editedFlutterGalleryDir.path, 'lib/gallery/app.dart'
_editedFlutterGalleryDir.path, 'lib/gallery/app.dart',
));
appDartSource.writeAsStringSync(
appDartSource.readAsStringSync().replaceFirst(
"'Flutter Gallery'", "'Updated Flutter Gallery'"
"'Flutter Gallery'", "'Updated Flutter Gallery'",
)
);
process.stdin.writeln('r');
@ -94,7 +94,7 @@ TaskFunction createHotModeTest() {
final Process process = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
<String>['run']..addAll(options),
environment: null
environment: null,
);
final Completer<void> stdoutDone = Completer<void>();
final Completer<void> stderrDone = Completer<void>();
@ -156,7 +156,7 @@ TaskFunction createHotModeTest() {
'hotReloadFlutterReassembleMillisecondsAfterChange',
'hotReloadVMReloadMillisecondsAfterChange',
'hotReloadInitialDevFSSyncAfterRelaunchMilliseconds',
]
],
);
};
}

View File

@ -29,7 +29,7 @@ TaskFunction createFlavorsTest() {
return DriverTest(
'${flutterDirectory.path}/dev/integration_tests/flavors',
'lib/main.dart',
extraOptions: <String>['--flavor', 'paid']
extraOptions: <String>['--flavor', 'paid'],
);
}
@ -66,7 +66,7 @@ TaskFunction createCodegenerationIntegrationTest() {
'${flutterDirectory.path}/dev/integration_tests/codegen',
'lib/main.dart',
environment: <String, String>{
'FLUTTER_EXPERIMENTAL_BUILD': 'true'
'FLUTTER_EXPERIMENTAL_BUILD': 'true',
},
);
}

View File

@ -65,7 +65,7 @@ class FlutterProject {
await inDirectory(directory, () async {
await flutter(
'create',
options: <String>['--template=app', '--org', 'io.flutter.devicelab']..addAll(options)..add('plugintest')
options: <String>['--template=app', '--org', 'io.flutter.devicelab']..addAll(options)..add('plugintest'),
);
});
return FlutterProject(directory, 'plugintest');

View File

@ -80,7 +80,7 @@ tasks:
tasks:
- a
- b
'''
''',
);
testManifestError(
@ -89,7 +89,7 @@ tasks:
'''
tasks:
1: 2
'''
''',
);
testManifestError(
@ -98,7 +98,7 @@ tasks:
'''
tasks:
foo: 2
'''
''',
);
testManifestError(
@ -108,7 +108,7 @@ tasks:
tasks:
foo:
bar: 2
'''
''',
);
testManifestError(
@ -118,7 +118,7 @@ tasks:
tasks:
foo:
required_agent_capabilities: 1
'''
''',
);
testManifestError(
@ -128,7 +128,7 @@ tasks:
tasks:
foo:
required_agent_capabilities: [1]
'''
''',
);
testManifestError(
@ -138,7 +138,7 @@ tasks:
tasks:
foo:
required_agent_capabilities: ["a"]
'''
''',
);
testManifestError(
@ -149,7 +149,7 @@ tasks:
foo:
description: b
required_agent_capabilities: ["a"]
'''
''',
);
testManifestError(
@ -161,7 +161,7 @@ tasks:
description: b
stage: c
required_agent_capabilities: []
'''
''',
);
testManifestError(
@ -174,7 +174,7 @@ tasks:
stage: c
required_agent_capabilities: ["a"]
flaky: not-a-boolean
'''
''',
);
test('accepts boolean flaky option', () {

View File

@ -109,9 +109,9 @@ class PlatformViewState extends State<PlatformViewPage> {
key: const ValueKey<String>('play'),
child: const Text('PLAY FILE'),
onPressed: () { playEventsFile(); },
)
),
],
)
),
],
);
}

View File

@ -10,7 +10,7 @@ const List<int> kPointerActions = <int>[
0, // DOWN
1, // UP
5, // POINTER_DOWN
6 // POINTER_UP
6, // POINTER_UP
];
const double kDoubleErrorMargin = 0.0001;
@ -152,7 +152,7 @@ String getActionName(int actionMasked, int action) {
'HOVER_ENTER',
'HOVER_EXIT',
'BUTTON_PRESS',
'BUTTON_RELEASE'
'BUTTON_RELEASE',
];
if (actionMasked < actionNames.length)
return '${actionNames[actionMasked]}($action)';

View File

@ -31,7 +31,7 @@ class _TestAppState extends State<TestApp> {
0.0,
'hello',
<dynamic>[
<String, dynamic>{'key': 42}
<String, dynamic>{'key': 42},
],
];
static final Map<String, dynamic> aMap = <String, dynamic>{
@ -40,7 +40,7 @@ class _TestAppState extends State<TestApp> {
'c': 0.0,
'd': 'hello',
'e': <dynamic>[
<String, dynamic>{'key': 42}
<String, dynamic>{'key': 42},
],
};
static final Uint8List someUint8s = Uint8List.fromList(<int>[

View File

@ -56,14 +56,14 @@ class CardCollectionState extends State<CardCollection> {
(int i) {
_cardModels[i].height = _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i];
return _cardModels[i];
}
},
);
}
void _initVariableSizedCardModels() {
_cardModels = List<CardModel>.generate(
_cardHeights.length,
(int i) => CardModel(i, _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i])
(int i) => CardModel(i, _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i]),
);
}
@ -234,7 +234,7 @@ class CardCollectionState extends State<CardCollection> {
Widget _buildAppBar(BuildContext context) {
return AppBar(
actions: <Widget>[
Text(_dismissDirectionText(_dismissDirection))
Text(_dismissDirectionText(_dismissDirection)),
],
flexibleSpace: Container(
padding: const EdgeInsets.only(left: 72.0),

View File

@ -32,11 +32,11 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
color: data.isEmpty ? _color : Colors.grey.shade200,
border: Border.all(
width: 3.0,
color: data.isEmpty ? Colors.white : Colors.blue
color: data.isEmpty ? Colors.white : Colors.blue,
),
)
),
);
}
},
);
}
}
@ -65,10 +65,10 @@ class DotState extends State<Dot> {
decoration: BoxDecoration(
color: widget.color,
border: Border.all(width: taps.toDouble()),
shape: BoxShape.circle
shape: BoxShape.circle,
),
child: widget.child
)
child: widget.child,
),
);
}
}
@ -79,7 +79,7 @@ class ExampleDragSource extends StatelessWidget {
this.color,
this.heavy = false,
this.under = true,
this.child
this.child,
}) : super(key: key);
final Color color;
@ -103,13 +103,13 @@ class ExampleDragSource extends StatelessWidget {
child: Dot(
color: color,
size: size,
child: Center(child: child)
)
child: Center(child: child),
),
);
Widget feedback = Opacity(
opacity: 0.75,
child: contents
child: contents,
);
Offset feedbackOffset;
@ -118,7 +118,7 @@ class ExampleDragSource extends StatelessWidget {
feedback = Transform(
transform: Matrix4.identity()
..translate(-size / 2.0, -(size / 2.0 + kFingerSize)),
child: feedback
child: feedback,
);
feedbackOffset = const Offset(0.0, -kFingerSize);
anchor = DragAnchor.pointer;
@ -133,7 +133,7 @@ class ExampleDragSource extends StatelessWidget {
child: contents,
feedback: feedback,
feedbackOffset: feedbackOffset,
dragAnchor: anchor
dragAnchor: anchor,
);
} else {
return Draggable<Color>(
@ -141,7 +141,7 @@ class ExampleDragSource extends StatelessWidget {
child: contents,
feedback: feedback,
feedbackOffset: feedbackOffset,
dragAnchor: anchor
dragAnchor: anchor,
);
}
}
@ -193,15 +193,15 @@ class MovableBall extends StatelessWidget {
color: Colors.blue.shade700,
size: kBallSize,
tappable: true,
child: const Center(child: Text('BALL'))
)
child: const Center(child: Text('BALL')),
),
);
final Widget dashedBall = Container(
width: kBallSize,
height: kBallSize,
child: const CustomPaint(
painter: DashOutlineCirclePainter()
)
),
);
if (position == ballPosition) {
return Draggable<bool>(
@ -209,14 +209,14 @@ class MovableBall extends StatelessWidget {
child: ball,
childWhenDragging: dashedBall,
feedback: ball,
maxSimultaneousDrags: 1
maxSimultaneousDrags: 1,
);
} else {
return DragTarget<bool>(
onAccept: (bool data) { callback(position); },
builder: (BuildContext context, List<bool> accepted, List<dynamic> rejected) {
return dashedBall;
}
},
);
}
}
@ -238,7 +238,7 @@ class DragAndDropAppState extends State<DragAndDropApp> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Drag and Drop Flutter Demo')
title: const Text('Drag and Drop Flutter Demo'),
),
body: Column(
children: <Widget>[
@ -251,22 +251,22 @@ class DragAndDropAppState extends State<DragAndDropApp> {
color: Colors.yellow.shade300,
under: true,
heavy: false,
child: const Text('under')
child: const Text('under'),
),
ExampleDragSource(
color: Colors.green.shade300,
under: false,
heavy: true,
child: const Text('long-press above')
child: const Text('long-press above'),
),
ExampleDragSource(
color: Colors.indigo.shade300,
under: false,
heavy: false,
child: const Text('above')
child: const Text('above'),
),
],
)
),
),
Expanded(
child: Row(
@ -275,8 +275,8 @@ class DragAndDropAppState extends State<DragAndDropApp> {
Expanded(child: ExampleDragTarget()),
Expanded(child: ExampleDragTarget()),
Expanded(child: ExampleDragTarget()),
]
)
],
),
),
Expanded(
child: Row(
@ -286,10 +286,10 @@ class DragAndDropAppState extends State<DragAndDropApp> {
MovableBall(2, position, moveBall),
MovableBall(3, position, moveBall),
],
)
),
),
]
)
],
),
);
}
}
@ -297,6 +297,6 @@ class DragAndDropAppState extends State<DragAndDropApp> {
void main() {
runApp(MaterialApp(
title: 'Drag and Drop Flutter Demo',
home: DragAndDropApp()
home: DragAndDropApp(),
));
}

View File

@ -48,7 +48,7 @@ class _IgnoreDrag extends Drag {
class _PointDemoPainter extends CustomPainter {
_PointDemoPainter({
Animation<double> repaint,
this.arc
this.arc,
}) : _repaint = repaint, super(repaint: repaint);
final MaterialPointArcTween arc;
@ -202,7 +202,7 @@ class _PointDemoState extends State<_PointDemo> {
key: _painterKey,
foregroundPainter: _PointDemoPainter(
repaint: _animation,
arc: arc
arc: arc,
),
// Watch out: if this IgnorePointer is left out, then gestures that
// fail _PointDemoPainter.hitTest() will still be recognized because
@ -213,12 +213,12 @@ class _PointDemoState extends State<_PointDemo> {
child: Text(
'Tap the refresh button to run the animation. Drag the green '
"and red points to change the animation's path.",
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0)
)
)
)
)
)
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0),
),
),
),
),
),
);
}
}
@ -226,7 +226,7 @@ class _PointDemoState extends State<_PointDemo> {
class _RectangleDemoPainter extends CustomPainter {
_RectangleDemoPainter({
Animation<double> repaint,
this.arc
this.arc,
}) : _repaint = repaint, super(repaint: repaint);
final MaterialRectArcTween arc;
@ -350,11 +350,11 @@ class _RectangleDemoState extends State<_RectangleDemo> {
_screenSize = screenSize;
_begin = Rect.fromLTWH(
screenSize.width * 0.5, screenSize.height * 0.2,
screenSize.width * 0.4, screenSize.height * 0.2
screenSize.width * 0.4, screenSize.height * 0.2,
);
_end = Rect.fromLTWH(
screenSize.width * 0.1, screenSize.height * 0.4,
screenSize.width * 0.3, screenSize.height * 0.3
screenSize.width * 0.3, screenSize.height * 0.3,
);
}
@ -375,7 +375,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
key: _painterKey,
foregroundPainter: _RectangleDemoPainter(
repaint: _animation,
arc: arc
arc: arc,
),
// Watch out: if this IgnorePointer is left out, then gestures that
// fail _RectDemoPainter.hitTest() will still be recognized because
@ -386,12 +386,12 @@ class _RectangleDemoState extends State<_RectangleDemo> {
child: Text(
'Tap the refresh button to run the animation. Drag the rectangles '
"to change the animation's path.",
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0)
)
)
)
)
)
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0),
),
),
),
),
),
);
}
}
@ -426,13 +426,13 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
_ArcDemo('POINT', (_ArcDemo demo) {
return _PointDemo(
key: demo.key,
controller: demo.controller
controller: demo.controller,
);
}, this),
_ArcDemo('RECTANGLE', (_ArcDemo demo) {
return _RectangleDemo(
key: demo.key,
controller: demo.controller
controller: demo.controller,
);
}, this),
];
@ -466,9 +466,9 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
},
),
body: TabBarView(
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList()
)
)
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList(),
),
),
);
}
}

View File

@ -515,7 +515,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
debugPrint(_textSpan.toStringDeep());
}
});
}
},
),
),
],
@ -573,7 +573,7 @@ class _UnderlinesState extends State<Underlines> {
),
child: ListBody(
children: lines,
)
),
),
),
),
@ -668,7 +668,7 @@ class _FallbackState extends State<Fallback> {
child: ListBody(
children: lines,
),
)
),
),
),
),

View File

@ -39,7 +39,7 @@ void main(List<String> argList) {
'application template.',
getEnumName(SnippetType.sample):
'Produce a nicely formatted piece of sample code. Does not embed the '
'sample into an application template.'
'sample into an application template.',
},
help: 'The type of snippet to produce.',
);

View File

@ -222,7 +222,7 @@ List<SvgPath> _interpretSvgGroup(List<XmlNode> children, _Transform transform) {
final _Transform subtreeTransform = _Transform(
transformMatrix: transformMatrix,
opacity: opacity
opacity: opacity,
);
paths.addAll(_interpretSvgGroup(element.children, subtreeTransform));
}
@ -252,7 +252,7 @@ List<Point<double>> parsePoints(String points) {
final Match m = _pointMatcher.firstMatch(unParsed);
result.add(Point<double>(
double.parse(m.group(1)),
double.parse(m.group(2))
double.parse(m.group(2)),
));
unParsed = m.group(3);
}

View File

@ -157,7 +157,7 @@ class CardItem extends StatelessWidget {
@required this.animation,
this.onTap,
@required this.item,
this.selected = false
this.selected = false,
}) : assert(animation != null),
assert(item != null && item >= 0),
assert(selected != null),

View File

@ -58,7 +58,7 @@ class AdjustableDropdownListTile extends StatelessWidget {
}).toList(),
),
),
)
),
);
}
@ -91,7 +91,7 @@ class AdjustableDropdownExampleState extends State<AdjustableDropdownExample> {
'5 seconds',
'15 seconds',
'30 seconds',
'1 minute'
'1 minute',
];
String timeout;

View File

@ -509,7 +509,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
setState(() {
_maybeScroll(midScrollOffset, index, xOffset);
});
}
},
),
));
}
@ -614,7 +614,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
tooltip: 'Back',
onPressed: () {
_handleBackButton(appBarMidScrollOffset);
}
},
),
),
),

View File

@ -116,7 +116,7 @@ class _CalculatorState extends State<Calculator> {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).canvasColor,
elevation: 0.0
elevation: 0.0,
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@ -124,15 +124,15 @@ class _CalculatorState extends State<Calculator> {
// Give the key-pad 3/5 of the vertical space and the display 2/5.
Expanded(
flex: 2,
child: CalcDisplay(content: _expression.toString())
child: CalcDisplay(content: _expression.toString()),
),
const Divider(height: 1.0),
Expanded(
flex: 3,
child: KeyPad(calcState: this)
)
]
)
child: KeyPad(calcState: this),
),
],
),
);
}
}
@ -147,8 +147,8 @@ class CalcDisplay extends StatelessWidget {
return Center(
child: Text(
content,
style: const TextStyle(fontSize: 24.0)
)
style: const TextStyle(fontSize: 24.0),
),
);
}
}
@ -180,25 +180,25 @@ class KeyPad extends StatelessWidget {
KeyRow(<Widget>[
NumberKey(7, calcState),
NumberKey(8, calcState),
NumberKey(9, calcState)
NumberKey(9, calcState),
]),
KeyRow(<Widget>[
NumberKey(4, calcState),
NumberKey(5, calcState),
NumberKey(6, calcState)
NumberKey(6, calcState),
]),
KeyRow(<Widget>[
NumberKey(1, calcState),
NumberKey(2, calcState),
NumberKey(3, calcState)
NumberKey(3, calcState),
]),
KeyRow(<Widget>[
CalcKey('.', calcState.handlePointTap),
NumberKey(0, calcState),
CalcKey('=', calcState.handleEqualsTap),
])
]
)
]),
],
),
),
Expanded(
child: Material(
@ -209,14 +209,14 @@ class KeyPad extends StatelessWidget {
CalcKey('\u00F7', calcState.handleDivTap),
CalcKey('\u00D7', calcState.handleMultTap),
CalcKey('-', calcState.handleMinusTap),
CalcKey('+', calcState.handlePlusTap)
]
)
)
CalcKey('+', calcState.handlePlusTap),
],
),
),
),
]
)
)
],
),
),
);
}
}
@ -231,8 +231,8 @@ class KeyRow extends StatelessWidget {
return Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: keys
)
children: keys,
),
);
}
}
@ -254,10 +254,10 @@ class CalcKey extends StatelessWidget {
text,
style: TextStyle(
fontSize: (orientation == Orientation.portrait) ? 32.0 : 24.0
)
)
)
)
),
),
),
),
);
}
}

View File

@ -30,9 +30,9 @@ class _ContactCategory extends StatelessWidget {
Container(
padding: const EdgeInsets.symmetric(vertical: 24.0),
width: 72.0,
child: Icon(icon, color: themeData.primaryColor)
child: Icon(icon, color: themeData.primaryColor),
),
Expanded(child: Column(children: children))
Expanded(child: Column(children: children)),
],
),
),
@ -61,9 +61,9 @@ class _ContactItem extends StatelessWidget {
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: columnChildren
)
)
children: columnChildren,
),
),
];
if (icon != null) {
rowChildren.add(SizedBox(
@ -71,8 +71,8 @@ class _ContactItem extends StatelessWidget {
child: IconButton(
icon: Icon(icon),
color: themeData.primaryColor,
onPressed: onPressed
)
onPressed: onPressed,
),
));
}
return MergeSemantics(
@ -80,8 +80,8 @@ class _ContactItem extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: rowChildren
)
children: rowChildren,
),
),
);
}
@ -125,7 +125,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Edit',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text("Editing isn't supported in this screen.")
content: Text("Editing isn't supported in this screen."),
));
},
),
@ -138,19 +138,19 @@ class ContactsDemoState extends State<ContactsDemo> {
itemBuilder: (BuildContext context) => <PopupMenuItem<AppBarBehavior>>[
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.normal,
child: Text('App bar scrolls away')
child: Text('App bar scrolls away'),
),
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.pinned,
child: Text('App bar stays put')
child: Text('App bar stays put'),
),
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.floating,
child: Text('App bar floats')
child: Text('App bar floats'),
),
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.snapping,
child: Text('App bar snaps')
child: Text('App bar snaps'),
),
],
),
@ -193,7 +193,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('Pretend that this opened your SMS application.')
content: Text('Pretend that this opened your SMS application.'),
));
},
lines: const <String>[
@ -206,7 +206,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('A messaging app appears.')
content: Text('A messaging app appears.'),
));
},
lines: const <String>[
@ -219,7 +219,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('Imagine if you will, a messaging application.')
content: Text('Imagine if you will, a messaging application.'),
));
},
lines: const <String>[
@ -238,7 +238,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Send personal e-mail',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('Here, your e-mail application would open.')
content: Text('Here, your e-mail application would open.'),
));
},
lines: const <String>[
@ -251,7 +251,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Send work e-mail',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('Summon your favorite e-mail application here.')
content: Text('Summon your favorite e-mail application here.'),
));
},
lines: const <String>[
@ -269,7 +269,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Open map',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('This would show a map of San Francisco.')
content: Text('This would show a map of San Francisco.'),
));
},
lines: const <String>[
@ -283,7 +283,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Open map',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('This would show a map of Mountain View.')
content: Text('This would show a map of Mountain View.'),
));
},
lines: const <String>[
@ -297,7 +297,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Open map',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text('This would also show a map, if this was not a demo.')
content: Text('This would also show a map, if this was not a demo.'),
));
},
lines: const <String>[

View File

@ -178,7 +178,7 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
onPressed: () {
Navigator.pop(context, 'Cancel');
},
)
),
),
);
},

View File

@ -56,7 +56,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
child: const Text('Cupertino Button'),
onPressed: () {
setState(() { _pressedCount += 1; });
}
},
),
const CupertinoButton(
child: Text('Disabled'),
@ -70,7 +70,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
child: const Text('With Background'),
onPressed: () {
setState(() { _pressedCount += 1; });
}
},
),
const Padding(padding: EdgeInsets.all(12.0)),
const CupertinoButton.filled(
@ -83,7 +83,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
],
),
),
)
),
);
}
}

View File

@ -78,7 +78,7 @@ class CupertinoNavigationDemo extends StatelessWidget {
builder: (BuildContext context) {
return CupertinoDemoTab1(
colorItems: colorItems,
colorNameItems: colorNameItems
colorNameItems: colorNameItems,
);
},
defaultTitle: 'Colors',
@ -750,7 +750,7 @@ class CupertinoDemoTab3 extends StatelessWidget {
Text(
'Sign in',
style: TextStyle(color: CupertinoTheme.of(context).primaryColor),
)
),
],
),
),

View File

@ -32,7 +32,7 @@ class _CupertinoRefreshControlDemoState extends State<CupertinoRefreshControlDem
return contacts[random.nextInt(contacts.length)]
// Randomly adds a telephone icon next to the contact or not.
..add(random.nextBool().toString());
}
},
);
}

View File

@ -46,10 +46,10 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
setState(() {
_value = value;
});
}
},
),
Text('Cupertino Continuous: ${_value.toStringAsFixed(1)}'),
]
],
),
Column(
mainAxisSize: MainAxisSize.min,
@ -63,10 +63,10 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
setState(() {
_discreteValue = value;
});
}
},
),
Text('Cupertino Discrete: $_discreteValue'),
]
],
),
],
),

View File

@ -116,7 +116,7 @@ class FruitPage extends StatelessWidget {
Text(
' ¬ ',
// TODO(larche): Replace textTheme.display3.color with a ColorScheme value when known.
style: textTheme.overline.apply(color: textTheme.display3.color)
style: textTheme.overline.apply(color: textTheme.display3.color),
),
Text(
'CULTURE',
@ -160,7 +160,7 @@ class FruitPage extends StatelessWidget {
fontWeight: FontWeight.w500,
color: Colors.black,
),
)
),
],
),
),
@ -170,7 +170,7 @@ class FruitPage extends StatelessWidget {
),
],
),
)
),
],
),
),

View File

@ -34,7 +34,7 @@ class ImagesDemo extends StatelessWidget {
),
),
),
]
],
);
}
}

View File

@ -256,7 +256,7 @@ class _RadioItem<T> extends StatelessWidget {
),
),
),
]
],
),
),
);
@ -333,7 +333,7 @@ class _DemoBottomAppBar extends StatelessWidget {
const _DemoBottomAppBar({
this.color,
this.fabLocation,
this.shape
this.shape,
});
final Color color;

View File

@ -96,7 +96,7 @@ class CustomInactiveIcon extends StatelessWidget {
height: iconTheme.size - 8.0,
decoration: BoxDecoration(
border: Border.all(color: iconTheme.color, width: 2.0),
)
),
);
}
}
@ -150,7 +150,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
title: 'Event',
color: Colors.pink,
vsync: this,
)
),
];
_navigationViews[_currentIndex].controller.value = 1.0;
@ -218,13 +218,13 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
const PopupMenuItem<BottomNavigationBarType>(
value: BottomNavigationBarType.shifting,
child: Text('Shifting'),
)
),
],
)
),
],
),
body: Center(
child: _buildTransitionsStack()
child: _buildTransitionsStack(),
),
bottomNavigationBar: botNavBar,
);

View File

@ -323,7 +323,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
},
items: <String>[
'One', 'Two', 'Free', 'Four', 'Can', 'I', 'Have', 'A', 'Little',
'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'
'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten',
]
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
@ -363,7 +363,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
semanticLabel: 'Thumbs not up',
),
onPressed: null,
)
),
]
.map<Widget>((Widget button) => SizedBox(width: 64.0, height: 64.0, child: button))
.toList(),

View File

@ -66,7 +66,7 @@ const List<TravelDestination> destinations = <TravelDestination>[
city: 'Thanjavur',
location: 'Thanjavur, Tamil Nadu',
type: CardDemoType.selectable,
)
),
];
class TravelDestinationItem extends StatelessWidget {
@ -215,7 +215,7 @@ class _SelectableTravelDestinationItemState extends State<SelectableTravelDestin
Icons.check_circle,
color: _isSelected ? colorScheme.primary : Colors.transparent,
),
)
),
),
],
),
@ -232,7 +232,7 @@ class _SelectableTravelDestinationItemState extends State<SelectableTravelDestin
class SectionTitle extends StatelessWidget {
const SectionTitle({
Key key,
this.title
this.title,
}) : super(key: key);
final String title;
@ -277,7 +277,7 @@ class TravelDestinationContent extends StatelessWidget {
image: AssetImage(destination.assetName, package: destination.assetPackage),
fit: BoxFit.cover,
child: Container(),
)
),
),
Positioned(
bottom: 16.0,
@ -408,8 +408,8 @@ class _CardsDemoState extends State<CardsDemo> {
margin: const EdgeInsets.only(bottom: 8.0),
child: child,
);
}).toList()
)
}).toList(),
),
);
}
}

View File

@ -117,7 +117,7 @@ class _ChipsTile extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: cardChildren,
)
),
);
}
}
@ -313,7 +313,7 @@ class _ChipDemoState extends State<ChipDemo> {
});
},
icon: const Icon(Icons.vignette, semanticLabel: 'Update border shape'),
)
),
],
),
body: ChipTheme(

View File

@ -121,7 +121,7 @@ class DessertDataSource extends DataTableSource {
DataCell(Text('${dessert.sodium}')),
DataCell(Text('${dessert.calcium}%')),
DataCell(Text('${dessert.iron}%')),
]
],
);
}
@ -185,50 +185,50 @@ class _DataTableDemoState extends State<DataTableDemo> {
columns: <DataColumn>[
DataColumn(
label: const Text('Dessert (100g serving)'),
onSort: (int columnIndex, bool ascending) => _sort<String>((Dessert d) => d.name, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<String>((Dessert d) => d.name, columnIndex, ascending),
),
DataColumn(
label: const Text('Calories'),
tooltip: 'The total amount of food energy in the given serving size.',
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calories, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calories, columnIndex, ascending),
),
DataColumn(
label: const Text('Fat (g)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.fat, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.fat, columnIndex, ascending),
),
DataColumn(
label: const Text('Carbs (g)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.carbs, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.carbs, columnIndex, ascending),
),
DataColumn(
label: const Text('Protein (g)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.protein, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.protein, columnIndex, ascending),
),
DataColumn(
label: const Text('Sodium (mg)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.sodium, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.sodium, columnIndex, ascending),
),
DataColumn(
label: const Text('Calcium (%)'),
tooltip: 'The amount of calcium as a percentage of the recommended daily amount.',
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calcium, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calcium, columnIndex, ascending),
),
DataColumn(
label: const Text('Iron (%)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.iron, columnIndex, ascending)
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.iron, columnIndex, ascending),
),
],
source: _dessertsDataSource
)
]
)
source: _dessertsDataSource,
),
],
),
);
}
}

View File

@ -39,7 +39,7 @@ class _InputDropdown extends StatelessWidget {
children: <Widget>[
Text(valueText, style: valueStyle),
Icon(Icons.arrow_drop_down,
color: Theme.of(context).brightness == Brightness.light ? Colors.grey.shade700 : Colors.white70
color: Theme.of(context).brightness == Brightness.light ? Colors.grey.shade700 : Colors.white70,
),
],
),
@ -55,7 +55,7 @@ class _DateTimePicker extends StatelessWidget {
this.selectedDate,
this.selectedTime,
this.selectDate,
this.selectTime
this.selectTime,
}) : super(key: key);
final String labelText;
@ -69,7 +69,7 @@ class _DateTimePicker extends StatelessWidget {
context: context,
initialDate: selectedDate,
firstDate: DateTime(2015, 8),
lastDate: DateTime(2101)
lastDate: DateTime(2101),
);
if (picked != null && picked != selectedDate)
selectDate(picked);
@ -78,7 +78,7 @@ class _DateTimePicker extends StatelessWidget {
Future<void> _selectTime(BuildContext context) async {
final TimeOfDay picked = await showTimePicker(
context: context,
initialTime: selectedTime
initialTime: selectedTime,
);
if (picked != null && picked != selectedTime)
selectTime(picked);

View File

@ -74,7 +74,7 @@ class DialogDemoState extends State<DialogDemo> {
.then<void>((T value) { // The value passed to Navigator.pop() or null.
if (value != null) {
_scaffoldKey.currentState.showSnackBar(SnackBar(
content: Text('You selected: $value')
content: Text('You selected: $value'),
));
}
});
@ -102,21 +102,21 @@ class DialogDemoState extends State<DialogDemo> {
child: AlertDialog(
content: Text(
_alertWithoutTitleText,
style: dialogTextStyle
style: dialogTextStyle,
),
actions: <Widget>[
FlatButton(
child: const Text('CANCEL'),
onPressed: () { Navigator.pop(context, DialogDemoAction.cancel); }
onPressed: () { Navigator.pop(context, DialogDemoAction.cancel); },
),
FlatButton(
child: const Text('DISCARD'),
onPressed: () { Navigator.pop(context, DialogDemoAction.discard); }
)
]
)
onPressed: () { Navigator.pop(context, DialogDemoAction.discard); },
),
],
),
);
}
},
),
RaisedButton(
child: const Text('ALERT WITH TITLE'),
@ -127,21 +127,21 @@ class DialogDemoState extends State<DialogDemo> {
title: const Text('Use Google\'s location service?'),
content: Text(
_alertWithTitleText,
style: dialogTextStyle
style: dialogTextStyle,
),
actions: <Widget>[
FlatButton(
child: const Text('DISAGREE'),
onPressed: () { Navigator.pop(context, DialogDemoAction.disagree); }
onPressed: () { Navigator.pop(context, DialogDemoAction.disagree); },
),
FlatButton(
child: const Text('AGREE'),
onPressed: () { Navigator.pop(context, DialogDemoAction.agree); }
)
]
)
onPressed: () { Navigator.pop(context, DialogDemoAction.agree); },
),
],
),
);
}
},
),
RaisedButton(
child: const Text('SIMPLE'),
@ -155,40 +155,40 @@ class DialogDemoState extends State<DialogDemo> {
icon: Icons.account_circle,
color: theme.primaryColor,
text: 'username@gmail.com',
onPressed: () { Navigator.pop(context, 'username@gmail.com'); }
onPressed: () { Navigator.pop(context, 'username@gmail.com'); },
),
DialogDemoItem(
icon: Icons.account_circle,
color: theme.primaryColor,
text: 'user02@gmail.com',
onPressed: () { Navigator.pop(context, 'user02@gmail.com'); }
onPressed: () { Navigator.pop(context, 'user02@gmail.com'); },
),
DialogDemoItem(
icon: Icons.add_circle,
text: 'add account',
color: theme.disabledColor
)
]
)
color: theme.disabledColor,
),
],
),
);
}
},
),
RaisedButton(
child: const Text('CONFIRMATION'),
onPressed: () {
showTimePicker(
context: context,
initialTime: _selectedTime
initialTime: _selectedTime,
)
.then<void>((TimeOfDay value) {
if (value != null && value != _selectedTime) {
_selectedTime = value;
_scaffoldKey.currentState.showSnackBar(SnackBar(
content: Text('You selected: ${value.format(context)}')
content: Text('You selected: ${value.format(context)}'),
));
}
});
}
},
),
RaisedButton(
child: const Text('FULLSCREEN'),
@ -197,18 +197,18 @@ class DialogDemoState extends State<DialogDemo> {
builder: (BuildContext context) => FullScreenDialogDemo(),
fullscreenDialog: true,
));
}
},
),
]
// Add a little space between the buttons
.map<Widget>((Widget button) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: button
child: button,
);
})
.toList()
)
.toList(),
),
);
}
}

View File

@ -73,7 +73,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
void _showNotImplementedMessage() {
Navigator.pop(context); // Dismiss the drawer.
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: Text("The drawer's items don't do anything")
content: Text("The drawer's items don't do anything"),
));
}

View File

@ -54,7 +54,7 @@ class _ElevationDemoState extends State<ElevationDemo> {
onPressed: () {
setState(() => _showElevation = !_showElevation);
},
)
),
],
),
body: ListView(

View File

@ -21,7 +21,7 @@ class DualHeaderWithHint extends StatelessWidget {
this.name,
this.value,
this.hint,
this.showHint
this.showHint,
});
final String name;
@ -69,11 +69,11 @@ class DualHeaderWithHint extends StatelessWidget {
child: _crossFade(
Text(value, style: textTheme.caption.copyWith(fontSize: 15.0)),
Text(hint, style: textTheme.caption.copyWith(fontSize: 15.0)),
showHint
)
)
)
]
showHint,
),
),
),
],
);
}
}
@ -83,7 +83,7 @@ class CollapsibleBody extends StatelessWidget {
this.margin = EdgeInsets.zero,
this.child,
this.onSave,
this.onCancel
this.onCancel,
});
final EdgeInsets margin;
@ -102,14 +102,14 @@ class CollapsibleBody extends StatelessWidget {
margin: const EdgeInsets.only(
left: 24.0,
right: 24.0,
bottom: 24.0
bottom: 24.0,
) - margin,
child: Center(
child: DefaultTextStyle(
style: textTheme.caption.copyWith(fontSize: 15.0),
child: child
)
)
child: child,
),
),
),
const Divider(height: 1.0),
Container(
@ -124,22 +124,22 @@ class CollapsibleBody extends StatelessWidget {
child: const Text('CANCEL', style: TextStyle(
color: Colors.black54,
fontSize: 15.0,
fontWeight: FontWeight.w500
))
)
fontWeight: FontWeight.w500,
)),
),
),
Container(
margin: const EdgeInsets.only(right: 8.0),
child: FlatButton(
onPressed: onSave,
textTheme: ButtonTextTheme.accent,
child: const Text('SAVE')
)
)
]
)
)
]
child: const Text('SAVE'),
),
),
],
),
),
],
);
}
}
@ -150,7 +150,7 @@ class DemoItem<T> {
this.value,
this.hint,
this.builder,
this.valueToString
this.valueToString,
}) : textController = TextEditingController(text: valueToString(value));
final String name;
@ -167,7 +167,7 @@ class DemoItem<T> {
name: name,
value: valueToString(value),
hint: hint,
showHint: isExpanded
showHint: isExpanded,
);
};
}
@ -269,15 +269,15 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
groupValue: field.value,
onChanged: field.didChange,
),
]
],
);
}
},
),
);
}
)
),
);
}
},
),
DemoItem<double>(
name: 'Sun',
@ -314,10 +314,10 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
),
);
}
)
),
);
}
)
},
),
];
}
@ -346,9 +346,9 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
return ExpansionPanel(
isExpanded: item.isExpanded,
headerBuilder: item.headerBuilder,
body: item.build()
body: item.build(),
);
}).toList()
}).toList(),
),
),
),

View File

@ -27,12 +27,12 @@ class ExpansionTileListDemo extends StatelessWidget {
ListTile(title: Text('Two')),
// https://en.wikipedia.org/wiki/Free_Four
ListTile(title: Text('Free')),
ListTile(title: Text('Four'))
]
ListTile(title: Text('Four')),
],
),
const ListTile(title: Text('Bottom'))
]
)
const ListTile(title: Text('Bottom')),
],
),
);
}
}

View File

@ -47,7 +47,7 @@ class DateTimeItem extends StatelessWidget {
context: context,
initialDate: date,
firstDate: date.subtract(const Duration(days: 30)),
lastDate: date.add(const Duration(days: 30))
lastDate: date.add(const Duration(days: 30)),
)
.then<void>((DateTime value) {
if (value != null)
@ -59,10 +59,10 @@ class DateTimeItem extends StatelessWidget {
children: <Widget>[
Text(DateFormat('EEE, MMM d yyyy').format(date)),
const Icon(Icons.arrow_drop_down, color: Colors.black54),
]
)
)
)
],
),
),
),
),
Container(
margin: const EdgeInsets.only(left: 8.0),
@ -74,7 +74,7 @@ class DateTimeItem extends StatelessWidget {
onTap: () {
showTimePicker(
context: context,
initialTime: time
initialTime: time,
)
.then<void>((TimeOfDay value) {
if (value != null)
@ -85,12 +85,12 @@ class DateTimeItem extends StatelessWidget {
children: <Widget>[
Text('${time.format(context)}'),
const Icon(Icons.arrow_drop_down, color: Colors.black54),
]
)
)
)
]
)
],
),
),
),
],
),
);
}
}
@ -123,21 +123,21 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
return AlertDialog(
content: Text(
'Discard new event?',
style: dialogTextStyle
style: dialogTextStyle,
),
actions: <Widget>[
FlatButton(
child: const Text('CANCEL'),
onPressed: () {
Navigator.of(context).pop(false); // Pops the confirmation dialog but not the page.
}
},
),
FlatButton(
child: const Text('DISCARD'),
onPressed: () {
Navigator.of(context).pop(true); // Returning true to _onWillPop will pop again.
}
)
},
),
],
);
},
@ -156,9 +156,9 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
child: Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
onPressed: () {
Navigator.pop(context, DismissDialogAction.save);
}
)
]
},
),
],
),
body: Form(
onWillPop: _onWillPop,
@ -171,7 +171,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
child: TextField(
decoration: const InputDecoration(
labelText: 'Event name',
filled: true
filled: true,
),
style: theme.textTheme.headline,
onChanged: (String value) {
@ -181,8 +181,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
_eventName = value;
}
});
}
)
},
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 8.0),
@ -191,14 +191,14 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
decoration: const InputDecoration(
labelText: 'Location',
hintText: 'Where is the event?',
filled: true
filled: true,
),
onChanged: (String value) {
setState(() {
_hasLocation = value.isNotEmpty;
});
}
)
},
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -211,9 +211,9 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
_fromDateTime = value;
_saveNeeded = true;
});
}
)
]
},
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -226,10 +226,10 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
_toDateTime = value;
_saveNeeded = true;
});
}
},
),
const Text('All-day'),
]
],
),
Container(
decoration: BoxDecoration(
@ -244,22 +244,22 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
_allDayValue = value;
_saveNeeded = true;
});
}
},
),
const Text('All-day'),
]
)
)
],
),
),
]
.map<Widget>((Widget child) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 8.0),
height: 96.0,
child: child
child: child,
);
})
.toList()
)
.toList(),
),
),
);
}

View File

@ -121,7 +121,7 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
final double distance = (Offset.zero & context.size).shortestSide;
_flingAnimation = _controller.drive(Tween<Offset>(
begin: _offset,
end: _clampOffset(_offset + direction * distance)
end: _clampOffset(_offset + direction * distance),
));
_controller
..value = 0.0
@ -155,7 +155,7 @@ class GridDemoPhotoItem extends StatelessWidget {
Key key,
@required this.photo,
@required this.tileStyle,
@required this.onBannerTap
@required this.onBannerTap,
}) : assert(photo != null && photo.isValid),
assert(tileStyle != null),
assert(onBannerTap != null),
@ -170,7 +170,7 @@ class GridDemoPhotoItem extends StatelessWidget {
builder: (BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(photo.title)
title: Text(photo.title),
),
body: SizedBox.expand(
child: Hero(
@ -194,8 +194,8 @@ class GridDemoPhotoItem extends StatelessWidget {
photo.assetName,
package: photo.assetPackage,
fit: BoxFit.cover,
)
)
),
),
);
final IconData icon = photo.isFavorite ? Icons.star : Icons.star_border;
@ -382,7 +382,7 @@ class GridListDemoState extends State<GridListDemo> {
setState(() {
photo.isFavorite = !photo.isFavorite;
});
}
},
);
}).toList(),
),

View File

@ -83,7 +83,7 @@ class _IconsDemoCard extends StatelessWidget {
icon: Icon(icon),
iconSize: iconSize,
tooltip: "${enabled ? 'Enabled' : 'Disabled'} icon button",
onPressed: enabled ? handleIconButtonPress : null
onPressed: enabled ? handleIconButtonPress : null,
);
}

View File

@ -51,7 +51,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
index: index,
name: 'Item $index Sender',
subject: 'Subject: $index',
body: "[$index] first line of the message's body..."
body: "[$index] first line of the message's body...",
);
});
}
@ -96,8 +96,8 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
content: Text('You archived item ${item.index}'),
action: SnackBarAction(
label: 'UNDO',
onPressed: () { handleUndo(item); }
)
onPressed: () { handleUndo(item); },
),
));
}
@ -109,8 +109,8 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
content: Text('You deleted item ${item.index}'),
action: SnackBarAction(
label: 'UNDO',
onPressed: () { handleUndo(item); }
)
onPressed: () { handleUndo(item); },
),
));
}
@ -133,7 +133,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
onDelete: _handleDelete,
dismissDirection: _dismissDirection,
);
}).toList()
}).toList(),
);
}
@ -148,27 +148,27 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
itemBuilder: (BuildContext context) => <PopupMenuEntry<LeaveBehindDemoAction>>[
const PopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.reset,
child: Text('Reset the list')
child: Text('Reset the list'),
),
const PopupMenuDivider(),
CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.horizontalSwipe,
checked: _dismissDirection == DismissDirection.horizontal,
child: const Text('Horizontal swipe')
child: const Text('Horizontal swipe'),
),
CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.leftSwipe,
checked: _dismissDirection == DismissDirection.endToStart,
child: const Text('Only swipe left')
child: const Text('Only swipe left'),
),
CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.rightSwipe,
checked: _dismissDirection == DismissDirection.startToEnd,
child: const Text('Only swipe right')
)
]
)
]
child: const Text('Only swipe right'),
),
],
),
],
),
body: body,
);
@ -217,24 +217,24 @@ class _LeaveBehindListItem extends StatelessWidget {
background: Container(
color: theme.primaryColor,
child: const ListTile(
leading: Icon(Icons.delete, color: Colors.white, size: 36.0)
)
leading: Icon(Icons.delete, color: Colors.white, size: 36.0),
),
),
secondaryBackground: Container(
color: theme.primaryColor,
child: const ListTile(
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0)
)
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0),
),
),
child: Container(
decoration: BoxDecoration(
color: theme.canvasColor,
border: Border(bottom: BorderSide(color: theme.dividerColor))
border: Border(bottom: BorderSide(color: theme.dividerColor)),
),
child: ListTile(
title: Text(item.name),
subtitle: Text('${item.subject}\n${item.body}'),
isThreeLine: true
isThreeLine: true,
),
),
),

View File

@ -68,7 +68,7 @@ class _ListDemoState extends State<ListDemo> {
value: _showAvatars ? _MaterialListType.oneLineWithAvatar : _MaterialListType.oneLine,
groupValue: _itemType,
onChanged: changeItemType,
)
),
),
),
MergeSemantics(
@ -79,7 +79,7 @@ class _ListDemoState extends State<ListDemo> {
value: _MaterialListType.twoLine,
groupValue: _itemType,
onChanged: changeItemType,
)
),
),
),
MergeSemantics(

View File

@ -38,7 +38,7 @@ class MenuDemoState extends State<MenuDemo> {
void showInSnackBar(String value) {
_scaffoldKey.currentState.showSnackBar(SnackBar(
content: Text(value)
content: Text(value),
));
}
@ -72,15 +72,15 @@ class MenuDemoState extends State<MenuDemo> {
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
const PopupMenuItem<String>(
value: 'Toolbar menu',
child: Text('Toolbar menu')
child: Text('Toolbar menu'),
),
const PopupMenuItem<String>(
value: 'Right here',
child: Text('Right here')
child: Text('Right here'),
),
const PopupMenuItem<String>(
value: 'Hooray!',
child: Text('Hooray!')
child: Text('Hooray!'),
),
],
),
@ -100,18 +100,18 @@ class MenuDemoState extends State<MenuDemo> {
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
PopupMenuItem<String>(
value: _simpleValue1,
child: const Text('Context menu item one')
child: const Text('Context menu item one'),
),
const PopupMenuItem<String>(
enabled: false,
child: Text('A disabled menu item')
child: Text('A disabled menu item'),
),
PopupMenuItem<String>(
value: _simpleValue3,
child: const Text('Context menu item three')
child: const Text('Context menu item three'),
),
]
)
],
),
),
// Pressing the PopupMenuButton on the right of this item shows
// a menu whose items have text labels and icons and a divider
@ -126,33 +126,33 @@ class MenuDemoState extends State<MenuDemo> {
value: 'Preview',
child: ListTile(
leading: Icon(Icons.visibility),
title: Text('Preview')
)
title: Text('Preview'),
),
),
const PopupMenuItem<String>(
value: 'Share',
child: ListTile(
leading: Icon(Icons.person_add),
title: Text('Share')
)
title: Text('Share'),
),
),
const PopupMenuItem<String>(
value: 'Get Link',
child: ListTile(
leading: Icon(Icons.link),
title: Text('Get link')
)
title: Text('Get link'),
),
),
const PopupMenuDivider(),
const PopupMenuItem<String>(
value: 'Remove',
child: ListTile(
leading: Icon(Icons.delete),
title: Text('Remove')
)
)
]
)
title: Text('Remove'),
),
),
],
),
),
// This entire list item is a PopupMenuButton. Tapping anywhere shows
// a menu whose current value is highlighted and aligned over the
@ -163,22 +163,22 @@ class MenuDemoState extends State<MenuDemo> {
onSelected: showMenuSelection,
child: ListTile(
title: const Text('An item with a simple menu'),
subtitle: Text(_simpleValue)
subtitle: Text(_simpleValue),
),
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
PopupMenuItem<String>(
value: _simpleValue1,
child: Text(_simpleValue1)
child: Text(_simpleValue1),
),
PopupMenuItem<String>(
value: _simpleValue2,
child: Text(_simpleValue2)
child: Text(_simpleValue2),
),
PopupMenuItem<String>(
value: _simpleValue3,
child: Text(_simpleValue3)
)
]
child: Text(_simpleValue3),
),
],
),
// Pressing the PopupMenuButton on the right of this item shows a menu
// whose items have checked icons that reflect this app's state.
@ -191,29 +191,29 @@ class MenuDemoState extends State<MenuDemo> {
CheckedPopupMenuItem<String>(
value: _checkedValue1,
checked: isChecked(_checkedValue1),
child: Text(_checkedValue1)
child: Text(_checkedValue1),
),
CheckedPopupMenuItem<String>(
value: _checkedValue2,
enabled: false,
checked: isChecked(_checkedValue2),
child: Text(_checkedValue2)
child: Text(_checkedValue2),
),
CheckedPopupMenuItem<String>(
value: _checkedValue3,
checked: isChecked(_checkedValue3),
child: Text(_checkedValue3)
child: Text(_checkedValue3),
),
CheckedPopupMenuItem<String>(
value: _checkedValue4,
checked: isChecked(_checkedValue4),
child: Text(_checkedValue4)
)
]
)
)
]
)
child: Text(_checkedValue4),
),
],
),
),
],
),
);
}
}

View File

@ -28,15 +28,15 @@ class ModalBottomSheetDemo extends StatelessWidget {
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).accentColor,
fontSize: 24.0
)
)
)
fontSize: 24.0,
),
),
),
);
});
}
)
)
},
),
),
);
}
}

View File

@ -23,7 +23,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
static final List<String> _items = <String>[
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
];
Future<void> _handleRefresh() {
@ -36,8 +36,8 @@ class OverscrollDemoState extends State<OverscrollDemo> {
label: 'RETRY',
onPressed: () {
_refreshIndicatorKey.currentState.show();
}
)
},
),
));
});
}
@ -55,9 +55,9 @@ class OverscrollDemoState extends State<OverscrollDemo> {
tooltip: 'Refresh',
onPressed: () {
_refreshIndicatorKey.currentState.show();
}
},
),
]
],
),
body: RefreshIndicator(
key: _refreshIndicatorKey,

View File

@ -34,18 +34,18 @@ class _PageSelector extends StatelessWidget {
icon: const Icon(Icons.chevron_left),
color: color,
onPressed: () { _handleArrowButtonPress(context, -1); },
tooltip: 'Page back'
tooltip: 'Page back',
),
TabPageSelector(controller: controller),
IconButton(
icon: const Icon(Icons.chevron_right),
color: color,
onPressed: () { _handleArrowButtonPress(context, 1); },
tooltip: 'Page forward'
)
tooltip: 'Page forward',
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween
)
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
),
Expanded(
child: IconTheme(
@ -63,7 +63,7 @@ class _PageSelector extends StatelessWidget {
),
),
);
}).toList()
}).toList(),
),
),
),

View File

@ -40,10 +40,10 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
textAlign: TextAlign.center,
style: TextStyle(
color: themeData.accentColor,
fontSize: 24.0
)
)
)
fontSize: 24.0,
),
),
),
);
})
.closed.whenComplete(() {
@ -66,8 +66,8 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
onPressed: () {
Navigator.pop(context);
},
child: const Text('OK')
)
child: const Text('OK'),
),
],
);
},
@ -95,9 +95,9 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
body: Center(
child: RaisedButton(
onPressed: _showBottomSheetCallback,
child: const Text('SHOW BOTTOM SHEET')
)
)
child: const Text('SHOW BOTTOM SHEET'),
),
),
);
}
}

View File

@ -29,7 +29,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
_animation = CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
reverseCurve: Curves.fastOutSlowIn
reverseCurve: Curves.fastOutSlowIn,
)..addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.dismissed)
_controller.forward();
@ -68,7 +68,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
final List<Widget> indicators = <Widget>[
const SizedBox(
width: 200.0,
child: LinearProgressIndicator()
child: LinearProgressIndicator(),
),
const LinearProgressIndicator(),
const LinearProgressIndicator(),
@ -80,13 +80,13 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
SizedBox(
width: 20.0,
height: 20.0,
child: CircularProgressIndicator(value: _animation.value)
child: CircularProgressIndicator(value: _animation.value),
),
SizedBox(
width: 100.0,
height: 20.0,
child: Text('${(_animation.value * 100.0).toStringAsFixed(1)}%',
textAlign: TextAlign.right
textAlign: TextAlign.right,
),
),
],
@ -120,7 +120,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: AnimatedBuilder(
animation: _animation,
builder: _buildIndicators
builder: _buildIndicators,
),
),
),

View File

@ -141,15 +141,15 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
itemBuilder: (BuildContext context) => <PopupMenuItem<TabsDemoStyle>>[
const PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.iconsAndText,
child: Text('Icons and text')
child: Text('Icons and text'),
),
const PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.iconsOnly,
child: Text('Icons only')
child: Text('Icons only'),
),
const PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.textOnly,
child: Text('Text only')
child: Text('Text only'),
),
],
),
@ -193,7 +193,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
),
),
);
}).toList()
}).toList(),
),
);
}

View File

@ -91,7 +91,7 @@ class _SearchDemoState extends State<SearchDemo> {
),
),
const SizedBox(height: 64.0),
Text('Last selected integer: ${_lastIntegerSelected ?? 'NONE' }.')
Text('Last selected integer: ${_lastIntegerSelected ?? 'NONE' }.'),
],
),
),
@ -219,7 +219,7 @@ class _SearchDemoSearchDelegate extends SearchDelegate<int> {
query = '';
showSuggestions(context);
},
)
),
];
}
}

View File

@ -58,12 +58,12 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
demoWidget: buildSwitch(),
exampleCodeTag: _switchCode,
documentationUrl: 'https://docs.flutter.io/flutter/material/Switch-class.html',
)
),
];
return TabbedComponentDemoScaffold(
title: 'Selection controls',
demos: demos
demos: demos,
);
}
@ -122,10 +122,10 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
Checkbox(value: true, onChanged: null),
Checkbox(value: false, onChanged: null),
Checkbox(value: null, tristate: true, onChanged: null),
]
)
]
)
],
),
],
),
);
}
@ -141,19 +141,19 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
Radio<int>(
value: 0,
groupValue: radioValue,
onChanged: handleRadioValueChanged
onChanged: handleRadioValueChanged,
),
Radio<int>(
value: 1,
groupValue: radioValue,
onChanged: handleRadioValueChanged
onChanged: handleRadioValueChanged,
),
Radio<int>(
value: 2,
groupValue: radioValue,
onChanged: handleRadioValueChanged
)
]
onChanged: handleRadioValueChanged,
),
],
),
// Disabled radio buttons
Row(
@ -162,22 +162,22 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
Radio<int>(
value: 0,
groupValue: 0,
onChanged: null
onChanged: null,
),
Radio<int>(
value: 1,
groupValue: 0,
onChanged: null
onChanged: null,
),
Radio<int>(
value: 2,
groupValue: 0,
onChanged: null
)
]
)
]
)
onChanged: null,
),
],
),
],
),
);
}
@ -193,7 +193,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
setState(() {
switchValue = value;
});
}
},
),
// Disabled switches
const Switch.adaptive(value: true, onChanged: null),

View File

@ -50,12 +50,12 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
label: 'ACTION',
onPressed: () {
Scaffold.of(context).showSnackBar(SnackBar(
content: Text('You pressed snackbar $thisSnackBarIndex\'s action.')
content: Text('You pressed snackbar $thisSnackBarIndex\'s action.'),
));
}
},
),
));
}
},
),
),
const Text(_text3),
@ -63,10 +63,10 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
.map<Widget>((Widget child) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 12.0),
child: child
child: child,
);
})
.toList()
.toList(),
),
);
}
@ -82,7 +82,7 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
// Create an inner BuildContext so that the snackBar onPressed methods
// can refer to the Scaffold with Scaffold.of().
builder: buildBody
)
),
);
}
}

View File

@ -76,8 +76,8 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
),
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Text(_explanatoryText, style: Theme.of(context).textTheme.subhead)
)
child: Text(_explanatoryText, style: Theme.of(context).textTheme.subhead),
),
);
});
}
@ -93,12 +93,12 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
child: Text(page.label,
style: TextStyle(
color: page.labelColor,
fontSize: 32.0
fontSize: 32.0,
),
textAlign: TextAlign.center
)
)
)
textAlign: TextAlign.center,
),
),
),
);
}
);
@ -115,7 +115,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
backgroundColor: page.fabColor,
icon: page.fabIcon,
label: Text(page.label.toUpperCase()),
onPressed: _showExplanatoryText
onPressed: _showExplanatoryText,
);
}
@ -124,7 +124,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
tooltip: 'Show explanation',
backgroundColor: page.fabColor,
child: page.fabIcon,
onPressed: _showExplanatoryText
onPressed: _showExplanatoryText,
);
}
@ -153,7 +153,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
floatingActionButton: buildFloatingActionButton(_selectedPage),
body: TabBarView(
controller: _controller,
children: _allPages.map<Widget>(buildTabView).toList()
children: _allPages.map<Widget>(buildTabView).toList(),
),
);
}

View File

@ -91,7 +91,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
void showInSnackBar(String value) {
_scaffoldKey.currentState.showSnackBar(SnackBar(
content: Text(value)
content: Text(value),
));
}
@ -251,7 +251,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
labelText: 'Salary',
prefixText: '\$',
suffixText: 'USD',
suffixStyle: TextStyle(color: Colors.green)
suffixStyle: TextStyle(color: Colors.green),
),
maxLines: 1,
),
@ -288,7 +288,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
const SizedBox(height: 24.0),
Text(
'* indicates required field',
style: Theme.of(context).textTheme.caption
style: Theme.of(context).textTheme.caption,
),
const SizedBox(height: 24.0),
],
@ -305,7 +305,7 @@ class _UsNumberTextInputFormatter extends TextInputFormatter {
@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue,
TextEditingValue newValue
TextEditingValue newValue,
) {
final int newTextLength = newValue.text.length;
int selectionIndex = newValue.selection.end;

View File

@ -39,11 +39,11 @@ class TooltipDemo extends StatelessWidget {
child: Icon(
Icons.call,
size: 18.0,
color: theme.iconTheme.color
)
color: theme.iconTheme.color,
),
),
Text(' icon.', style: theme.textTheme.subhead)
]
Text(' icon.', style: theme.textTheme.subhead),
],
),
Center(
child: IconButton(
@ -53,23 +53,23 @@ class TooltipDemo extends StatelessWidget {
tooltip: 'Place a phone call',
onPressed: () {
Scaffold.of(context).showSnackBar(const SnackBar(
content: Text('That was an ordinary tap.')
content: Text('That was an ordinary tap.'),
));
}
)
)
},
),
),
]
.map<Widget>((Widget widget) {
return Padding(
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: widget
child: widget,
);
})
.toList()
.toList(),
),
);
}
)
),
);
}
}

View File

@ -129,7 +129,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
bottom: extraPadding,
),
child: Center(
child: PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0))
child: PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0)),
),
);
},
@ -143,7 +143,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
top: 8.0,
left: 8.0 + mediaPadding.left,
right: 8.0 + mediaPadding.right,
bottom: 8.0
bottom: 8.0,
);
return SliverPadding(
padding: padding,
@ -206,7 +206,7 @@ class _PestoLogoState extends State<PestoLogo> {
final TextStyle titleStyle = const PestoStyle(fontSize: kTextHeight, fontWeight: FontWeight.w900, color: Colors.white, letterSpacing: 3.0);
final RectTween _textRectTween = RectTween(
begin: Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight),
end: Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight)
end: Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight),
);
final Curve _textOpacity = const Interval(0.4, 1.0, curve: Curves.easeInOut);
final RectTween _imageRectTween = RectTween(
@ -398,7 +398,7 @@ class _RecipePageState extends State<RecipePage> {
),
),
],
)
),
),
],
),
@ -413,7 +413,7 @@ class _RecipePageState extends State<RecipePage> {
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 24.0),
child: Icon(icon, color: Colors.black54)
child: Icon(icon, color: Colors.black54),
),
Text(label, style: menuItemStyle),
],
@ -453,7 +453,7 @@ class RecipeSheet extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
child: Table(
columnWidths: const <int, TableColumnWidth>{
0: FixedColumnWidth(64.0)
0: FixedColumnWidth(64.0),
},
children: <TableRow>[
TableRow(
@ -466,12 +466,12 @@ class RecipeSheet extends StatelessWidget {
width: 32.0,
height: 32.0,
alignment: Alignment.centerLeft,
fit: BoxFit.scaleDown
)
fit: BoxFit.scaleDown,
),
),
TableCell(
verticalAlignment: TableCellVerticalAlignment.middle,
child: Text(recipe.name, style: titleStyle)
child: Text(recipe.name, style: titleStyle),
),
]
),
@ -480,7 +480,7 @@ class RecipeSheet extends StatelessWidget {
const SizedBox(),
Padding(
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
child: Text(recipe.description, style: descriptionStyle)
child: Text(recipe.description, style: descriptionStyle),
),
]
),
@ -489,7 +489,7 @@ class RecipeSheet extends StatelessWidget {
const SizedBox(),
Padding(
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
child: Text('Ingredients', style: headingStyle)
child: Text('Ingredients', style: headingStyle),
),
]
),
@ -503,7 +503,7 @@ class RecipeSheet extends StatelessWidget {
const SizedBox(),
Padding(
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
child: Text('Steps', style: headingStyle)
child: Text('Steps', style: headingStyle),
),
]
)
@ -544,7 +544,7 @@ class Recipe {
this.ingredientsImagePath,
this.ingredientsImagePackage,
this.ingredients,
this.steps
this.steps,
});
final String name;
@ -689,7 +689,7 @@ const List<Recipe> kPestoRecipes = <Recipe>[
steps: <RecipeStep>[
RecipeStep(duration: '10 min', description: 'Prep vegetables'),
RecipeStep(duration: '5 min', description: 'Stir'),
RecipeStep(duration: '1 hr 10 min', description: 'Cook')
RecipeStep(duration: '1 hr 10 min', description: 'Cook'),
],
),
Recipe(
@ -712,7 +712,7 @@ const List<Recipe> kPestoRecipes = <Recipe>[
RecipeStep(duration: '5 min', description: 'Sauté vegetables'),
RecipeStep(duration: '3 min', description: 'Stir vegetables and other filling ingredients'),
RecipeStep(duration: '10 min', description: 'Fill phyllo squares half-full with filling and fold.'),
RecipeStep(duration: '40 min', description: 'Bake')
RecipeStep(duration: '40 min', description: 'Bake'),
],
),
];

View File

@ -103,7 +103,7 @@ class _BackdropTitle extends AnimatedWidget {
end: const Offset(1.0, 0.0),
).evaluate(animation),
child: const ImageIcon(AssetImage('packages/shrine_images/diamond.png')),
)
),
]),
),
),
@ -138,7 +138,7 @@ class _BackdropTitle extends AnimatedWidget {
),
),
],
)
),
]),
);
}

View File

@ -609,7 +609,7 @@ class _ListModel {
_ListModel({
@required this.listKey,
@required this.removedItemBuilder,
Iterable<int> initialItems
Iterable<int> initialItems,
}) : assert(listKey != null),
assert(removedItemBuilder != null),
_items = List<int>.from(initialItems ?? <int>[]);

View File

@ -50,7 +50,7 @@ class HomePage extends StatelessWidget {
return Stack(
children: <Widget>[
backdrop,
Align(child: expandingBottomSheet, alignment: Alignment.bottomRight)
Align(child: expandingBottomSheet, alignment: Alignment.bottomRight),
],
);
}

View File

@ -40,7 +40,7 @@ class _LoginPageState extends State<LoginPage> {
// home screen using onGenerateRoute and so rootNavigator must be
// set to true in order to get out of Shrine completely.
Navigator.of(context, rootNavigator: true).pop();
}
},
),
),
body: SafeArea(

View File

@ -30,13 +30,13 @@ class TextStyleItem extends StatelessWidget {
children: <Widget>[
SizedBox(
width: 72.0,
child: Text(name, style: nameStyle)
child: Text(name, style: nameStyle),
),
Expanded(
child: Text(text, style: style.copyWith(height: 1.0))
)
]
)
child: Text(text, style: style.copyWith(height: 1.0)),
),
],
),
);
}
}
@ -64,7 +64,7 @@ class TypographyDemo extends StatelessWidget {
styleItems.insert(0, TextStyleItem(
name: 'Display 4',
style: textTheme.display4,
text: 'Light 112sp'
text: 'Light 112sp',
));
}

View File

@ -55,7 +55,7 @@ void showGalleryAboutDialog(BuildContext context) {
'${defaultTargetPlatform == TargetPlatform.iOS ? 'multiple platforms' : 'iOS and Android'} '
'from a single codebase. This design lab is a playground '
"and showcase of Flutter's many widgets, behaviors, "
'animations, layouts, and more. Learn more about Flutter at '
'animations, layouts, and more. Learn more about Flutter at ',
),
_LinkTextSpan(
style: linkStyle,

View File

@ -282,7 +282,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
child: widget.backLayer,
visible: _controller.status != AnimationStatus.completed,
maintainState: true,
)
),
),
],
),

View File

@ -91,7 +91,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
onPressed: () => _showExampleCode(context),
);
},
)
),
],
),
bottom: TabBar(
@ -109,10 +109,10 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(demo.description,
style: Theme.of(context).textTheme.subhead
)
style: Theme.of(context).textTheme.subhead,
),
),
Expanded(child: demo.demoWidget)
Expanded(child: demo.demoWidget),
],
),
);
@ -157,7 +157,7 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
Widget body;
if (_exampleCode == null) {
body = const Center(
child: CircularProgressIndicator()
child: CircularProgressIndicator(),
);
} else {
body = SingleChildScrollView(
@ -167,11 +167,11 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
text: TextSpan(
style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),
children: <TextSpan>[
DartSyntaxHighlighter(style).format(_exampleCode)
]
)
)
)
DartSyntaxHighlighter(style).format(_exampleCode),
],
),
),
),
);
}
@ -182,11 +182,11 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
Icons.clear,
semanticLabel: 'Close',
),
onPressed: () { Navigator.pop(context); }
onPressed: () { Navigator.pop(context); },
),
title: const Text('Example code')
title: const Text('Example code'),
),
body: body
body: body,
);
}
}
@ -207,7 +207,7 @@ class MaterialDemoDocumentationButton extends StatelessWidget {
return IconButton(
icon: const Icon(Icons.library_books),
tooltip: 'API documentation',
onPressed: () => launch(documentationUrl, forceWebView: true)
onPressed: () => launch(documentationUrl, forceWebView: true),
);
}
}
@ -231,7 +231,7 @@ class CupertinoDemoDocumentationButton extends StatelessWidget {
label: 'API documentation',
child: const Icon(CupertinoIcons.book),
),
onPressed: () => launch(documentationUrl, forceWebView: true)
onPressed: () => launch(documentationUrl, forceWebView: true),
);
}
}

View File

@ -19,7 +19,7 @@ RaisedButton(
child: const Text('BUTTON TITLE'),
onPressed: () {
// Perform some action
}
},
);
// Create a disabled button.
@ -27,7 +27,7 @@ RaisedButton(
// specified or is null.
const RaisedButton(
child: Text('BUTTON TITLE'),
onPressed: null
onPressed: null,
);
// Create a button with an icon and a
@ -47,7 +47,7 @@ OutlineButton(
child: const Text('BUTTON TITLE'),
onPressed: () {
// Perform some action
}
},
);
// Create a disabled button.
@ -55,7 +55,7 @@ OutlineButton(
// specified or is null.
const OutlineButton(
child: Text('BUTTON TITLE'),
onPressed: null
onPressed: null,
);
// Create a button with an icon and a
@ -75,7 +75,7 @@ FlatButton(
child: const Text('BUTTON TITLE'),
onPressed: () {
// Perform some action
}
},
);
// Create a disabled button.
@ -83,7 +83,7 @@ FlatButton(
// specified or is null.
const FlatButton(
child: Text('BUTTON TITLE'),
onPressed: null
onPressed: null,
);
// END
@ -109,7 +109,7 @@ DropdownButton<String>(
value: value,
child: Text(value));
})
.toList()
.toList(),
);
// END
@ -124,7 +124,7 @@ IconButton(
onPressed: () {
setState(() => value = !value);
},
color: value ? Theme.of(context).primaryColor : null
color: value ? Theme.of(context).primaryColor : null,
);
// END
@ -133,12 +133,12 @@ IconButton(
// Floating action button in Scaffold.
Scaffold(
appBar: AppBar(
title: const Text('Demo')
title: const Text('Demo'),
),
floatingActionButton: const FloatingActionButton(
child: Icon(Icons.add),
onPressed: null
)
onPressed: null,
),
);
// END
}
@ -199,26 +199,26 @@ Row(
Radio<int>(
value: 0,
groupValue: radioValue,
onChanged: handleRadioValueChanged
onChanged: handleRadioValueChanged,
),
Radio<int>(
value: 1,
groupValue: radioValue,
onChanged: handleRadioValueChanged
onChanged: handleRadioValueChanged,
),
Radio<int>(
value: 2,
groupValue: radioValue,
onChanged: handleRadioValueChanged
)
]
onChanged: handleRadioValueChanged,
),
],
);
// Creates a disabled radio button.
const Radio<int>(
value: 0,
groupValue: 0,
onChanged: null
onChanged: null,
);
// END
@ -262,13 +262,13 @@ GridView.count(
'https://example.com/image-1.jpg',
'https://example.com/image-2.jpg',
'...',
'https://example.com/image-n.jpg'
'https://example.com/image-n.jpg',
].map<Widget>((String url) {
return GridTile(
footer: GridTileBar(
title: Text(url)
title: Text(url),
),
child: Image.network(url, fit: BoxFit.cover)
child: Image.network(url, fit: BoxFit.cover),
);
}).toList(),
);

View File

@ -400,14 +400,14 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
child: const Banner(
message: 'PREVIEW',
location: BannerLocation.topEnd,
)
),
),
]
],
);
}
home = AnnotatedRegion<SystemUiOverlayStyle>(
child: home,
value: SystemUiOverlayStyle.light
value: SystemUiOverlayStyle.light,
);
return home;

View File

@ -408,7 +408,7 @@ class GalleryOptionsPage extends StatelessWidget {
options.showOffscreenLayersCheckerboard,
(bool value) {
onOptionsChanged(options.copyWith(showOffscreenLayersCheckerboard: value));
}
},
),
);
}

View File

@ -14,7 +14,7 @@ class SyntaxHighlighterStyle {
this.stringStyle,
this.punctuationStyle,
this.classStyle,
this.constantStyle
this.constantStyle,
});
static SyntaxHighlighterStyle lightThemeStyle() {
@ -26,7 +26,7 @@ class SyntaxHighlighterStyle {
stringStyle: const TextStyle(color: Color(0xFF43A047)),
punctuationStyle: const TextStyle(color: Color(0xFF000000)),
classStyle: const TextStyle(color: Color(0xFF512DA8)),
constantStyle: const TextStyle(color: Color(0xFF795548))
constantStyle: const TextStyle(color: Color(0xFF795548)),
);
}
@ -39,7 +39,7 @@ class SyntaxHighlighterStyle {
stringStyle: const TextStyle(color: Color(0xFF009688)),
punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
classStyle: const TextStyle(color: Color(0xFF009688)),
constantStyle: const TextStyle(color: Color(0xFF795548))
constantStyle: const TextStyle(color: Color(0xFF795548)),
);
}
@ -72,11 +72,11 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library',
'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static',
'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var',
'void', 'while', 'with', 'yield'
'void', 'while', 'with', 'yield',
];
static const List<String> _builtInTypes = <String>[
'int', 'double', 'num', 'bool'
'int', 'double', 'num', 'bool',
];
String _src;
@ -125,7 +125,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.comment,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -146,7 +146,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.comment,
startComment,
endComment
endComment,
));
if (eof)
@ -160,7 +160,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.string,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -170,7 +170,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.string,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -180,7 +180,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.string,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -190,7 +190,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.string,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -200,7 +200,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.string,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -210,7 +210,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.string,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -220,7 +220,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.number,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -240,7 +240,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.punctuation,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -250,7 +250,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
_HighlightType.keyword,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
continue;
}
@ -276,7 +276,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans.add(_HighlightSpan(
type,
_scanner.lastMatch.start,
_scanner.lastMatch.end
_scanner.lastMatch.end,
));
}
}
@ -299,7 +299,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
_spans[i] = _HighlightSpan(
_spans[i].type,
_spans[i].start,
_spans[i + 1].end
_spans[i + 1].end,
);
_spans.removeAt(i + 1);
}

View File

@ -19,8 +19,8 @@ void main() {
child: SizedBox(
width: 450.0,
height: 800.0,
child: GalleryApp(testMode: true)
)
child: GalleryApp(testMode: true),
),
)
);
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865

View File

@ -20,7 +20,7 @@ void main() {
await tester.pumpWidget(
const GalleryApp(
testMode: true,
updateUrlFetcher: mockUpdateUrlFetcher
updateUrlFetcher: mockUpdateUrlFetcher,
)
);
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865

View File

@ -65,7 +65,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Center(
child: Text(
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
style: const TextStyle(fontSize: 17.0))
style: const TextStyle(fontSize: 17.0)),
),
),
Container(

View File

@ -24,7 +24,7 @@ void beginFrame(Duration timeStamp) {
canvas.scale(devicePixelRatio, devicePixelRatio);
canvas.drawParagraph(paragraph, ui.Offset(
(logicalSize.width - paragraph.maxIntrinsicWidth) / 2.0,
(logicalSize.height - paragraph.height) / 2.0
(logicalSize.height - paragraph.height) / 2.0,
));
final ui.Picture picture = recorder.endRecording();

View File

@ -28,7 +28,7 @@ ui.Picture paint(ui.Rect paintBounds) {
canvas.drawCircle(
size.center(ui.Offset.zero),
size.shortestSide * 0.45,
ui.Paint()..color = color
ui.Paint()..color = color,
);
// When we're done issuing painting commands, we end the recording an receive

View File

@ -24,6 +24,6 @@ void main() {
// particular text direction.
textDirection: TextDirection.ltr,
),
)
),
);
}

View File

@ -26,7 +26,7 @@ void main() {
// to have a specific size.
final RenderBox square = RenderConstrainedBox(
additionalConstraints: const BoxConstraints.tightFor(width: 200.0, height: 200.0),
child: green
child: green,
);
// Third, we wrap the sized green square in a render object that applies rotation
// transform before painting its child. Each frame of the animation, we'll
@ -35,12 +35,12 @@ void main() {
final RenderTransform spin = RenderTransform(
transform: Matrix4.identity(),
alignment: Alignment.center,
child: square
child: square,
);
// Finally, we center the spinning green square...
final RenderBox root = RenderPositionedBox(
alignment: Alignment.center,
child: spin
child: spin,
);
// and attach it to the window.
RenderingFlutterBinding(root: root);

View File

@ -14,7 +14,7 @@ class SectorConstraints extends Constraints {
this.minDeltaRadius = 0.0,
this.maxDeltaRadius = double.infinity,
this.minDeltaTheta = 0.0,
this.maxDeltaTheta = kTwoPi
this.maxDeltaTheta = kTwoPi,
}) : assert(maxDeltaRadius >= minDeltaRadius),
assert(maxDeltaTheta >= minDeltaTheta);
@ -46,7 +46,7 @@ class SectorConstraints extends Constraints {
@override
bool debugAssertIsValid({
bool isAppliedConstraint = false,
InformationCollector informationCollector
InformationCollector informationCollector,
}) {
assert(isNormalized);
return isNormalized;
@ -58,11 +58,11 @@ class SectorDimensions {
factory SectorDimensions.withConstraints(
SectorConstraints constraints,
{ double deltaRadius = 0.0, double deltaTheta = 0.0 }
{ double deltaRadius = 0.0, double deltaTheta = 0.0, }
) {
return SectorDimensions(
deltaRadius: constraints.constrainDeltaRadius(deltaRadius),
deltaTheta: constraints.constrainDeltaTheta(deltaTheta)
deltaTheta: constraints.constrainDeltaTheta(deltaTheta),
);
}
@ -216,7 +216,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
RenderSectorRing({
BoxDecoration decoration,
double deltaRadius = double.infinity,
double padding = 0.0
double padding = 0.0,
}) : _padding = padding,
assert(deltaRadius >= 0.0),
_desiredDeltaRadius = deltaRadius,
@ -263,7 +263,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: innerDeltaRadius,
maxDeltaTheta: remainingDeltaTheta
maxDeltaTheta: remainingDeltaTheta,
);
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
innerTheta += childDimensions.deltaTheta;
@ -294,7 +294,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: innerDeltaRadius,
maxDeltaTheta: remainingDeltaTheta
maxDeltaTheta: remainingDeltaTheta,
);
assert(child.parentData is SectorParentData);
child.parentData.theta = innerTheta;
@ -334,7 +334,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
RenderSectorSlice({
BoxDecoration decoration,
double deltaTheta = kTwoPi,
double padding = 0.0
double padding = 0.0,
}) : _padding = padding, _desiredDeltaTheta = deltaTheta, super(decoration);
double _desiredDeltaTheta;
@ -377,7 +377,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: remainingDeltaRadius,
maxDeltaTheta: innerDeltaTheta
maxDeltaTheta: innerDeltaTheta,
);
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
childRadius += childDimensions.deltaRadius;
@ -406,7 +406,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
while (child != null) {
final SectorConstraints innerConstraints = SectorConstraints(
maxDeltaRadius: remainingDeltaRadius,
maxDeltaTheta: innerDeltaTheta
maxDeltaTheta: innerDeltaTheta,
);
child.parentData.theta = innerTheta;
child.parentData.radius = childRadius;
@ -488,7 +488,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
Size getIntrinsicDimensions({
double width = double.infinity,
double height = double.infinity
double height = double.infinity,
}) {
assert(child is RenderSector);
assert(child.parentData is SectorParentData);
@ -556,7 +556,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
class RenderSolidColor extends RenderDecoratedSector {
RenderSolidColor(this.backgroundColor, {
this.desiredDeltaRadius = double.infinity,
this.desiredDeltaTheta = kTwoPi
this.desiredDeltaTheta = kTwoPi,
}) : super(BoxDecoration(color: backgroundColor));
double desiredDeltaRadius;

View File

@ -183,7 +183,7 @@ class CalculationManager {
sender.send(<double>[ completed, total ]);
},
onResultListener: sender.send,
data: message.data
data: message.data,
);
calculator.run();
}
@ -221,7 +221,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
)..repeat();
_calculationManager = CalculationManager(
onProgressListener: _handleProgressUpdate,
onResultListener: _handleResult
onResultListener: _handleResult,
);
}
@ -243,24 +243,24 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
width: 120.0,
height: 120.0,
color: const Color(0xFF882222),
)
),
),
Opacity(
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
child: CircularProgressIndicator(
value: _progress
)
),
),
Text(_status),
Center(
child: RaisedButton(
child: Text(_label),
onPressed: _handleButtonPressed
)
onPressed: _handleButtonPressed,
),
),
Text(_result)
]
)
Text(_result),
],
),
);
}

View File

@ -13,7 +13,7 @@ class _GesturePainter extends CustomPainter {
this.scaleEnabled,
this.tapEnabled,
this.doubleTapEnabled,
this.longPressEnabled
this.longPressEnabled,
});
final double zoom;
@ -159,9 +159,9 @@ class GestureDemoState extends State<GestureDemo> {
scaleEnabled: _scaleEnabled,
tapEnabled: _tapEnabled,
doubleTapEnabled: _doubleTapEnabled,
longPressEnabled: _longPressEnabled
)
)
longPressEnabled: _longPressEnabled,
),
),
),
Positioned(
bottom: 0.0,
@ -175,45 +175,45 @@ class GestureDemoState extends State<GestureDemo> {
children: <Widget>[
Checkbox(
value: _scaleEnabled,
onChanged: (bool value) { setState(() { _scaleEnabled = value; }); }
onChanged: (bool value) { setState(() { _scaleEnabled = value; }); },
),
const Text('Scale'),
]
],
),
Row(
children: <Widget>[
Checkbox(
value: _tapEnabled,
onChanged: (bool value) { setState(() { _tapEnabled = value; }); }
onChanged: (bool value) { setState(() { _tapEnabled = value; }); },
),
const Text('Tap'),
]
],
),
Row(
children: <Widget>[
Checkbox(
value: _doubleTapEnabled,
onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); }
onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); },
),
const Text('Double Tap'),
]
],
),
Row(
children: <Widget>[
Checkbox(
value: _longPressEnabled,
onChanged: (bool value) { setState(() { _longPressEnabled = value; }); }
onChanged: (bool value) { setState(() { _longPressEnabled = value; }); },
),
const Text('Long Press'),
]
],
),
],
crossAxisAlignment: CrossAxisAlignment.start
)
)
)
crossAxisAlignment: CrossAxisAlignment.start,
),
),
),
),
]
],
);
}
}
@ -223,7 +223,7 @@ void main() {
theme: ThemeData.dark(),
home: Scaffold(
appBar: AppBar(title: const Text('Gestures Demo')),
body: GestureDemo()
)
body: GestureDemo(),
),
));
}

View File

@ -19,8 +19,8 @@ class AdaptedListItem extends StatelessWidget {
margin: const EdgeInsets.all(8.0),
color: Colors.lightBlueAccent.shade100,
),
Text(name)
]
Text(name),
],
);
}
}
@ -38,24 +38,24 @@ class AdaptedGridItem extends StatelessWidget {
Expanded(
child: Container(
color: Colors.lightBlueAccent.shade100,
)
),
),
Container(
margin: const EdgeInsets.only(left: 8.0),
child: Row(
children: <Widget>[
Expanded(
child: Text(name)
child: Text(name),
),
const IconButton(
icon: Icon(Icons.more_vert),
onPressed: null
)
]
)
)
]
)
onPressed: null,
),
],
),
),
],
),
);
}
}
@ -99,9 +99,9 @@ void main() {
title: 'Media Query Example',
home: Scaffold(
appBar: AppBar(
title: const Text('Media Query Example')
title: const Text('Media Query Example'),
),
body: Material(child: AdaptiveContainer(names: _kNames))
)
body: Material(child: AdaptiveContainer(names: _kNames)),
),
));
}

View File

@ -12,7 +12,7 @@ import '../rendering/src/sector_layout.dart';
RenderBox initCircle() {
return RenderBoxToRenderSectorAdapter(
innerRadius: 25.0,
child: RenderSectorRing(padding: 0.0)
child: RenderSectorRing(padding: 0.0),
);
}
@ -74,7 +74,7 @@ class SectorAppState extends State<SectorApp> {
ring.add(RenderSolidColor(color, desiredDeltaTheta: kTwoPi * 0.2));
return RenderBoxToRenderSectorAdapter(
innerRadius: 5.0,
child: ring
child: ring,
);
}
RenderBoxToRenderSectorAdapter sectorAddIcon = initSector(const Color(0xFF00DD00));
@ -104,12 +104,12 @@ class SectorAppState extends State<SectorApp> {
Container(
padding: const EdgeInsets.all(4.0),
margin: const EdgeInsets.only(right: 10.0),
child: WidgetToRenderBoxAdapter(renderBox: sectorAddIcon)
child: WidgetToRenderBoxAdapter(renderBox: sectorAddIcon),
),
const Text('ADD SECTOR'),
]
)
)
],
),
),
),
RaisedButton(
onPressed: _enabledRemove ? removeSector : null,
@ -119,16 +119,16 @@ class SectorAppState extends State<SectorApp> {
Container(
padding: const EdgeInsets.all(4.0),
margin: const EdgeInsets.only(right: 10.0),
child: WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon)
child: WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon),
),
const Text('REMOVE SECTOR'),
]
)
)
],
),
),
),
],
mainAxisAlignment: MainAxisAlignment.spaceAround
)
mainAxisAlignment: MainAxisAlignment.spaceAround,
),
),
Expanded(
child: Container(
@ -139,12 +139,12 @@ class SectorAppState extends State<SectorApp> {
padding: const EdgeInsets.all(8.0),
child: WidgetToRenderBoxAdapter(
renderBox: sectors,
onBuild: doUpdates
)
)
onBuild: doUpdates,
),
),
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween
mainAxisAlignment: MainAxisAlignment.spaceBetween,
);
}
@ -155,10 +155,10 @@ class SectorAppState extends State<SectorApp> {
title: 'Sector Layout',
home: Scaffold(
appBar: AppBar(
title: const Text('Sector Layout in a Widget Tree')
title: const Text('Sector Layout in a Widget Tree'),
),
body: buildBody()
)
body: buildBody(),
),
);
}
}

View File

@ -26,7 +26,7 @@ class Rectangle extends StatelessWidget {
return Expanded(
child: Container(
color: color,
)
),
);
}
}

View File

@ -38,7 +38,7 @@ class _SpinningSquareState extends State<SpinningSquare> with SingleTickerProvid
width: 200.0,
height: 200.0,
color: const Color(0xFF00FF00),
)
),
);
}
}

View File

@ -29,7 +29,7 @@ const TextStyle _kBold = TextStyle(fontWeight: FontWeight.bold);
const TextStyle _kUnderline = TextStyle(
decoration: TextDecoration.underline,
decorationColor: Color(0xFF000000),
decorationStyle: TextDecorationStyle.wavy
decorationStyle: TextDecorationStyle.wavy,
);
Widget toStyledText(String name, String text) {
@ -44,14 +44,14 @@ Widget toStyledText(String name, String text) {
children: <TextSpan>[
TextSpan(
style: _kUnderline,
text: name
text: name,
),
const TextSpan(text: ':')
]
const TextSpan(text: ':'),
],
),
TextSpan(text: text)
]
)
TextSpan(text: text),
],
),
);
}
@ -67,7 +67,7 @@ class SpeakerSeparator extends StatelessWidget {
border: Border(
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
)
)
),
);
}
}
@ -112,9 +112,9 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
child: Column(
children: children,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start
)
)
crossAxisAlignment: CrossAxisAlignment.start,
),
),
);
}
}
@ -124,12 +124,12 @@ void main() {
theme: ThemeData.light(),
home: Scaffold(
appBar: AppBar(
title: const Text('Hal and Dave')
title: const Text('Hal and Dave'),
),
body: Material(
color: Colors.grey.shade50,
child: StyledTextDemo()
)
)
child: StyledTextDemo(),
),
),
));
}

View File

@ -21,6 +21,6 @@ class MessageLookup extends MessageLookupByLibrary {
static _notInlinedMessages(_) => <String, Function> {
"market" : MessageLookupByLibrary.simpleMessage("MARKET"),
"portfolio" : MessageLookupByLibrary.simpleMessage("PORTFOLIO"),
"title" : MessageLookupByLibrary.simpleMessage("Stocks")
"title" : MessageLookupByLibrary.simpleMessage("Stocks"),
};
}

View File

@ -21,6 +21,6 @@ class MessageLookup extends MessageLookupByLibrary {
static _notInlinedMessages(_) => <String, Function> {
"market" : MessageLookupByLibrary.simpleMessage("MERCADO"),
"portfolio" : MessageLookupByLibrary.simpleMessage("CARTERA"),
"title" : MessageLookupByLibrary.simpleMessage("Acciones")
"title" : MessageLookupByLibrary.simpleMessage("Acciones"),
};
}

Some files were not shown because too many files have changed in this diff Show More