re-enable lint unnecessary_const (#19592)

* re-enable lint unnecessary_const

* remove trailling whitespaces

* remove unnecessary const (after merge)
This commit is contained in:
Alexandre Ardhuin 2018-07-23 08:31:48 +02:00 committed by GitHub
parent 1cb2677234
commit 27018359d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
560 changed files with 40983 additions and 40982 deletions

View File

@ -142,6 +142,7 @@ linter:
- type_init_formals
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
- unnecessary_null_aware_assignments

View File

@ -133,43 +133,43 @@ class TopBarMenu extends StatelessWidget {
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
const PopupMenuItem<String>(
value: 'Friends',
child: const MenuItemWithIcon(Icons.people, 'Friends', '5 new')
child: MenuItemWithIcon(Icons.people, 'Friends', '5 new')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
child: MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.group, 'Groups', '14')
child: MenuItemWithIcon(Icons.group, 'Groups', '14')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.image, 'Pictures', '12')
child: MenuItemWithIcon(Icons.image, 'Pictures', '12')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
),
const PopupMenuItem<String>(
value: 'Friends',
child: const MenuItemWithIcon(Icons.people, 'Friends', '5')
child: MenuItemWithIcon(Icons.people, 'Friends', '5')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.event, 'Events', '12')
child: MenuItemWithIcon(Icons.event, 'Events', '12')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.group, 'Groups', '14')
child: MenuItemWithIcon(Icons.group, 'Groups', '14')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.image, 'Pictures', '12')
child: MenuItemWithIcon(Icons.image, 'Pictures', '12')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
)
]
);
@ -212,8 +212,8 @@ class FancyImageItem extends StatelessWidget {
new ItemImageBox(),
new InfoBar(),
const Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: const Divider()
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Divider()
),
new IconBar(),
new FatDivider()
@ -234,8 +234,8 @@ class FancyGalleryItem extends StatelessWidget {
new ItemGalleryBox(index),
new InfoBar(),
const Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: const Divider()
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Divider()
),
new IconBar(),
new FatDivider()
@ -268,9 +268,9 @@ class IconBar extends StatelessWidget {
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[
const IconWithText(Icons.thumb_up, 'Like'),
const IconWithText(Icons.comment, 'Comment'),
const IconWithText(Icons.share, 'Share'),
IconWithText(Icons.thumb_up, 'Like'),
IconWithText(Icons.comment, 'Comment'),
IconWithText(Icons.share, 'Share'),
]
)
);
@ -350,9 +350,9 @@ class UserHeader extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Padding(
padding: const EdgeInsets.only(right: 8.0),
child: const Image(
image: const AssetImage('packages/flutter_gallery_assets/people/square/ali.png'),
padding: EdgeInsets.only(right: 8.0),
child: Image(
image: AssetImage('packages/flutter_gallery_assets/people/square/ali.png'),
width: 32.0,
height: 32.0
)
@ -367,7 +367,7 @@ class UserHeader extends StatelessWidget {
children: <TextSpan>[
new TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)),
const TextSpan(text: ' shared a new '),
const TextSpan(text: 'photo', style: const TextStyle(fontWeight: FontWeight.bold))
const TextSpan(text: 'photo', style: TextStyle(fontWeight: FontWeight.bold))
]
)),
new Row(
@ -390,8 +390,8 @@ class ItemDescription extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Padding(
padding: const EdgeInsets.all(8.0),
child: const Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
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.')
);
}
}
@ -409,8 +409,8 @@ class ItemImageBox extends StatelessWidget {
children: <Widget>[
const SizedBox(
height: 230.0,
child: const Image(
image: const AssetImage('packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png')
child: Image(
image: AssetImage('packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png')
)
),
new Theme(
@ -439,14 +439,14 @@ class ItemImageBox extends StatelessWidget {
),
padding: const EdgeInsets.all(4.0),
child: const RichText(
text: const TextSpan(
style: const TextStyle(color: Colors.white),
children: const <TextSpan>[
const TextSpan(
text: TextSpan(
style: TextStyle(color: Colors.white),
children: <TextSpan>[
TextSpan(
text: 'Photo by '
),
const TextSpan(
style: const TextStyle(fontWeight: FontWeight.bold),
TextSpan(
style: TextStyle(fontWeight: FontWeight.bold),
text: 'Chris Godley'
)
]
@ -561,11 +561,11 @@ class BottomBar extends StatelessWidget {
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[
const BottomBarButton(Icons.new_releases, 'News'),
const BottomBarButton(Icons.people, 'Requests'),
const BottomBarButton(Icons.chat, 'Messenger'),
const BottomBarButton(Icons.bookmark, 'Bookmark'),
const BottomBarButton(Icons.alarm, 'Alarm'),
BottomBarButton(Icons.new_releases, 'News'),
BottomBarButton(Icons.people, 'Requests'),
BottomBarButton(Icons.chat, 'Messenger'),
BottomBarButton(Icons.bookmark, 'Bookmark'),
BottomBarButton(Icons.alarm, 'Alarm'),
],
),
);
@ -670,7 +670,7 @@ class FancyDrawerHeader extends StatelessWidget {
height: 200.0,
child: const SafeArea(
bottom: false,
child: const Placeholder(),
child: Placeholder(),
),
);
}

View File

@ -13,7 +13,7 @@ import 'package:stocks/stock_data.dart' as stock_data;
import '../common.dart';
const Duration kBenchmarkTime = const Duration(seconds: 15);
const Duration kBenchmarkTime = Duration(seconds: 15);
class BenchmarkingBinding extends LiveTestWidgetsFlutterBinding {
BenchmarkingBinding(this.stopwatch);

View File

@ -13,7 +13,7 @@ import 'package:stocks/stock_data.dart' as stock_data;
import '../common.dart';
const Duration kBenchmarkTime = const Duration(seconds: 15);
const Duration kBenchmarkTime = Duration(seconds: 15);
Future<Null> main() async {
assert(false); // don't run this in checked mode! Use --release.

View File

@ -13,7 +13,7 @@ import 'package:stocks/stock_data.dart' as stock_data;
import '../common.dart';
const Duration kBenchmarkTime = const Duration(seconds: 15);
const Duration kBenchmarkTime = Duration(seconds: 15);
Future<Null> main() async {
stock_data.StockData.actuallyFetchData = false;

View File

@ -520,7 +520,7 @@ class ArchivePublisher {
jsonData = _addRelease(jsonData);
const JsonEncoder encoder = const JsonEncoder.withIndent(' ');
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
metadataFile.writeAsStringSync(encoder.convert(jsonData));
await _cloudCopy(metadataFile.absolute.path, metadataGsPath);
}

View File

@ -27,7 +27,7 @@ final String reset = hasColor ? '\x1B[0m' : '';
const String arrow = '';
const String clock = '🕐';
const Map<String, ShardRunner> _kShards = const <String, ShardRunner>{
const Map<String, ShardRunner> _kShards = <String, ShardRunner>{
'analyze': _analyzeRepo,
'tests': _runTests,
'tool_tests': _runToolTests,
@ -36,8 +36,8 @@ const Map<String, ShardRunner> _kShards = const <String, ShardRunner>{
// 'build_and_deploy_gallery': handled by travis_script.sh
};
const Duration _kLongTimeout = const Duration(minutes: 45);
const Duration _kShortTimeout = const Duration(minutes: 5);
const Duration _kLongTimeout = Duration(minutes: 45);
const Duration _kShortTimeout = Duration(minutes: 5);
/// When you call this, you can pass additional arguments to pass custom
/// arguments to flutter test. For example, you might want to call this

View File

@ -313,7 +313,7 @@ void main() {
new DateTime.now().difference(DateTime.parse(releases[0]['release_date'])),
lessThan(const Duration(minutes: 1)),
);
const JsonEncoder encoder = const JsonEncoder.withIndent(' ');
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
expect(contents, equals(encoder.convert(jsonData)));
});
});

View File

@ -16,7 +16,7 @@ import 'utils.dart';
/// Maximum amount of time a single task is allowed to take to run.
///
/// If exceeded the task is considered to have failed.
const Duration _kDefaultTaskTimeout = const Duration(minutes: 15);
const Duration _kDefaultTaskTimeout = Duration(minutes: 15);
/// Represents a unit of work performed in the CI environment that can
/// succeed, fail and be retried independently of others.
@ -103,7 +103,7 @@ class _TaskRunner {
_keepAlivePort = new RawReceivePort();
// Timeout if nothing bothers to connect and ask us to run the task.
const Duration taskStartTimeout = const Duration(seconds: 10);
const Duration taskStartTimeout = Duration(seconds: 10);
_startTaskTimeout = new Timer(taskStartTimeout, () {
if (!_taskStarted) {
logger.severe('Task did not start in $taskStartTimeout.');
@ -147,7 +147,7 @@ class TaskResult {
TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]})
: this.succeeded = true,
this.message = 'success' {
const JsonEncoder prettyJson = const JsonEncoder.withIndent(' ');
const JsonEncoder prettyJson = JsonEncoder.withIndent(' ');
if (benchmarkScoreKeys != null) {
for (String key in benchmarkScoreKeys) {
if (!data.containsKey(key)) {

View File

@ -13,7 +13,7 @@ import 'utils.dart';
const String _kProvisioningConfigFileEnvironmentVariable = 'FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG';
const String _kTestXcconfigFileName = 'TestConfig.xcconfig';
const FileSystem _fs = const io.LocalFileSystem();
const FileSystem _fs = io.LocalFileSystem();
/// Patches the given Xcode project adding provisioning certificates and team
/// information required to build and run the project, if

View File

@ -12,7 +12,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
/// Slightly longer than task timeout that gives the task runner a chance to
/// clean-up before forcefully quitting it.
const Duration taskTimeoutWithGracePeriod = const Duration(minutes: 26);
const Duration taskTimeoutWithGracePeriod = Duration(minutes: 26);
/// Runs a task in a separate Dart VM and collects the result using the VM
/// service protocol.
@ -111,7 +111,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
throw 'not ready yet';
return isolate;
} catch (error) {
const Duration connectionTimeout = const Duration(seconds: 10);
const Duration connectionTimeout = Duration(seconds: 10);
if (new DateTime.now().difference(started) > connectionTimeout) {
throw new TimeoutException(
'Failed to connect to the task runner process',
@ -119,7 +119,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
);
}
print('VM service not ready yet: $error');
const Duration pauseBetweenRetries = const Duration(milliseconds: 200);
const Duration pauseBetweenRetries = Duration(milliseconds: 200);
print('Will retry in $pauseBetweenRetries.');
await new Future<Null>.delayed(pauseBetweenRetries);
}

View File

@ -541,7 +541,7 @@ void setLocalEngineOptionIfNecessary(List<String> options, [String flavor]) {
// If engine flavor was not specified explicitly then scan options looking
// for flags that specify the engine flavor (--release, --profile or
// --debug). Default flavor to debug if no flags were found.
const Map<String, String> optionToFlavor = const <String, String>{
const Map<String, String> optionToFlavor = <String, String>{
'--release': 'release',
'--debug': 'debug',
'--profile': 'profile',
@ -557,7 +557,7 @@ void setLocalEngineOptionIfNecessary(List<String> options, [String flavor]) {
flavor ??= 'debug';
}
const Map<DeviceOperatingSystem, String> osNames = const <DeviceOperatingSystem, String>{
const Map<DeviceOperatingSystem, String> osNames = <DeviceOperatingSystem, String>{
DeviceOperatingSystem.ios: 'ios',
DeviceOperatingSystem.android: 'android',
};

View File

@ -21,7 +21,7 @@ Future<TaskResult> runEndToEndTests() async {
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(testDirectory.path);
const List<String> entryPoints = const <String>[
const List<String> entryPoints = <String>[
'lib/keyboard_resize.dart',
'lib/driver.dart',
'lib/screenshot.dart',

View File

@ -14,7 +14,7 @@ import 'package:flutter_devicelab/framework/ios.dart';
import 'package:flutter_devicelab/framework/utils.dart';
/// The maximum amount of time a single microbenchmark is allowed to take.
const Duration _kBenchmarkTimeout = const Duration(minutes: 10);
const Duration _kBenchmarkTimeout = Duration(minutes: 10);
/// Creates a device lab task that runs benchmarks in
/// `dev/benchmarks/microbenchmarks` reports results to the dashboard.

View File

@ -113,7 +113,7 @@ TaskFunction createBasicMaterialCompileTest() {
/// Measure application startup performance.
class StartupTest {
static const Duration _startupTimeout = const Duration(minutes: 5);
static const Duration _startupTimeout = Duration(minutes: 5);
const StartupTest(this.testDirectory, { this.reportMetrics = true });
@ -340,7 +340,7 @@ class CompileTest {
};
}
static const Map<String, String> _kSdkNameToMetricNameMapping = const <String, String> {
static const Map<String, String> _kSdkNameToMetricNameMapping = <String, String> {
'VMIsolate': 'aot_snapshot_size_vmisolate',
'Isolate': 'aot_snapshot_size_isolate',
'ReadOnlyData': 'aot_snapshot_size_rodata',

View File

@ -10,7 +10,7 @@ import 'package:process/process.dart';
import 'package:test/test.dart';
void main() {
const ProcessManager processManager = const LocalProcessManager();
const ProcessManager processManager = LocalProcessManager();
group('run.dart script', () {
Future<ProcessResult> runScript(List<String> testNames) async {

View File

@ -43,36 +43,36 @@ class ExtendedStandardMessageCodec extends StandardMessageCodec {
Future<TestStepResult> basicBinaryHandshake(ByteData message) async {
const BasicMessageChannel<ByteData> channel =
const BasicMessageChannel<ByteData>(
BasicMessageChannel<ByteData>(
'binary-msg',
const BinaryCodec(),
BinaryCodec(),
);
return _basicMessageHandshake<ByteData>(
'Binary >${toString(message)}<', channel, message);
}
Future<TestStepResult> basicStringHandshake(String message) async {
const BasicMessageChannel<String> channel = const BasicMessageChannel<String>(
const BasicMessageChannel<String> channel = BasicMessageChannel<String>(
'string-msg',
const StringCodec(),
StringCodec(),
);
return _basicMessageHandshake<String>('String >$message<', channel, message);
}
Future<TestStepResult> basicJsonHandshake(dynamic message) async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'json-msg',
const JSONMessageCodec(),
JSONMessageCodec(),
);
return _basicMessageHandshake<dynamic>('JSON >$message<', channel, message);
}
Future<TestStepResult> basicStandardHandshake(dynamic message) async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'std-msg',
const ExtendedStandardMessageCodec(),
ExtendedStandardMessageCodec(),
);
return _basicMessageHandshake<dynamic>(
'Standard >${toString(message)}<', channel, message);
@ -80,35 +80,35 @@ Future<TestStepResult> basicStandardHandshake(dynamic message) async {
Future<TestStepResult> basicBinaryMessageToUnknownChannel() async {
const BasicMessageChannel<ByteData> channel =
const BasicMessageChannel<ByteData>(
BasicMessageChannel<ByteData>(
'binary-unknown',
const BinaryCodec(),
BinaryCodec(),
);
return _basicMessageToUnknownChannel<ByteData>('Binary', channel);
}
Future<TestStepResult> basicStringMessageToUnknownChannel() async {
const BasicMessageChannel<String> channel = const BasicMessageChannel<String>(
const BasicMessageChannel<String> channel = BasicMessageChannel<String>(
'string-unknown',
const StringCodec(),
StringCodec(),
);
return _basicMessageToUnknownChannel<String>('String', channel);
}
Future<TestStepResult> basicJsonMessageToUnknownChannel() async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'json-unknown',
const JSONMessageCodec(),
JSONMessageCodec(),
);
return _basicMessageToUnknownChannel<dynamic>('JSON', channel);
}
Future<TestStepResult> basicStandardMessageToUnknownChannel() async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'std-unknown',
const ExtendedStandardMessageCodec(),
ExtendedStandardMessageCodec(),
);
return _basicMessageToUnknownChannel<dynamic>('Standard', channel);
}

View File

@ -9,46 +9,46 @@ import 'test_step.dart';
Future<TestStepResult> methodCallJsonSuccessHandshake(dynamic payload) async {
const MethodChannel channel =
const MethodChannel('json-method', const JSONMethodCodec());
MethodChannel('json-method', JSONMethodCodec());
return _methodCallSuccessHandshake(
'JSON success($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonErrorHandshake(dynamic payload) async {
const MethodChannel channel =
const MethodChannel('json-method', const JSONMethodCodec());
MethodChannel('json-method', JSONMethodCodec());
return _methodCallErrorHandshake('JSON error($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonNotImplementedHandshake() async {
const MethodChannel channel =
const MethodChannel('json-method', const JSONMethodCodec());
MethodChannel('json-method', JSONMethodCodec());
return _methodCallNotImplementedHandshake('JSON notImplemented()', channel);
}
Future<TestStepResult> methodCallStandardSuccessHandshake(
dynamic payload) async {
const MethodChannel channel = const MethodChannel(
const MethodChannel channel = MethodChannel(
'std-method',
const StandardMethodCodec(const ExtendedStandardMessageCodec()),
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallSuccessHandshake(
'Standard success($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
const MethodChannel channel = const MethodChannel(
const MethodChannel channel = MethodChannel(
'std-method',
const StandardMethodCodec(const ExtendedStandardMessageCodec()),
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallErrorHandshake(
'Standard error($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
const MethodChannel channel = const MethodChannel(
const MethodChannel channel = MethodChannel(
'std-method',
const StandardMethodCodec(const ExtendedStandardMessageCodec()),
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallNotImplementedHandshake(
'Standard notImplemented()', channel);

View File

@ -25,8 +25,8 @@ const String nothing = '-';
/// - The Flutter app records the incoming reply echo.
/// - The platform finally replies to the original message with another echo.
class TestStepResult {
static const TextStyle bold = const TextStyle(fontWeight: FontWeight.bold);
static const TestStepResult complete = const TestStepResult(
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
static const TestStepResult complete = TestStepResult(
'Test complete',
nothing,
TestStatus.complete,

View File

@ -25,7 +25,7 @@ void main() {
if (status != 'complete') {
fail('Failed at step $step with status $status');
}
}, timeout: const Timeout(const Duration(minutes: 1)));
}, timeout: const Timeout(Duration(minutes: 1)));
tearDownAll(() async {
driver?.close();

View File

@ -19,7 +19,7 @@ class MyApp extends StatefulWidget {
State createState() => new MyAppState();
}
const MethodChannel channel = const MethodChannel('texture');
const MethodChannel channel = MethodChannel('texture');
enum FrameState { initial, slow, afterSlow, fast, afterFast }

View File

@ -8,7 +8,7 @@ import 'package:test/test.dart';
final RegExp calibrationRegExp = new RegExp('Flutter frame rate is (.*)fps');
final RegExp statsRegExp = new RegExp('Produced: (.*)fps\nConsumed: (.*)fps\nWidget builds: (.*)');
const Duration samplingTime = const Duration(seconds: 8);
const Duration samplingTime = Duration(seconds: 8);
Future<Null> main() async {
group('texture suite', () {
@ -58,7 +58,7 @@ Future<Null> main() async {
expect(double.parse(matchFast.group(1)), closeTo(flutterFrameRate * 2.0, 5.0));
expect(double.parse(matchFast.group(2)), closeTo(flutterFrameRate, 10.0));
expect(int.parse(matchFast.group(3)), 1);
}, timeout: const Timeout(const Duration(minutes: 1)));
}, timeout: const Timeout(Duration(minutes: 1)));
tearDownAll(() async {
driver?.close();

View File

@ -7,9 +7,9 @@ import 'package:flutter/services.dart';
import 'test_step.dart';
Future<TestStepResult> systemNavigatorPop() {
const BasicMessageChannel<String> channel = const BasicMessageChannel<String>(
const BasicMessageChannel<String> channel = BasicMessageChannel<String>(
'navigation-test',
const StringCodec(),
StringCodec(),
);
final Completer<TestStepResult> completer = new Completer<TestStepResult>();

View File

@ -13,8 +13,8 @@ typedef Future<TestStepResult> TestStep();
const String nothing = '-';
class TestStepResult {
static const TextStyle bold = const TextStyle(fontWeight: FontWeight.bold);
static const TestStepResult complete = const TestStepResult(
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
static const TestStepResult complete = TestStepResult(
'Test complete',
nothing,
TestStatus.complete,

View File

@ -40,7 +40,7 @@ class DriverTestAppState extends State<DriverTestApp> {
new RaisedButton(
child: const Text(
'toggle',
key: const ValueKey<String>('togglePresent'),
key: ValueKey<String>('togglePresent'),
),
onPressed: () {
setState(() {
@ -53,7 +53,7 @@ class DriverTestAppState extends State<DriverTestApp> {
new Row(
children: <Widget>[
const Expanded(
child: const Text('hit testability'),
child: Text('hit testability'),
),
new DropdownButton<Letter>(
key: const ValueKey<String>('dropdown'),
@ -64,24 +64,24 @@ class DriverTestAppState extends State<DriverTestApp> {
});
},
items: const <DropdownMenuItem<Letter>>[
const DropdownMenuItem<Letter>(
DropdownMenuItem<Letter>(
value: Letter.a,
child: const Text('Aaa', key: const ValueKey<String>('a')),
child: Text('Aaa', key: ValueKey<String>('a')),
),
const DropdownMenuItem<Letter>(
DropdownMenuItem<Letter>(
value: Letter.b,
child: const Text('Bbb', key: const ValueKey<String>('b')),
child: Text('Bbb', key: ValueKey<String>('b')),
),
const DropdownMenuItem<Letter>(
DropdownMenuItem<Letter>(
value: Letter.c,
child: const Text('Ccc', key: const ValueKey<String>('c')),
child: Text('Ccc', key: ValueKey<String>('c')),
),
],
),
],
),
const TextField(
key: const ValueKey<String>('enter-text-field'),
key: ValueKey<String>('enter-text-field'),
),
],
),

View File

@ -60,7 +60,7 @@ class _MyHomePageState extends State<MyHomePage> {
height: MediaQuery.of(context).size.height,
),
const TextField(
key: const ValueKey<String>(keys.kDefaultTextField),
key: ValueKey<String>(keys.kDefaultTextField),
),
],
),

View File

@ -4,7 +4,7 @@
import 'package:flutter/widgets.dart';
void main() => runApp(const Center(child: const Text(
void main() => runApp(const Center(child: Text(
'flutter drive lib/xxx.dart',
textDirection: TextDirection.ltr,
)));

View File

@ -41,6 +41,6 @@ void main() {
imageBefore = imageAfter;
}
}, timeout: const Timeout(const Duration(minutes: 2)));
}, timeout: const Timeout(Duration(minutes: 2)));
});
}

View File

@ -10,7 +10,7 @@ class AnimatedIconsTestApp extends StatelessWidget {
return new MaterialApp(
title: 'Animated Icons Test',
home: const Scaffold(
body: const IconsList(),
body: IconsList(),
),
);
}
@ -76,27 +76,27 @@ class IconSampleRowState extends State<IconSampleRow> with SingleTickerProviderS
}
}
const List<IconSample> samples = const <IconSample> [
const IconSample(AnimatedIcons.arrow_menu, 'arrow_menu'),
const IconSample(AnimatedIcons.menu_arrow, 'menu_arrow'),
const List<IconSample> samples = <IconSample> [
IconSample(AnimatedIcons.arrow_menu, 'arrow_menu'),
IconSample(AnimatedIcons.menu_arrow, 'menu_arrow'),
const IconSample(AnimatedIcons.close_menu, 'close_menu'),
const IconSample(AnimatedIcons.menu_close, 'menu_close'),
IconSample(AnimatedIcons.close_menu, 'close_menu'),
IconSample(AnimatedIcons.menu_close, 'menu_close'),
const IconSample(AnimatedIcons.home_menu, 'home_menu'),
const IconSample(AnimatedIcons.menu_home, 'menu_home'),
IconSample(AnimatedIcons.home_menu, 'home_menu'),
IconSample(AnimatedIcons.menu_home, 'menu_home'),
const IconSample(AnimatedIcons.play_pause, 'play_pause'),
const IconSample(AnimatedIcons.pause_play, 'pause_play'),
IconSample(AnimatedIcons.play_pause, 'play_pause'),
IconSample(AnimatedIcons.pause_play, 'pause_play'),
const IconSample(AnimatedIcons.list_view, 'list_view'),
const IconSample(AnimatedIcons.view_list, 'view_list'),
IconSample(AnimatedIcons.list_view, 'list_view'),
IconSample(AnimatedIcons.view_list, 'view_list'),
const IconSample(AnimatedIcons.add_event, 'add_event'),
const IconSample(AnimatedIcons.event_add, 'event_add'),
IconSample(AnimatedIcons.add_event, 'add_event'),
IconSample(AnimatedIcons.event_add, 'event_add'),
const IconSample(AnimatedIcons.ellipsis_search, 'ellipsis_search'),
const IconSample(AnimatedIcons.search_ellipsis, 'search_ellipsis'),
IconSample(AnimatedIcons.ellipsis_search, 'ellipsis_search'),
IconSample(AnimatedIcons.search_ellipsis, 'search_ellipsis'),
];
class IconSample {

View File

@ -26,14 +26,14 @@ class CardCollection extends StatefulWidget {
class CardCollectionState extends State<CardCollection> {
static const TextStyle cardLabelStyle =
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);
TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);
// TODO(hansmuller): need a local image asset
static const String _sunshineURL = 'http://www.walltor.com/images/wallpaper/good-morning-sunshine-58540.jpg';
static const double kCardMargins = 8.0;
static const double kFixedCardHeight = 100.0;
static const List<double> _cardHeights = const <double>[
static const List<double> _cardHeights = <double>[
48.0, 63.0, 85.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0,
48.0, 63.0, 85.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0,
48.0, 63.0, 85.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0,
@ -102,7 +102,7 @@ class CardCollectionState extends State<CardCollection> {
data: const IconThemeData(color: Colors.black),
child: new ListView(
children: <Widget>[
const DrawerHeader(child: const Center(child: const Text('Options'))),
const DrawerHeader(child: Center(child: Text('Options'))),
buildDrawerCheckbox('Make card labels editable', _editable, _toggleEditable),
buildDrawerCheckbox('Fixed size cards', _fixedSizeCards, _toggleFixedSizeCards),
buildDrawerCheckbox('Let the sun shine', _sunshine, _toggleSunshine),
@ -347,8 +347,8 @@ class CardCollectionState extends State<CardCollection> {
return const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: const <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
stops: const <double>[0.1, 0.35],
colors: <Color>[Color(0x00FFFFFF), Color(0xFFFFFFFF)],
stops: <double>[0.1, 0.35],
)
.createShader(bounds);
}

View File

@ -25,25 +25,25 @@ class ColorDemoHome extends StatelessWidget {
new Image.network('https://flutter.github.io/assets-for-api-docs/assets/tests/colors/gbr.png'),
new Image.network('https://flutter.github.io/assets-for-api-docs/assets/tests/colors/tf.png'),
new Image.network('https://flutter.github.io/assets-for-api-docs/assets/tests/colors/wide-gamut.png'),
const GradientRow(leftColor: const Color(0xFFFF0000), rightColor: const Color(0xFF00FF00)),
const GradientRow(leftColor: const Color(0xFF0000FF), rightColor: const Color(0xFFFFFF00)),
const GradientRow(leftColor: const Color(0xFFFF0000), rightColor: const Color(0xFF0000FF)),
const GradientRow(leftColor: const Color(0xFF00FF00), rightColor: const Color(0xFFFFFF00)),
const GradientRow(leftColor: const Color(0xFF0000FF), rightColor: const Color(0xFF00FF00)),
const GradientRow(leftColor: const Color(0xFFFF0000), rightColor: const Color(0xFFFFFF00)),
const GradientRow(leftColor: Color(0xFFFF0000), rightColor: Color(0xFF00FF00)),
const GradientRow(leftColor: Color(0xFF0000FF), rightColor: Color(0xFFFFFF00)),
const GradientRow(leftColor: Color(0xFFFF0000), rightColor: Color(0xFF0000FF)),
const GradientRow(leftColor: Color(0xFF00FF00), rightColor: Color(0xFFFFFF00)),
const GradientRow(leftColor: Color(0xFF0000FF), rightColor: Color(0xFF00FF00)),
const GradientRow(leftColor: Color(0xFFFF0000), rightColor: Color(0xFFFFFF00)),
// For the following pairs, the blend result should match the opaque color.
const ColorRow(color: const Color(0xFFBCBCBC)),
const ColorRow(color: const Color(0x80000000)),
const ColorRow(color: Color(0xFFBCBCBC)),
const ColorRow(color: Color(0x80000000)),
const ColorRow(color: const Color(0xFFFFBCBC)),
const ColorRow(color: const Color(0x80FF0000)),
const ColorRow(color: Color(0xFFFFBCBC)),
const ColorRow(color: Color(0x80FF0000)),
const ColorRow(color: const Color(0xFFBCFFBC)),
const ColorRow(color: const Color(0x8000FF00)),
const ColorRow(color: Color(0xFFBCFFBC)),
const ColorRow(color: Color(0x8000FF00)),
const ColorRow(color: const Color(0xFFBCBCFF)),
const ColorRow(color: const Color(0x800000FF)),
const ColorRow(color: Color(0xFFBCBCFF)),
const ColorRow(color: Color(0x800000FF)),
],
),
);

View File

@ -193,14 +193,14 @@ class MovableBall extends StatelessWidget {
color: Colors.blue.shade700,
size: kBallSize,
tappable: true,
child: const Center(child: const Text('BALL'))
child: const Center(child: Text('BALL'))
)
);
final Widget dashedBall = new Container(
width: kBallSize,
height: kBallSize,
child: const CustomPaint(
painter: const DashOutlineCirclePainter()
painter: DashOutlineCirclePainter()
)
);
if (position == ballPosition) {

View File

@ -4,4 +4,4 @@
import 'package:flutter/widgets.dart';
void main() => runApp(const Center(child: const Text('flutter run -t xxx.dart')));
void main() => runApp(const Center(child: Text('flutter run -t xxx.dart')));

View File

@ -101,7 +101,7 @@ class CardBuilder extends SliverChildDelegate {
final CardTapCallback onTapUp;
static const TextStyle cardLabelStyle =
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);
TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);
@override
Widget build(BuildContext context, int index) {

View File

@ -22,12 +22,12 @@ class PageViewAppState extends State<PageViewApp> {
@override
void initState() {
super.initState();
const List<Size> cardSizes = const <Size>[
const Size(100.0, 300.0),
const Size(300.0, 100.0),
const Size(200.0, 400.0),
const Size(400.0, 400.0),
const Size(300.0, 400.0),
const List<Size> cardSizes = <Size>[
Size(100.0, 300.0),
Size(300.0, 100.0),
Size(200.0, 400.0),
Size(400.0, 400.0),
Size(300.0, 400.0),
];
cardModels = new List<CardModel>.generate(cardSizes.length, (int i) {
@ -37,7 +37,7 @@ class PageViewAppState extends State<PageViewApp> {
}
static const TextStyle cardLabelStyle =
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);
TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);
List<CardModel> cardModels;
Size pageSize = const Size(200.0, 200.0);
@ -84,7 +84,7 @@ class PageViewAppState extends State<PageViewApp> {
return new Drawer(
child: new ListView(
children: <Widget>[
const DrawerHeader(child: const Center(child: const Text('Options'))),
const DrawerHeader(child: Center(child: Text('Options'))),
new ListTile(
leading: const Icon(Icons.more_horiz),
selected: scrollDirection == Axis.horizontal,

View File

@ -13,7 +13,7 @@ void main() {
title: const Text('Hardware Key Demo'),
),
body: const Center(
child: const RawKeyboardDemo(),
child: RawKeyboardDemo(),
),
),
));

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ const String kDefaultIconsPath = 'packages/flutter/lib/src/material/icons.dart';
const String kBeginGeneratedMark = '// BEGIN GENERATED';
const String kEndGeneratedMark = '// END GENERATED';
const Map<String, String> kIdentifierRewrites = const <String, String>{
const Map<String, String> kIdentifierRewrites = <String, String>{
'360': 'threesixty',
'3d_rotation': 'threed_rotation',
'4k': 'four_k',

View File

@ -73,7 +73,7 @@ class PathAnimation {
factory PathAnimation.fromFrameData(List<FrameData> frames, int pathIdx) {
if (frames.isEmpty)
return const PathAnimation(const <PathCommandAnimation>[], opacities: const <double>[]);
return const PathAnimation(<PathCommandAnimation>[], opacities: <double>[]);
final List<PathCommandAnimation> commands = <PathCommandAnimation>[];
for (int commandIdx = 0; commandIdx < frames[0].paths[pathIdx].commands.length; commandIdx += 1) {
@ -386,7 +386,7 @@ class SvgPathCommand {
}
class SvgPathCommandBuilder {
static const Map<String, Null> kRelativeCommands = const <String, Null> {
static const Map<String, Null> kRelativeCommands = <String, Null> {
'c': null,
'l': null,
'm': null,

View File

@ -21,18 +21,18 @@ void main() {
test('parsePoints', () {
expect(parsePoints('1.0, 2.0'),
const <Point<double>>[const Point<double>(1.0, 2.0)]
const <Point<double>>[Point<double>(1.0, 2.0)]
);
expect(parsePoints('12.0, 34.0 5.0, 6.6'),
const <Point<double>>[
const Point<double>(12.0, 34.0),
const Point<double>(5.0, 6.6),
Point<double>(12.0, 34.0),
Point<double>(5.0, 6.6),
]
);
expect(parsePoints('12.0 34.0 5.0 6.6'),
const <Point<double>>[
const Point<double>(12.0, 34.0),
const Point<double>(5.0, 6.6),
Point<double>(12.0, 34.0),
Point<double>(5.0, 6.6),
]
);
});
@ -65,12 +65,12 @@ void main() {
test('horizontal bar', () {
final FrameData frameData = interpretSvg(testAsset('horizontal_bar.svg'));
expect(frameData.paths, <SvgPath>[
const SvgPath('path_1', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 29.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 29.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
const SvgPath('path_1', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 29.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 29.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
]);
});
@ -90,19 +90,19 @@ void main() {
test('SVG group', () {
final FrameData frameData = interpretSvg(testAsset('bars_group.svg'));
expect(frameData.paths, const <SvgPath>[
const SvgPath('path_1', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 29.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 29.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
SvgPath('path_1', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 29.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 29.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
const SvgPath('path_2', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 34.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 34.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 44.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 44.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
SvgPath('path_2', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 34.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 34.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 44.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 44.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
]);
});
@ -110,12 +110,12 @@ void main() {
test('SVG group translate', () {
final FrameData frameData = interpretSvg(testAsset('bar_group_translate.svg'));
expect(frameData.paths, const <SvgPath>[
const SvgPath('path_1', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 34.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 34.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 44.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 44.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
SvgPath('path_1', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 34.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 34.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 44.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 44.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
]);
});
@ -123,13 +123,13 @@ void main() {
test('SVG group scale', () {
final FrameData frameData = interpretSvg(testAsset('bar_group_scale.svg'));
expect(frameData.paths, const <SvgPath>[
const SvgPath(
'path_1', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 9.5)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(24.0, 9.5)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(24.0, 14.5)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 14.5)]),
const SvgPathCommand('Z', const <Point<double>>[]),
SvgPath(
'path_1', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 9.5)]),
SvgPathCommand('L', <Point<double>>[Point<double>(24.0, 9.5)]),
SvgPathCommand('L', <Point<double>>[Point<double>(24.0, 14.5)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 14.5)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
]);
});
@ -137,14 +137,14 @@ void main() {
test('SVG group rotate scale', () {
final FrameData frameData = interpretSvg(testAsset('bar_group_rotate_scale.svg'));
expect(frameData.paths, const <PathMatcher>[
const PathMatcher(
const SvgPath(
'path_1', const<SvgPathCommand>[
const SvgPathCommand('L', const <Point<double>>[const Point<double>(29.0, 0.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(29.0, 48.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(19.0, 48.0)]),
const SvgPathCommand('M', const <Point<double>>[const Point<double>(19.0, 0.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
PathMatcher(
SvgPath(
'path_1', <SvgPathCommand>[
SvgPathCommand('L', <Point<double>>[Point<double>(29.0, 0.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(29.0, 48.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(19.0, 48.0)]),
SvgPathCommand('M', <Point<double>>[Point<double>(19.0, 0.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
margin: 0.000000001
)
@ -161,14 +161,14 @@ void main() {
test('SVG group opacity', () {
final FrameData frameData = interpretSvg(testAsset('bar_group_opacity.svg'));
expect(frameData.paths, const <SvgPath>[
const SvgPath(
SvgPath(
'path_1',
const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 29.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 29.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 29.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 29.0)]),
SvgPathCommand('Z', <Point<double>>[]),
],
opacity: 0.5,
),
@ -179,13 +179,13 @@ void main() {
// This asset uses the relative 'l' command instead of 'L'.
final FrameData frameData = interpretSvg(testAsset('horizontal_bar_relative.svg'));
expect(frameData.paths, const <SvgPath>[
const SvgPath(
'path_1', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 19.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(48.0, 29.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(0.0, 29.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
SvgPath(
'path_1', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 19.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(48.0, 29.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(0.0, 29.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
]);
});
@ -194,15 +194,15 @@ void main() {
// This asset uses the relative 'l' command instead of 'L'.
final FrameData frameData = interpretSvg(testAsset('close_path_in_middle.svg'));
expect(frameData.paths, const <SvgPath>[
const SvgPath(
'path_1', const<SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(50.0, 50.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(60.0, 50.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(60.0, 60.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(50.0, 40.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(40.0, 40.0)]),
const SvgPathCommand('Z', const <Point<double>>[]),
SvgPath(
'path_1', <SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(50.0, 50.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(60.0, 50.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(60.0, 60.0)]),
SvgPathCommand('Z', <Point<double>>[]),
SvgPathCommand('L', <Point<double>>[Point<double>(50.0, 40.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(40.0, 40.0)]),
SvgPathCommand('Z', <Point<double>>[]),
]),
]);
});
@ -210,115 +210,115 @@ void main() {
group('create PathAnimation', () {
test('single path', () {
const List<FrameData> frameData = const <FrameData>[
const FrameData(
const Point<double>(10.0, 10.0),
const <SvgPath>[
const SvgPath(
const List<FrameData> frameData = <FrameData>[
FrameData(
Point<double>(10.0, 10.0),
<SvgPath>[
SvgPath(
'path_1',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 0.0)]),
const SvgPathCommand('L', const <Point<double>>[const Point<double>(10.0, 10.0)]),
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 0.0)]),
SvgPathCommand('L', <Point<double>>[Point<double>(10.0, 10.0)]),
],
),
],
),
];
expect(new PathAnimation.fromFrameData(frameData, 0),
const PathAnimationMatcher(const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[const Point<double>(0.0, 0.0)],
const PathAnimationMatcher(PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[Point<double>(0.0, 0.0)],
]),
const PathCommandAnimation('L', const <List<Point<double>>>[
const <Point<double>>[const Point<double>(10.0, 10.0)],
PathCommandAnimation('L', <List<Point<double>>>[
<Point<double>>[Point<double>(10.0, 10.0)],
]),
],
opacities: const <double>[1.0]
opacities: <double>[1.0]
))
);
});
test('multiple paths', () {
const List<FrameData> frameData = const <FrameData>[
const FrameData(
const Point<double>(10.0, 10.0),
const <SvgPath>[
const SvgPath(
const List<FrameData> frameData = <FrameData>[
FrameData(
Point<double>(10.0, 10.0),
<SvgPath>[
SvgPath(
'path_1',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 0.0)]),
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 0.0)]),
],
),
const SvgPath(
SvgPath(
'path_2',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(5.0, 6.0)]),
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(5.0, 6.0)]),
],
),
],
),
];
expect(new PathAnimation.fromFrameData(frameData, 0),
const PathAnimationMatcher(const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[const Point<double>(0.0, 0.0)],
const PathAnimationMatcher(PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[Point<double>(0.0, 0.0)],
])
],
opacities: const <double>[1.0]
opacities: <double>[1.0]
))
);
expect(new PathAnimation.fromFrameData(frameData, 1),
const PathAnimationMatcher(const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[const Point<double>(5.0, 6.0)],
const PathAnimationMatcher(PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[Point<double>(5.0, 6.0)],
])
],
opacities: const <double>[1.0]
opacities: <double>[1.0]
))
);
});
test('multiple frames', () {
const List<FrameData> frameData = const <FrameData>[
const FrameData(
const Point<double>(10.0, 10.0),
const <SvgPath>[
const SvgPath(
const List<FrameData> frameData = <FrameData>[
FrameData(
Point<double>(10.0, 10.0),
<SvgPath>[
SvgPath(
'path_1',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 0.0)])
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 0.0)])
],
opacity: 0.5,
),
],
),
const FrameData(
const Point<double>(10.0, 10.0),
const <SvgPath>[
const SvgPath(
FrameData(
Point<double>(10.0, 10.0),
<SvgPath>[
SvgPath(
'path_1',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(10.0, 10.0)])
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(10.0, 10.0)])
],
),
],
),
];
expect(new PathAnimation.fromFrameData(frameData, 0),
const PathAnimationMatcher(const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(0.0, 0.0),
const Point<double>(10.0, 10.0),
const PathAnimationMatcher(PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[
Point<double>(0.0, 0.0),
Point<double>(10.0, 10.0),
],
]),
],
opacities: const <double>[0.5, 1.0]
opacities: <double>[0.5, 1.0]
))
);
});
@ -326,20 +326,20 @@ void main() {
group('create Animation', () {
test('multiple paths', () {
const List<FrameData> frameData = const <FrameData>[
const FrameData(
const Point<double>(10.0, 10.0),
const <SvgPath>[
const SvgPath(
const List<FrameData> frameData = <FrameData>[
FrameData(
Point<double>(10.0, 10.0),
<SvgPath>[
SvgPath(
'path_1',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(0.0, 0.0)]),
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(0.0, 0.0)]),
],
),
const SvgPath(
SvgPath(
'path_1',
const <SvgPathCommand>[
const SvgPathCommand('M', const <Point<double>>[const Point<double>(5.0, 6.0)]),
<SvgPathCommand>[
SvgPathCommand('M', <Point<double>>[Point<double>(5.0, 6.0)]),
],
),
],
@ -347,24 +347,24 @@ void main() {
];
final Animation animation = new Animation.fromFrameData(frameData);
expect(animation.paths[0],
const PathAnimationMatcher(const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[const Point<double>(0.0, 0.0)],
const PathAnimationMatcher(PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[Point<double>(0.0, 0.0)],
])
],
opacities: const <double>[1.0]
opacities: <double>[1.0]
))
);
expect(animation.paths[1],
const PathAnimationMatcher(const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[const Point<double>(5.0, 6.0)],
const PathAnimationMatcher(PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[Point<double>(5.0, 6.0)],
])
],
opacities: const <double>[1.0]
opacities: <double>[1.0]
))
);
@ -374,12 +374,12 @@ void main() {
group('toDart', () {
test('_PathMoveTo', () {
const PathCommandAnimation command = const PathCommandAnimation(
const PathCommandAnimation command = PathCommandAnimation(
'M',
const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(1.0, 2.0),
const Point<double>(3.0, 4.0),
<List<Point<double>>>[
<Point<double>>[
Point<double>(1.0, 2.0),
Point<double>(3.0, 4.0),
],
],
);
@ -396,12 +396,12 @@ void main() {
});
test('_PathLineTo', () {
const PathCommandAnimation command = const PathCommandAnimation(
const PathCommandAnimation command = PathCommandAnimation(
'L',
const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(1.0, 2.0),
const Point<double>(3.0, 4.0),
<List<Point<double>>>[
<Point<double>>[
Point<double>(1.0, 2.0),
Point<double>(3.0, 4.0),
],
],
);
@ -418,20 +418,20 @@ void main() {
});
test('_PathCubicTo', () {
const PathCommandAnimation command = const PathCommandAnimation(
const PathCommandAnimation command = PathCommandAnimation(
'C',
const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(16.0, 24.0),
const Point<double>(16.0, 10.0),
<List<Point<double>>>[
<Point<double>>[
Point<double>(16.0, 24.0),
Point<double>(16.0, 10.0),
],
const <Point<double>>[
const Point<double>(16.0, 25.0),
const Point<double>(16.0, 11.0),
<Point<double>>[
Point<double>(16.0, 25.0),
Point<double>(16.0, 11.0),
],
const <Point<double>>[
const Point<double>(40.0, 40.0),
const Point<double>(40.0, 40.0),
<Point<double>>[
Point<double>(40.0, 40.0),
Point<double>(40.0, 40.0),
],
],
);
@ -456,9 +456,9 @@ void main() {
});
test('_PathClose', () {
const PathCommandAnimation command = const PathCommandAnimation(
const PathCommandAnimation command = PathCommandAnimation(
'Z',
const <List<Point<double>>>[],
<List<Point<double>>>[],
);
expect(command.toDart(),
@ -469,9 +469,9 @@ void main() {
});
test('Unsupported path command', () {
const PathCommandAnimation command = const PathCommandAnimation(
const PathCommandAnimation command = PathCommandAnimation(
'h',
const <List<Point<double>>>[],
<List<Point<double>>>[],
);
expect(
@ -481,22 +481,22 @@ void main() {
});
test('_PathFrames', () {
const PathAnimation pathAnimation = const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(0.0, 0.0),
const Point<double>(10.0, 10.0),
const PathAnimation pathAnimation = PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[
Point<double>(0.0, 0.0),
Point<double>(10.0, 10.0),
],
]),
const PathCommandAnimation('L', const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(48.0, 10.0),
const Point<double>(0.0, 0.0),
PathCommandAnimation('L', <List<Point<double>>>[
<Point<double>>[
Point<double>(48.0, 10.0),
Point<double>(0.0, 0.0),
],
]),
],
opacities: const <double>[0.5, 1.0]
opacities: <double>[0.5, 1.0]
);
expect(pathAnimation.toDart(),
@ -524,37 +524,37 @@ void main() {
});
test('Animation', () {
const Animation animation = const Animation(
const Point<double>(48.0, 48.0),
const <PathAnimation>[
const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(0.0, 0.0),
const Point<double>(10.0, 10.0),
const Animation animation = Animation(
Point<double>(48.0, 48.0),
<PathAnimation>[
PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[
Point<double>(0.0, 0.0),
Point<double>(10.0, 10.0),
],
]),
const PathCommandAnimation('L', const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(48.0, 10.0),
const Point<double>(0.0, 0.0),
PathCommandAnimation('L', <List<Point<double>>>[
<Point<double>>[
Point<double>(48.0, 10.0),
Point<double>(0.0, 0.0),
],
]),
],
opacities: const <double>[0.5, 1.0]
opacities: <double>[0.5, 1.0]
),
const PathAnimation(
const <PathCommandAnimation>[
const PathCommandAnimation('M', const <List<Point<double>>>[
const <Point<double>>[
const Point<double>(0.0, 0.0),
const Point<double>(10.0, 10.0),
PathAnimation(
<PathCommandAnimation>[
PathCommandAnimation('M', <List<Point<double>>>[
<Point<double>>[
Point<double>(0.0, 0.0),
Point<double>(10.0, 10.0),
],
]),
],
opacities: const <double>[0.5, 1.0]
opacities: <double>[0.5, 1.0]
),
]);

View File

@ -81,13 +81,13 @@ class Choice {
final IconData icon;
}
const List<Choice> choices = const <Choice>[
const Choice(title: 'CAR', icon: Icons.directions_car),
const Choice(title: 'BICYCLE', icon: Icons.directions_bike),
const Choice(title: 'BOAT', icon: Icons.directions_boat),
const Choice(title: 'BUS', icon: Icons.directions_bus),
const Choice(title: 'TRAIN', icon: Icons.directions_railway),
const Choice(title: 'WALK', icon: Icons.directions_walk),
const List<Choice> choices = <Choice>[
Choice(title: 'CAR', icon: Icons.directions_car),
Choice(title: 'BICYCLE', icon: Icons.directions_bike),
Choice(title: 'BOAT', icon: Icons.directions_boat),
Choice(title: 'BUS', icon: Icons.directions_bus),
Choice(title: 'TRAIN', icon: Icons.directions_railway),
Choice(title: 'WALK', icon: Icons.directions_walk),
];
class ChoiceCard extends StatelessWidget {

View File

@ -62,13 +62,13 @@ class Choice {
final IconData icon;
}
const List<Choice> choices = const <Choice>[
const Choice(title: 'Car', icon: Icons.directions_car),
const Choice(title: 'Bicycle', icon: Icons.directions_bike),
const Choice(title: 'Boat', icon: Icons.directions_boat),
const Choice(title: 'Bus', icon: Icons.directions_bus),
const Choice(title: 'Train', icon: Icons.directions_railway),
const Choice(title: 'Walk', icon: Icons.directions_walk),
const List<Choice> choices = <Choice>[
Choice(title: 'Car', icon: Icons.directions_car),
Choice(title: 'Bicycle', icon: Icons.directions_bike),
Choice(title: 'Boat', icon: Icons.directions_boat),
Choice(title: 'Bus', icon: Icons.directions_bus),
Choice(title: 'Train', icon: Icons.directions_railway),
Choice(title: 'Walk', icon: Icons.directions_walk),
];
class ChoiceCard extends StatelessWidget {

View File

@ -261,7 +261,7 @@ class CustomTraversalExampleState extends State<CustomTraversalExample> {
'How many pets do you own?',
),
),
const Padding(padding: const EdgeInsets.symmetric(vertical: 10.0)),
const Padding(padding: EdgeInsets.symmetric(vertical: 10.0)),
new Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
@ -294,7 +294,7 @@ class CustomTraversalExampleState extends State<CustomTraversalExample> {
_makeSpinnerButton(4, 2, Field.FISH, increment: false),
],
),
const Padding(padding: const EdgeInsets.symmetric(vertical: 10.0)),
const Padding(padding: EdgeInsets.symmetric(vertical: 10.0)),
new Semantics(
// Since this is the only sort key that the reset button has, it
// will be compared with the 'column' OrdinalSortKeys of all the

View File

@ -8,8 +8,8 @@ void main() {
runApp(
const Directionality(
textDirection: TextDirection.ltr,
child: const Center(
child: const Text('flutter run -t lib/xxx.dart'),
child: Center(
child: Text('flutter run -t lib/xxx.dart'),
),
),
);

View File

@ -43,13 +43,13 @@ class Choice {
final IconData icon;
}
const List<Choice> choices = const <Choice>[
const Choice(title: 'CAR', icon: Icons.directions_car),
const Choice(title: 'BICYCLE', icon: Icons.directions_bike),
const Choice(title: 'BOAT', icon: Icons.directions_boat),
const Choice(title: 'BUS', icon: Icons.directions_bus),
const Choice(title: 'TRAIN', icon: Icons.directions_railway),
const Choice(title: 'WALK', icon: Icons.directions_walk),
const List<Choice> choices = <Choice>[
Choice(title: 'CAR', icon: Icons.directions_car),
Choice(title: 'BICYCLE', icon: Icons.directions_bike),
Choice(title: 'BOAT', icon: Icons.directions_boat),
Choice(title: 'BUS', icon: Icons.directions_bus),
Choice(title: 'TRAIN', icon: Icons.directions_railway),
Choice(title: 'WALK', icon: Icons.directions_walk),
];
class ChoiceCard extends StatelessWidget {

View File

@ -13,8 +13,8 @@ import 'package:flutter/rendering.dart';
import 'sections.dart';
import 'widgets.dart';
const Color _kAppBackgroundColor = const Color(0xFF353662);
const Duration _kScrollDuration = const Duration(milliseconds: 400);
const Color _kAppBackgroundColor = Color(0xFF353662);
const Duration _kScrollDuration = Duration(milliseconds: 400);
const Curve _kScrollCurve = Curves.fastOutSlowIn;
// This app's contents start out at _kHeadingMaxHeight and they function like

View File

@ -6,10 +6,10 @@
import 'package:flutter/material.dart';
const Color _mariner = const Color(0xFF3B5F8F);
const Color _mediumPurple = const Color(0xFF8266D4);
const Color _tomato = const Color(0xFFF95B57);
const Color _mySin = const Color(0xFFF3A646);
const Color _mariner = Color(0xFF3B5F8F);
const Color _mediumPurple = Color(0xFF8266D4);
const Color _tomato = Color(0xFFF95B57);
const Color _mySin = Color(0xFFF3A646);
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
@ -58,50 +58,50 @@ class Section {
// the const vars like _eyeglassesDetail and insert a variety of titles and
// image SectionDetails in the allSections list.
const SectionDetail _eyeglassesDetail = const SectionDetail(
const SectionDetail _eyeglassesDetail = SectionDetail(
imageAsset: 'products/sunnies.png',
imageAssetPackage: _kGalleryAssetsPackage,
title: 'Flutter enables interactive animation',
subtitle: '3K views - 5 days',
);
const SectionDetail _eyeglassesImageDetail = const SectionDetail(
const SectionDetail _eyeglassesImageDetail = SectionDetail(
imageAsset: 'products/sunnies.png',
imageAssetPackage: _kGalleryAssetsPackage,
);
const SectionDetail _seatingDetail = const SectionDetail(
const SectionDetail _seatingDetail = SectionDetail(
imageAsset: 'products/table.png',
imageAssetPackage: _kGalleryAssetsPackage,
title: 'Flutter enables interactive animation',
subtitle: '3K views - 5 days',
);
const SectionDetail _seatingImageDetail = const SectionDetail(
const SectionDetail _seatingImageDetail = SectionDetail(
imageAsset: 'products/table.png',
imageAssetPackage: _kGalleryAssetsPackage,
);
const SectionDetail _decorationDetail = const SectionDetail(
const SectionDetail _decorationDetail = SectionDetail(
imageAsset: 'products/earrings.png',
imageAssetPackage: _kGalleryAssetsPackage,
title: 'Flutter enables interactive animation',
subtitle: '3K views - 5 days',
);
const SectionDetail _decorationImageDetail = const SectionDetail(
const SectionDetail _decorationImageDetail = SectionDetail(
imageAsset: 'products/earrings.png',
imageAssetPackage: _kGalleryAssetsPackage,
);
const SectionDetail _protectionDetail = const SectionDetail(
const SectionDetail _protectionDetail = SectionDetail(
imageAsset: 'products/hat.png',
imageAssetPackage: _kGalleryAssetsPackage,
title: 'Flutter enables interactive animation',
subtitle: '3K views - 5 days',
);
const SectionDetail _protectionImageDetail = const SectionDetail(
const SectionDetail _protectionImageDetail = SectionDetail(
imageAsset: 'products/hat.png',
imageAssetPackage: _kGalleryAssetsPackage,
);
@ -113,7 +113,7 @@ final List<Section> allSections = <Section>[
rightColor: _mariner,
backgroundAsset: 'products/sunnies.png',
backgroundAssetPackage: _kGalleryAssetsPackage,
details: const <SectionDetail>[
details: <SectionDetail>[
_eyeglassesDetail,
_eyeglassesImageDetail,
_eyeglassesDetail,
@ -128,7 +128,7 @@ final List<Section> allSections = <Section>[
rightColor: _mediumPurple,
backgroundAsset: 'products/table.png',
backgroundAssetPackage: _kGalleryAssetsPackage,
details: const <SectionDetail>[
details: <SectionDetail>[
_seatingDetail,
_seatingImageDetail,
_seatingDetail,
@ -143,7 +143,7 @@ final List<Section> allSections = <Section>[
rightColor: _tomato,
backgroundAsset: 'products/earrings.png',
backgroundAssetPackage: _kGalleryAssetsPackage,
details: const <SectionDetail>[
details: <SectionDetail>[
_decorationDetail,
_decorationImageDetail,
_decorationDetail,
@ -158,7 +158,7 @@ final List<Section> allSections = <Section>[
rightColor: _tomato,
backgroundAsset: 'products/hat.png',
backgroundAssetPackage: _kGalleryAssetsPackage,
details: const <SectionDetail>[
details: <SectionDetail>[
_protectionDetail,
_protectionImageDetail,
_protectionDetail,

View File

@ -47,7 +47,7 @@ class SectionCard extends StatelessWidget {
// The title is rendered with two overlapping text widgets that are vertically
// offset a little. It's supposed to look sort-of 3D.
class SectionTitle extends StatelessWidget {
static const TextStyle sectionTitleStyle = const TextStyle(
static const TextStyle sectionTitleStyle = TextStyle(
fontFamily: 'Raleway',
inherit: false,
fontSize: 24.0,

View File

@ -83,8 +83,8 @@ class ColorItem extends StatelessWidget {
}
class PaletteTabView extends StatelessWidget {
static const List<int> primaryKeys = const <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
static const List<int> accentKeys = const <int>[100, 200, 400, 700];
static const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
static const List<int> accentKeys = <int>[100, 200, 400, 700];
PaletteTabView({
Key key,

View File

@ -125,7 +125,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Edit',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: const 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: const Text('App bar scrolls away')
child: Text('App bar scrolls away')
),
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.pinned,
child: const Text('App bar stays put')
child: Text('App bar stays put')
),
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.floating,
child: const Text('App bar floats')
child: Text('App bar floats')
),
const PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.snapping,
child: const Text('App bar snaps')
child: Text('App bar snaps')
),
],
),
@ -169,11 +169,11 @@ class ContactsDemoState extends State<ContactsDemo> {
// This gradient ensures that the toolbar icons are distinct
// against the background image.
const DecoratedBox(
decoration: const BoxDecoration(
gradient: const LinearGradient(
begin: const Alignment(0.0, -1.0),
end: const Alignment(0.0, -0.4),
colors: const <Color>[const Color(0x60000000), const Color(0x00000000)],
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(0.0, -1.0),
end: Alignment(0.0, -0.4),
colors: <Color>[Color(0x60000000), Color(0x00000000)],
),
),
),
@ -193,7 +193,7 @@ class ContactsDemoState extends State<ContactsDemo> {
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: const 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: const 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: const 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: const 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: const 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: const 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: const 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: const 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

@ -15,7 +15,7 @@ class CupertinoProgressIndicatorDemo extends StatelessWidget {
title: const Text('Cupertino Activity Indicator'),
),
body: const Center(
child: const CupertinoActivityIndicator(),
child: CupertinoActivityIndicator(),
),
);
}

View File

@ -24,8 +24,8 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
body: new Column(
children: <Widget> [
const Padding(
padding: const EdgeInsets.all(16.0),
child: const Text(
padding: EdgeInsets.all(16.0),
child: Text(
'iOS themed buttons are flat. They can have borders or backgrounds but '
'only when necessary.'
),
@ -37,7 +37,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
new Text(_pressedCount > 0
? 'Button pressed $_pressedCount time${_pressedCount == 1 ? "" : "s"}'
: ' '),
const Padding(padding: const EdgeInsets.all(12.0)),
const Padding(padding: EdgeInsets.all(12.0)),
new Align(
alignment: const Alignment(0.0, -0.2),
child: new Row(
@ -50,13 +50,13 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
}
),
const CupertinoButton(
child: const Text('Disabled'),
child: Text('Disabled'),
onPressed: null,
),
],
),
),
const Padding(padding: const EdgeInsets.all(12.0)),
const Padding(padding: EdgeInsets.all(12.0)),
new CupertinoButton(
child: const Text('With Background'),
color: CupertinoColors.activeBlue,
@ -64,9 +64,9 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
setState(() { _pressedCount += 1; });
}
),
const Padding(padding: const EdgeInsets.all(12.0)),
const Padding(padding: EdgeInsets.all(12.0)),
const CupertinoButton(
child: const Text('Disabled'),
child: Text('Disabled'),
color: CupertinoColors.activeBlue,
onPressed: null,
),

View File

@ -70,7 +70,7 @@ class _CupertinoDialogDemoState extends State<CupertinoDialogDemo> {
);
},
),
const Padding(padding: const EdgeInsets.all(8.0)),
const Padding(padding: EdgeInsets.all(8.0)),
new CupertinoButton(
child: const Text('Alert with Title'),
color: CupertinoColors.activeBlue,
@ -100,7 +100,7 @@ class _CupertinoDialogDemoState extends State<CupertinoDialogDemo> {
);
},
),
const Padding(padding: const EdgeInsets.all(8.0)),
const Padding(padding: EdgeInsets.all(8.0)),
new CupertinoButton(
child: const Text('Alert with Buttons'),
color: CupertinoColors.activeBlue,
@ -109,15 +109,15 @@ class _CupertinoDialogDemoState extends State<CupertinoDialogDemo> {
showDemoDialog<String>(
context: context,
child: const CupertinoDessertDialog(
title: const Text('Select Favorite Dessert'),
content: const Text('Please select your favorite type of dessert from the '
title: Text('Select Favorite Dessert'),
content: Text('Please select your favorite type of dessert from the '
'list below. Your selection will be used to customize the suggested '
'list of eateries in your area.'),
),
);
},
),
const Padding(padding: const EdgeInsets.all(8.0)),
const Padding(padding: EdgeInsets.all(8.0)),
new CupertinoButton(
child: const Text('Alert Buttons Only'),
color: CupertinoColors.activeBlue,

View File

@ -10,18 +10,18 @@ import 'package:flutter/material.dart';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
const List<Color> coolColors = const <Color>[
const Color.fromARGB(255, 255, 59, 48),
const Color.fromARGB(255, 255, 149, 0),
const Color.fromARGB(255, 255, 204, 0),
const Color.fromARGB(255, 76, 217, 100),
const Color.fromARGB(255, 90, 200, 250),
const Color.fromARGB(255, 0, 122, 255),
const Color.fromARGB(255, 88, 86, 214),
const Color.fromARGB(255, 255, 45, 85),
const List<Color> coolColors = <Color>[
Color.fromARGB(255, 255, 59, 48),
Color.fromARGB(255, 255, 149, 0),
Color.fromARGB(255, 255, 204, 0),
Color.fromARGB(255, 76, 217, 100),
Color.fromARGB(255, 90, 200, 250),
Color.fromARGB(255, 0, 122, 255),
Color.fromARGB(255, 88, 86, 214),
Color.fromARGB(255, 255, 45, 85),
];
const List<String> coolColorNames = const <String>[
const List<String> coolColorNames = <String>[
'Sarcoline', 'Coquelicot', 'Smaragdine', 'Mikado', 'Glaucous', 'Wenge',
'Fulvous', 'Xanadu', 'Falu', 'Eburnean', 'Amaranth', 'Australien',
'Banan', 'Falu', 'Gingerline', 'Incarnadine', 'Labrador', 'Nattier',
@ -50,17 +50,17 @@ class CupertinoNavigationDemo extends StatelessWidget {
child: new CupertinoTabScaffold(
tabBar: new CupertinoTabBar(
items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem(
icon: const Icon(CupertinoIcons.home),
title: const Text('Home'),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.home),
title: Text('Home'),
),
const BottomNavigationBarItem(
icon: const Icon(CupertinoIcons.conversation_bubble),
title: const Text('Support'),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.conversation_bubble),
title: Text('Support'),
),
const BottomNavigationBarItem(
icon: const Icon(CupertinoIcons.profile_circled),
title: const Text('Profile'),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.profile_circled),
title: Text('Profile'),
),
],
),
@ -106,7 +106,7 @@ class ExitButton extends StatelessWidget {
padding: EdgeInsets.zero,
child: const Tooltip(
message: 'Back',
child: const Text('Exit'),
child: Text('Exit'),
excludeFromSemantics: true,
),
onPressed: () {
@ -129,8 +129,8 @@ class CupertinoDemoTab1 extends StatelessWidget {
child: new CustomScrollView(
slivers: <Widget>[
const CupertinoSliverNavigationBar(
largeTitle: const Text('Colors'),
trailing: const ExitButton(),
largeTitle: Text('Colors'),
trailing: ExitButton(),
),
new SliverPadding(
// Top media padding consumed by CupertinoSliverNavigationBar.
@ -203,11 +203,11 @@ class Tab1RowItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Text(colorName),
const Padding(padding: const EdgeInsets.only(top: 8.0)),
const Padding(padding: EdgeInsets.only(top: 8.0)),
const Text(
'Buy this cool color',
style: const TextStyle(
color: const Color(0xFF8E8E93),
style: TextStyle(
color: Color(0xFF8E8E93),
fontSize: 13.0,
fontWeight: FontWeight.w300,
),
@ -294,7 +294,7 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
bottom: false,
child: new ListView(
children: <Widget>[
const Padding(padding: const EdgeInsets.only(top: 16.0)),
const Padding(padding: EdgeInsets.only(top: 16.0)),
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Row(
@ -308,7 +308,7 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
borderRadius: new BorderRadius.circular(24.0),
),
),
const Padding(padding: const EdgeInsets.only(left: 18.0)),
const Padding(padding: EdgeInsets.only(left: 18.0)),
new Expanded(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -318,16 +318,16 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
widget.colorName,
style: const TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
),
const Padding(padding: const EdgeInsets.only(top: 6.0)),
const Padding(padding: EdgeInsets.only(top: 6.0)),
new Text(
'Item number ${widget.index}',
style: const TextStyle(
color: const Color(0xFF8E8E93),
color: Color(0xFF8E8E93),
fontSize: 16.0,
fontWeight: FontWeight.w100,
),
),
const Padding(padding: const EdgeInsets.only(top: 20.0)),
const Padding(padding: EdgeInsets.only(top: 20.0)),
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@ -338,7 +338,7 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
borderRadius: new BorderRadius.circular(32.0),
child: const Text(
'GET',
style: const TextStyle(
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w700,
letterSpacing: -0.28,
@ -363,11 +363,11 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
),
),
const Padding(
padding: const EdgeInsets.only(left: 16.0, top: 28.0, bottom: 8.0),
child: const Text(
padding: EdgeInsets.only(left: 16.0, top: 28.0, bottom: 8.0),
child: Text(
'USERS ALSO LIKED',
style: const TextStyle(
color: const Color(0xFF646464),
style: TextStyle(
color: Color(0xFF646464),
letterSpacing: -0.60,
fontSize: 15.0,
fontWeight: FontWeight.w500,
@ -415,8 +415,8 @@ class CupertinoDemoTab2 extends StatelessWidget {
Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: const Text('Support Chat'),
trailing: const ExitButton(),
middle: Text('Support Chat'),
trailing: ExitButton(),
),
child: new ListView(
children: <Widget>[
@ -436,32 +436,32 @@ class Tab2Header extends StatelessWidget {
top: false,
bottom: false,
child: new ClipRRect(
borderRadius: const BorderRadius.all(const Radius.circular(16.0)),
borderRadius: const BorderRadius.all(Radius.circular(16.0)),
child: new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Container(
decoration: const BoxDecoration(
color: const Color(0xFFE5E5E5),
color: Color(0xFFE5E5E5),
),
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[
const Text(
Text(
'SUPPORT TICKET',
style: const TextStyle(
color: const Color(0xFF646464),
style: TextStyle(
color: Color(0xFF646464),
letterSpacing: -0.9,
fontSize: 14.0,
fontWeight: FontWeight.w500,
),
),
const Text(
Text(
'Show More',
style: const TextStyle(
color: const Color(0xFF646464),
style: TextStyle(
color: Color(0xFF646464),
letterSpacing: -0.6,
fontSize: 12.0,
fontWeight: FontWeight.w500,
@ -473,7 +473,7 @@ class Tab2Header extends StatelessWidget {
),
new Container(
decoration: const BoxDecoration(
color: const Color(0xFFF3F3F3),
color: Color(0xFFF3F3F3),
),
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0),
@ -482,31 +482,31 @@ class Tab2Header extends StatelessWidget {
children: <Widget>[
const Text(
'Product or product packaging damaged during transit',
style: const TextStyle(
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w700,
letterSpacing: -0.46,
),
),
const Padding(padding: const EdgeInsets.only(top: 16.0)),
const Padding(padding: EdgeInsets.only(top: 16.0)),
const Text(
'REVIEWERS',
style: const TextStyle(
color: const Color(0xFF646464),
style: TextStyle(
color: Color(0xFF646464),
fontSize: 12.0,
letterSpacing: -0.6,
fontWeight: FontWeight.w500,
),
),
const Padding(padding: const EdgeInsets.only(top: 8.0)),
const Padding(padding: EdgeInsets.only(top: 8.0)),
new Row(
children: <Widget>[
new Container(
width: 44.0,
height: 44.0,
decoration: const BoxDecoration(
image: const DecorationImage(
image: const AssetImage(
image: DecorationImage(
image: AssetImage(
'people/square/trevor.png',
package: _kGalleryAssetsPackage,
),
@ -514,13 +514,13 @@ class Tab2Header extends StatelessWidget {
shape: BoxShape.circle,
),
),
const Padding(padding: const EdgeInsets.only(left: 8.0)),
const Padding(padding: EdgeInsets.only(left: 8.0)),
new Container(
width: 44.0,
height: 44.0,
decoration: const BoxDecoration(
image: const DecorationImage(
image: const AssetImage(
image: DecorationImage(
image: AssetImage(
'people/square/sandra.png',
package: _kGalleryAssetsPackage,
),
@ -528,10 +528,10 @@ class Tab2Header extends StatelessWidget {
shape: BoxShape.circle,
),
),
const Padding(padding: const EdgeInsets.only(left: 2.0)),
const Padding(padding: EdgeInsets.only(left: 2.0)),
const Icon(
CupertinoIcons.check_mark_circled,
color: const Color(0xFF646464),
color: Color(0xFF646464),
size: 20.0,
),
],
@ -563,7 +563,7 @@ class Tab2ConversationBubble extends StatelessWidget {
Widget build(BuildContext context) {
return new Container(
decoration: new BoxDecoration(
borderRadius: const BorderRadius.all(const Radius.circular(18.0)),
borderRadius: const BorderRadius.all(Radius.circular(18.0)),
color: color == Tab2ConversationBubbleColor.blue
? CupertinoColors.activeBlue
: CupertinoColors.lightBackgroundGray,
@ -662,9 +662,9 @@ List<Widget> buildTab2Conversation() {
text: "My Xanadu doesn't look right",
),
const Tab2ConversationRow(
avatar: const Tab2ConversationAvatar(
avatar: Tab2ConversationAvatar(
text: 'KL',
color: const Color(0xFFFD5015),
color: Color(0xFFFD5015),
),
text: "We'll rush you a new one.\nIt's gonna be incredible",
),
@ -672,9 +672,9 @@ List<Widget> buildTab2Conversation() {
text: 'Awesome thanks!',
),
const Tab2ConversationRow(
avatar: const Tab2ConversationAvatar(
avatar: Tab2ConversationAvatar(
text: 'SJ',
color: const Color(0xFF34CAD6),
color: Color(0xFF34CAD6),
),
text: "We'll send you our\nnewest Labrador too!",
),
@ -682,9 +682,9 @@ List<Widget> buildTab2Conversation() {
text: 'Yay',
),
const Tab2ConversationRow(
avatar: const Tab2ConversationAvatar(
avatar: Tab2ConversationAvatar(
text: 'KL',
color: const Color(0xFFFD5015),
color: Color(0xFFFD5015),
),
text: "Actually there's one more thing...",
),
@ -699,14 +699,14 @@ class CupertinoDemoTab3 extends StatelessWidget {
Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: const Text('Account'),
trailing: const ExitButton(),
middle: Text('Account'),
trailing: ExitButton(),
),
child: new DecoratedBox(
decoration: const BoxDecoration(color: const Color(0xFFEFEFF4)),
decoration: const BoxDecoration(color: Color(0xFFEFEFF4)),
child: new ListView(
children: <Widget>[
const Padding(padding: const EdgeInsets.only(top: 32.0)),
const Padding(padding: EdgeInsets.only(top: 32.0)),
new GestureDetector(
onTap: () {
Navigator.of(context, rootNavigator: true).push(
@ -719,9 +719,9 @@ class CupertinoDemoTab3 extends StatelessWidget {
child: new Container(
decoration: const BoxDecoration(
color: CupertinoColors.white,
border: const Border(
top: const BorderSide(color: const Color(0xFFBCBBC1), width: 0.0),
bottom: const BorderSide(color: const Color(0xFFBCBBC1), width: 0.0),
border: Border(
top: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
bottom: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
),
),
height: 44.0,
@ -732,9 +732,9 @@ class CupertinoDemoTab3 extends StatelessWidget {
bottom: false,
child: new Row(
children: const <Widget>[
const Text(
Text(
'Sign in',
style: const TextStyle(color: CupertinoColors.activeBlue),
style: TextStyle(color: CupertinoColors.activeBlue),
)
],
),
@ -769,9 +769,9 @@ class Tab3Dialog extends StatelessWidget {
const Icon(
CupertinoIcons.profile_circled,
size: 160.0,
color: const Color(0xFF646464),
color: Color(0xFF646464),
),
const Padding(padding: const EdgeInsets.only(top: 18.0)),
const Padding(padding: EdgeInsets.only(top: 18.0)),
new CupertinoButton(
color: CupertinoColors.activeBlue,
child: const Text('Sign in'),

View File

@ -27,9 +27,9 @@ class _CupertinoPickerDemoState extends State<CupertinoPickerDemo> {
return new Container(
decoration: const BoxDecoration(
color: CupertinoColors.white,
border: const Border(
top: const BorderSide(color: const Color(0xFFBCBBC1), width: 0.0),
bottom: const BorderSide(color: const Color(0xFFBCBBC1), width: 0.0),
border: Border(
top: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
bottom: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
),
),
height: 44.0,
@ -163,10 +163,10 @@ class _CupertinoPickerDemoState extends State<CupertinoPickerDemo> {
color: CupertinoColors.black,
),
child: new DecoratedBox(
decoration: const BoxDecoration(color: const Color(0xFFEFEFF4)),
decoration: const BoxDecoration(color: Color(0xFFEFEFF4)),
child: new ListView(
children: <Widget>[
const Padding(padding: const EdgeInsets.only(top: 32.0)),
const Padding(padding: EdgeInsets.only(top: 32.0)),
new GestureDetector(
onTap: () async {
await showModalBottomSheet<void>(

View File

@ -45,11 +45,11 @@ class _CupertinoRefreshControlDemoState extends State<CupertinoRefreshControlDem
),
child: new CupertinoPageScaffold(
child: new DecoratedBox(
decoration: const BoxDecoration(color: const Color(0xFFEFEFF4)),
decoration: const BoxDecoration(color: Color(0xFFEFEFF4)),
child: new CustomScrollView(
slivers: <Widget>[
const CupertinoSliverNavigationBar(
largeTitle: const Text('Cupertino Refresh'),
largeTitle: Text('Cupertino Refresh'),
),
new CupertinoSliverRefreshControl(
onRefresh: () {
@ -154,7 +154,7 @@ class _ListItem extends StatelessWidget {
child: called
? const Align(
alignment: Alignment.topCenter,
child: const Icon(
child: Icon(
CupertinoIcons.phone_solid,
color: CupertinoColors.inactiveGray,
size: 18.0,
@ -165,8 +165,8 @@ class _ListItem extends StatelessWidget {
new Expanded(
child: new Container(
decoration: const BoxDecoration(
border: const Border(
bottom: const BorderSide(color: const Color(0xFFBCBBC1), width: 0.0),
border: Border(
bottom: BorderSide(color: Color(0xFFBCBBC1), width: 0.0),
),
),
padding: const EdgeInsets.only(left: 1.0, bottom: 9.0, right: 10.0),
@ -208,8 +208,8 @@ class _ListItem extends StatelessWidget {
),
),
const Padding(
padding: const EdgeInsets.only(left: 9.0),
child: const Icon(
padding: EdgeInsets.only(left: 9.0),
child: Icon(
CupertinoIcons.info,
color: CupertinoColors.activeBlue
),

View File

@ -43,22 +43,22 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
),
new Column(
children: const <Widget>[
const CupertinoSwitch(
CupertinoSwitch(
value: true,
onChanged: null,
),
const Text(
Text(
'Disabled'
),
],
),
new Column(
children: const <Widget>[
const CupertinoSwitch(
CupertinoSwitch(
value: false,
onChanged: null,
),
const Text(
Text(
'Disabled'
),
],

View File

@ -18,10 +18,10 @@ class Category {
String toString() => '$runtimeType("$title")';
}
const List<Category> allCategories = const <Category>[
const Category(
const List<Category> allCategories = <Category>[
Category(
title: 'Accessories',
assets: const <String>[
assets: <String>[
'products/belt.png',
'products/earrings.png',
'products/backpack.png',
@ -30,18 +30,18 @@ const List<Category> allCategories = const <Category>[
'products/sunnies.png',
],
),
const Category(
Category(
title: 'Blue',
assets: const <String>[
assets: <String>[
'products/backpack.png',
'products/cup.png',
'products/napkins.png',
'products/top.png',
],
),
const Category(
Category(
title: 'Cold Weather',
assets: const <String>[
assets: <String>[
'products/jacket.png',
'products/jumper.png',
'products/scarf.png',
@ -49,9 +49,9 @@ const List<Category> allCategories = const <Category>[
'products/sweats.png',
],
),
const Category(
Category(
title: 'Home',
assets: const <String>[
assets: <String>[
'products/cup.png',
'products/napkins.png',
'products/planters.png',
@ -59,18 +59,18 @@ const List<Category> allCategories = const <Category>[
'products/teaset.png',
],
),
const Category(
Category(
title: 'Tops',
assets: const <String>[
assets: <String>[
'products/jumper.png',
'products/shirt.png',
'products/sweater.png',
'products/top.png',
],
),
const Category(
Category(
title: 'Everything',
assets: const <String>[
assets: <String>[
'products/backpack.png',
'products/belt.png',
'products/cup.png',
@ -167,8 +167,8 @@ class BackdropPanel extends StatelessWidget {
return new Material(
elevation: 2.0,
borderRadius: const BorderRadius.only(
topLeft: const Radius.circular(16.0),
topRight: const Radius.circular(16.0),
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@ -338,7 +338,7 @@ class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderSt
final bool selected = category == _category;
return new Material(
shape: const RoundedRectangleBorder(
borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
color: selected
? Colors.white.withOpacity(0.25)

View File

@ -20,40 +20,40 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
// FAB shape
static const _ChoiceValue<Widget> kNoFab = const _ChoiceValue<Widget>(
static const _ChoiceValue<Widget> kNoFab = _ChoiceValue<Widget>(
title: 'None',
label: 'do not show a floating action button',
value: null,
);
static const _ChoiceValue<Widget> kCircularFab = const _ChoiceValue<Widget>(
static const _ChoiceValue<Widget> kCircularFab = _ChoiceValue<Widget>(
title: 'Circular',
label: 'circular floating action button',
value: const FloatingActionButton(
value: FloatingActionButton(
onPressed: _showSnackbar,
child: const Icon(Icons.add),
child: Icon(Icons.add),
backgroundColor: Colors.orange,
),
);
static const _ChoiceValue<Widget> kDiamondFab = const _ChoiceValue<Widget>(
static const _ChoiceValue<Widget> kDiamondFab = _ChoiceValue<Widget>(
title: 'Diamond',
label: 'diamond shape floating action button',
value: const _DiamondFab(
value: _DiamondFab(
onPressed: _showSnackbar,
child: const Icon(Icons.add),
child: Icon(Icons.add),
),
);
// Notch
static const _ChoiceValue<bool> kShowNotchTrue = const _ChoiceValue<bool>(
static const _ChoiceValue<bool> kShowNotchTrue = _ChoiceValue<bool>(
title: 'On',
label: 'show bottom appbar notch',
value: true,
);
static const _ChoiceValue<bool> kShowNotchFalse = const _ChoiceValue<bool>(
static const _ChoiceValue<bool> kShowNotchFalse = _ChoiceValue<bool>(
title: 'Off',
label: 'do not show bottom appbar notch',
value: false,
@ -61,25 +61,25 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
// FAB Position
static const _ChoiceValue<FloatingActionButtonLocation> kFabEndDocked = const _ChoiceValue<FloatingActionButtonLocation>(
static const _ChoiceValue<FloatingActionButtonLocation> kFabEndDocked = _ChoiceValue<FloatingActionButtonLocation>(
title: 'Attached - End',
label: 'floating action button is docked at the end of the bottom app bar',
value: FloatingActionButtonLocation.endDocked,
);
static const _ChoiceValue<FloatingActionButtonLocation> kFabCenterDocked = const _ChoiceValue<FloatingActionButtonLocation>(
static const _ChoiceValue<FloatingActionButtonLocation> kFabCenterDocked = _ChoiceValue<FloatingActionButtonLocation>(
title: 'Attached - Center',
label: 'floating action button is docked at the center of the bottom app bar',
value: FloatingActionButtonLocation.centerDocked,
);
static const _ChoiceValue<FloatingActionButtonLocation> kFabEndFloat= const _ChoiceValue<FloatingActionButtonLocation>(
static const _ChoiceValue<FloatingActionButtonLocation> kFabEndFloat= _ChoiceValue<FloatingActionButtonLocation>(
title: 'Free - End',
label: 'floating action button floats above the end of the bottom app bar',
value: FloatingActionButtonLocation.endFloat,
);
static const _ChoiceValue<FloatingActionButtonLocation> kFabCenterFloat = const _ChoiceValue<FloatingActionButtonLocation>(
static const _ChoiceValue<FloatingActionButtonLocation> kFabCenterFloat = _ChoiceValue<FloatingActionButtonLocation>(
title: 'Free - Center',
label: 'floating action button is floats above the center of the bottom app bar',
value: FloatingActionButtonLocation.centerFloat,
@ -91,19 +91,19 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
'the floating action button animates to its new position.'
'The BottomAppBar adapts its shape appropriately.';
_scaffoldKey.currentState.showSnackBar(
const SnackBar(content: const Text(text)),
const SnackBar(content: Text(text)),
);
}
// App bar color
static const List<_NamedColor> kBabColors = const <_NamedColor>[
const _NamedColor(null, 'Clear'),
const _NamedColor(const Color(0xFFFFC100), 'Orange'),
const _NamedColor(const Color(0xFF91FAFF), 'Light Blue'),
const _NamedColor(const Color(0xFF00D1FF), 'Cyan'),
const _NamedColor(const Color(0xFF00BCFF), 'Cerulean'),
const _NamedColor(const Color(0xFF009BEE), 'Blue'),
static const List<_NamedColor> kBabColors = <_NamedColor>[
_NamedColor(null, 'Clear'),
_NamedColor(Color(0xFFFFC100), 'Orange'),
_NamedColor(Color(0xFF91FAFF), 'Light Blue'),
_NamedColor(Color(0xFF00D1FF), 'Cyan'),
_NamedColor(Color(0xFF00BCFF), 'Cerulean'),
_NamedColor(Color(0xFF009BEE), 'Blue'),
];
_ChoiceValue<Widget> _fabShape = kCircularFab;
@ -358,7 +358,7 @@ class _DemoBottomAppBar extends StatelessWidget {
if (kCenterLocations.contains(fabLocation)) {
rowContents.add(
const Expanded(child: const SizedBox()),
const Expanded(child: SizedBox()),
);
}
@ -367,7 +367,7 @@ class _DemoBottomAppBar extends StatelessWidget {
icon: const Icon(Icons.search),
onPressed: () {
Scaffold.of(context).showSnackBar(
const SnackBar(content: const Text('This is a dummy search action.')),
const SnackBar(content: Text('This is a dummy search action.')),
);
},
),
@ -375,7 +375,7 @@ class _DemoBottomAppBar extends StatelessWidget {
icon: const Icon(Icons.more_vert),
onPressed: () {
Scaffold.of(context).showSnackBar(
const SnackBar(content: const Text('This is a dummy menu action.')),
const SnackBar(content: Text('This is a dummy menu action.')),
);
},
),
@ -398,13 +398,13 @@ class _DemoDrawer extends StatelessWidget {
return new Drawer(
child: new Column(
children: const <Widget>[
const ListTile(
leading: const Icon(Icons.search),
title: const Text('Search'),
ListTile(
leading: Icon(Icons.search),
title: Text('Search'),
),
const ListTile(
leading: const Icon(Icons.threed_rotation),
title: const Text('3D'),
ListTile(
leading: Icon(Icons.threed_rotation),
title: Text('3D'),
),
],
),

View File

@ -217,11 +217,11 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
itemBuilder: (BuildContext context) => <PopupMenuItem<BottomNavigationBarType>>[
const PopupMenuItem<BottomNavigationBarType>(
value: BottomNavigationBarType.fixed,
child: const Text('Fixed'),
child: Text('Fixed'),
),
const PopupMenuItem<BottomNavigationBarType>(
value: BottomNavigationBarType.shifting,
child: const Text('Shifting'),
child: Text('Shifting'),
)
],
)

View File

@ -141,7 +141,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
},
),
const RaisedButton(
child: const Text('DISABLED'),
child: Text('DISABLED'),
onPressed: null,
),
],
@ -184,7 +184,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
},
),
const FlatButton(
child: const Text('DISABLED'),
child: Text('DISABLED'),
onPressed: null,
),
],
@ -227,7 +227,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
},
),
const OutlineButton(
child: const Text('DISABLED'),
child: Text('DISABLED'),
onPressed: null,
),
],
@ -352,7 +352,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
color: iconButtonToggle ? Theme.of(context).primaryColor : null,
),
const IconButton(
icon: const Icon(
icon: Icon(
Icons.thumb_up,
semanticLabel: 'Thumbs up',
),

View File

@ -28,7 +28,7 @@ final List<TravelDestination> destinations = <TravelDestination>[
assetName: 'places/india_thanjavur_market.png',
assetPackage: _kGalleryAssetsPackage,
title: 'Top 10 Cities to Visit in Tamil Nadu',
description: const <String>[
description: <String>[
'Number 10',
'Thanjavur',
'Thanjavur, Tamil Nadu',
@ -38,7 +38,7 @@ final List<TravelDestination> destinations = <TravelDestination>[
assetName: 'places/india_chettinad_silk_maker.png',
assetPackage: _kGalleryAssetsPackage,
title: 'Artisans of Southern India',
description: const <String>[
description: <String>[
'Silk Spinners',
'Chettinad',
'Sivaganga, Tamil Nadu',
@ -173,11 +173,11 @@ class _CardsDemoState extends State<CardsDemo> {
onPressed: () {
setState(() {
_shape = _shape != null ? null : const RoundedRectangleBorder(
borderRadius: const BorderRadius.only(
topLeft: const Radius.circular(16.0),
topRight: const Radius.circular(16.0),
bottomLeft: const Radius.circular(2.0),
bottomRight: const Radius.circular(2.0),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
bottomLeft: Radius.circular(2.0),
bottomRight: Radius.circular(2.0),
),
);
});

View File

@ -4,7 +4,7 @@
import 'package:flutter/material.dart';
const List<String> _defaultMaterials = const <String>[
const List<String> _defaultMaterials = <String>[
'poker',
'tortilla',
'fish and',
@ -12,7 +12,7 @@ const List<String> _defaultMaterials = const <String>[
'wood',
];
const List<String> _defaultActions = const <String>[
const List<String> _defaultActions = <String>[
'flake',
'cut',
'fragment',
@ -24,7 +24,7 @@ const List<String> _defaultActions = const <String>[
'eat',
];
const Map<String, String> _results = const <String, String>{
const Map<String, String> _results = <String, String>{
'flake': 'flaking',
'cut': 'cutting',
'fragment': 'fragmenting',
@ -36,7 +36,7 @@ const Map<String, String> _results = const <String, String>{
'eat': 'eating',
};
const List<String> _defaultTools = const <String>[
const List<String> _defaultTools = <String>[
'hammer',
'chisel',
'fryer',
@ -44,7 +44,7 @@ const List<String> _defaultTools = const <String>[
'customer',
];
const Map<String, String> _avatars = const <String, String>{
const Map<String, String> _avatars = <String, String>{
'hammer': 'people/square/ali.png',
'chisel': 'people/square/sandra.png',
'fryer': 'people/square/trevor.png',

View File

@ -141,7 +141,7 @@ class _DateAndTimePickerDemoState extends State<DateAndTimePickerDemo> {
enabled: true,
decoration: const InputDecoration(
labelText: 'Event name',
border: const OutlineInputBorder(),
border: OutlineInputBorder(),
),
style: Theme.of(context).textTheme.display1,
),

View File

@ -19,7 +19,7 @@ class DrawerDemo extends StatefulWidget {
class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
static const List<String> _drawerContents = const <String>[
static const List<String> _drawerContents = <String>[
'A', 'B', 'C', 'D', 'E',
];
@ -69,7 +69,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
void _showNotImplementedMessage() {
Navigator.pop(context); // Dismiss the drawer.
_scaffoldKey.currentState.showSnackBar(const SnackBar(
content: const Text("The drawer's items don't do anything")
content: Text("The drawer's items don't do anything")
));
}
@ -95,7 +95,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
accountName: const Text('Trevor Widget'),
accountEmail: const Text('trevor.widget@example.com'),
currentAccountPicture: const CircleAvatar(
backgroundImage: const AssetImage(
backgroundImage: AssetImage(
_kAsset0,
package: _kGalleryAssetsPackage,
),
@ -108,7 +108,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
child: new Semantics(
label: 'Switch to Account B',
child: const CircleAvatar(
backgroundImage: const AssetImage(
backgroundImage: AssetImage(
_kAsset1,
package: _kGalleryAssetsPackage,
),
@ -122,7 +122,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
child: new Semantics(
label: 'Switch to Account C',
child: const CircleAvatar(
backgroundImage: const AssetImage(
backgroundImage: AssetImage(
_kAsset2,
package: _kGalleryAssetsPackage,
),
@ -209,8 +209,8 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
height: 100.0,
decoration: const BoxDecoration(
shape: BoxShape.circle,
image: const DecorationImage(
image: const AssetImage(
image: DecorationImage(
image: AssetImage(
_kAsset0,
package: _kGalleryAssetsPackage,
),

View File

@ -118,7 +118,7 @@ class CollapsibleBody extends StatelessWidget {
margin: const EdgeInsets.only(right: 8.0),
child: new FlatButton(
onPressed: onCancel,
child: const Text('CANCEL', style: const TextStyle(
child: const Text('CANCEL', style: TextStyle(
color: Colors.black54,
fontSize: 15.0,
fontWeight: FontWeight.w500

View File

@ -345,15 +345,15 @@ class GridListDemoState extends State<GridListDemo> {
itemBuilder: (BuildContext context) => <PopupMenuItem<GridDemoTileStyle>>[
const PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.imageOnly,
child: const Text('Image only'),
child: Text('Image only'),
),
const PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.oneLine,
child: const Text('One line'),
child: Text('One line'),
),
const PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.twoLine,
child: const Text('Two line'),
child: Text('Two line'),
),
],
),

View File

@ -145,7 +145,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
itemBuilder: (BuildContext context) => <PopupMenuEntry<LeaveBehindDemoAction>>[
const PopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.reset,
child: const Text('Reset the list')
child: Text('Reset the list')
),
const PopupMenuDivider(), // ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
new CheckedPopupMenuItem<LeaveBehindDemoAction>(
@ -214,13 +214,13 @@ class _LeaveBehindListItem extends StatelessWidget {
background: new Container(
color: theme.primaryColor,
child: const ListTile(
leading: const Icon(Icons.delete, color: Colors.white, size: 36.0)
leading: Icon(Icons.delete, color: Colors.white, size: 36.0)
)
),
secondaryBackground: new Container(
color: theme.primaryColor,
child: const ListTile(
trailing: const Icon(Icons.archive, color: Colors.white, size: 36.0)
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0)
)
),
child: new Container(

View File

@ -52,7 +52,7 @@ class _ListDemoState extends State<ListDemo> {
final PersistentBottomSheetController<Null> bottomSheet = scaffoldKey.currentState.showBottomSheet((BuildContext bottomSheetContext) {
return new Container(
decoration: const BoxDecoration(
border: const Border(top: const BorderSide(color: Colors.black26)),
border: Border(top: BorderSide(color: Colors.black26)),
),
child: new ListView(
shrinkWrap: true,

View File

@ -69,15 +69,15 @@ class MenuDemoState extends State<MenuDemo> {
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
const PopupMenuItem<String>(
value: 'Toolbar menu',
child: const Text('Toolbar menu')
child: Text('Toolbar menu')
),
const PopupMenuItem<String>(
value: 'Right here',
child: const Text('Right here')
child: Text('Right here')
),
const PopupMenuItem<String>(
value: 'Hooray!',
child: const Text('Hooray!')
child: Text('Hooray!')
),
],
),
@ -101,7 +101,7 @@ class MenuDemoState extends State<MenuDemo> {
),
const PopupMenuItem<String>(
enabled: false,
child: const Text('A disabled menu item')
child: Text('A disabled menu item')
),
new PopupMenuItem<String>(
value: _simpleValue3,
@ -121,31 +121,31 @@ class MenuDemoState extends State<MenuDemo> {
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
const PopupMenuItem<String>(
value: 'Preview',
child: const ListTile(
leading: const Icon(Icons.visibility),
title: const Text('Preview')
child: ListTile(
leading: Icon(Icons.visibility),
title: Text('Preview')
)
),
const PopupMenuItem<String>(
value: 'Share',
child: const ListTile(
leading: const Icon(Icons.person_add),
title: const Text('Share')
child: ListTile(
leading: Icon(Icons.person_add),
title: Text('Share')
)
),
const PopupMenuItem<String>(
value: 'Get Link',
child: const ListTile(
leading: const Icon(Icons.link),
title: const Text('Get link')
child: ListTile(
leading: Icon(Icons.link),
title: Text('Get link')
)
),
const PopupMenuDivider(), // ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
const PopupMenuItem<String>(
value: 'Remove',
child: const ListTile(
leading: const Icon(Icons.delete),
title: const Text('Remove')
child: ListTile(
leading: Icon(Icons.delete),
title: Text('Remove')
)
)
]

View File

@ -65,7 +65,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
final List<Widget> indicators = <Widget>[
const SizedBox(
width: 200.0,
child: const LinearProgressIndicator()
child: LinearProgressIndicator()
),
const LinearProgressIndicator(),
const LinearProgressIndicator(),

View File

@ -16,21 +16,21 @@ class _Page {
final String text;
}
const List<_Page> _allPages = const <_Page>[
const _Page(icon: Icons.grade, text: 'TRIUMPH'),
const _Page(icon: Icons.playlist_add, text: 'NOTE'),
const _Page(icon: Icons.check_circle, text: 'SUCCESS'),
const _Page(icon: Icons.question_answer, text: 'OVERSTATE'),
const _Page(icon: Icons.sentiment_very_satisfied, text: 'SATISFACTION'),
const _Page(icon: Icons.camera, text: 'APERTURE'),
const _Page(icon: Icons.assignment_late, text: 'WE MUST'),
const _Page(icon: Icons.assignment_turned_in, text: 'WE CAN'),
const _Page(icon: Icons.group, text: 'ALL'),
const _Page(icon: Icons.block, text: 'EXCEPT'),
const _Page(icon: Icons.sentiment_very_dissatisfied, text: 'CRYING'),
const _Page(icon: Icons.error, text: 'MISTAKE'),
const _Page(icon: Icons.loop, text: 'TRYING'),
const _Page(icon: Icons.cake, text: 'CAKE'),
const List<_Page> _allPages = <_Page>[
_Page(icon: Icons.grade, text: 'TRIUMPH'),
_Page(icon: Icons.playlist_add, text: 'NOTE'),
_Page(icon: Icons.check_circle, text: 'SUCCESS'),
_Page(icon: Icons.question_answer, text: 'OVERSTATE'),
_Page(icon: Icons.sentiment_very_satisfied, text: 'SATISFACTION'),
_Page(icon: Icons.camera, text: 'APERTURE'),
_Page(icon: Icons.assignment_late, text: 'WE MUST'),
_Page(icon: Icons.assignment_turned_in, text: 'WE CAN'),
_Page(icon: Icons.group, text: 'ALL'),
_Page(icon: Icons.block, text: 'EXCEPT'),
_Page(icon: Icons.sentiment_very_dissatisfied, text: 'CRYING'),
_Page(icon: Icons.error, text: 'MISTAKE'),
_Page(icon: Icons.loop, text: 'TRYING'),
_Page(icon: Icons.cake, text: 'CAKE'),
];
class ScrollableTabsDemo extends StatefulWidget {
@ -71,14 +71,14 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
case TabsDemoStyle.iconsAndText:
return new ShapeDecoration(
shape: const RoundedRectangleBorder(
borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
side: const BorderSide(
borderRadius: BorderRadius.all(Radius.circular(4.0)),
side: BorderSide(
color: Colors.white24,
width: 2.0,
),
) + const RoundedRectangleBorder(
borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
side: const BorderSide(
borderRadius: BorderRadius.all(Radius.circular(4.0)),
side: BorderSide(
color: Colors.transparent,
width: 4.0,
),
@ -88,12 +88,12 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
case TabsDemoStyle.iconsOnly:
return new ShapeDecoration(
shape: const CircleBorder(
side: const BorderSide(
side: BorderSide(
color: Colors.white24,
width: 4.0,
),
) + const CircleBorder(
side: const BorderSide(
side: BorderSide(
color: Colors.transparent,
width: 4.0,
),
@ -103,12 +103,12 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
case TabsDemoStyle.textOnly:
return new ShapeDecoration(
shape: const StadiumBorder(
side: const BorderSide(
side: BorderSide(
color: Colors.white24,
width: 2.0,
),
) + const StadiumBorder(
side: const BorderSide(
side: BorderSide(
color: Colors.transparent,
width: 4.0,
),
@ -138,15 +138,15 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
itemBuilder: (BuildContext context) => <PopupMenuItem<TabsDemoStyle>>[
const PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.iconsAndText,
child: const Text('Icons and text')
child: Text('Icons and text')
),
const PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.iconsOnly,
child: const Text('Icons only')
child: Text('Icons only')
),
const PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.textOnly,
child: const Text('Text only')
child: Text('Text only')
),
],
),

View File

@ -68,15 +68,15 @@ class _SearchDemoState extends State<SearchDemo> {
new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
const Text('Press the '),
const Tooltip(
Text('Press the '),
Tooltip(
message: 'search',
child: const Icon(
child: Icon(
Icons.search,
size: 18.0,
),
),
const Text(' icon in the AppBar'),
Text(' icon in the AppBar'),
],
),
const Text('and search for an integer between 0 and 100,000.'),
@ -100,10 +100,10 @@ class _SearchDemoState extends State<SearchDemo> {
child: new Column(
children: <Widget>[
const UserAccountsDrawerHeader(
accountName: const Text('Peter Widget'),
accountEmail: const Text('peter.widget@example.com'),
currentAccountPicture: const CircleAvatar(
backgroundImage: const AssetImage(
accountName: Text('Peter Widget'),
accountEmail: Text('peter.widget@example.com'),
currentAccountPicture: CircleAvatar(
backgroundImage: AssetImage(
'people/square/peter.png',
package: 'flutter_gallery_assets',
),
@ -115,8 +115,8 @@ class _SearchDemoState extends State<SearchDemo> {
// DrawerHeader consumes top MediaQuery padding.
removeTop: true,
child: const ListTile(
leading: const Icon(Icons.payment),
title: const Text('Placeholder'),
leading: Icon(Icons.payment),
title: Text('Placeholder'),
),
),
],

View File

@ -116,9 +116,9 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
mainAxisSize: MainAxisSize.min,
children: const <Widget>[
// Disabled checkboxes
const Checkbox(value: true, onChanged: null),
const Checkbox(value: false, onChanged: null),
const Checkbox(value: null, tristate: true, onChanged: null),
Checkbox(value: true, onChanged: null),
Checkbox(value: false, onChanged: null),
Checkbox(value: null, tristate: true, onChanged: null),
]
)
]
@ -156,17 +156,17 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
new Row(
mainAxisSize: MainAxisSize.min,
children: const <Widget>[
const Radio<int>(
Radio<int>(
value: 0,
groupValue: 0,
onChanged: null
),
const Radio<int>(
Radio<int>(
value: 1,
groupValue: 0,
onChanged: null
),
const Radio<int>(
Radio<int>(
value: 2,
groupValue: 0,
onChanged: null

View File

@ -157,8 +157,8 @@ class _SliderDemoState extends State<SliderDemo> {
new Column(
mainAxisSize: MainAxisSize.min,
children: const <Widget>[
const Slider(value: 0.25, onChanged: null),
const Text('Disabled'),
Slider(value: 0.25, onChanged: null),
Text('Disabled'),
],
),
new Column(

View File

@ -182,9 +182,9 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
new TextFormField(
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
border: const UnderlineInputBorder(),
border: UnderlineInputBorder(),
filled: true,
icon: const Icon(Icons.person),
icon: Icon(Icons.person),
hintText: 'What do people call you?',
labelText: 'Name *',
),
@ -194,9 +194,9 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
const SizedBox(height: 24.0),
new TextFormField(
decoration: const InputDecoration(
border: const UnderlineInputBorder(),
border: UnderlineInputBorder(),
filled: true,
icon: const Icon(Icons.phone),
icon: Icon(Icons.phone),
hintText: 'Where can we reach you?',
labelText: 'Phone Number *',
prefixText: '+1',
@ -214,9 +214,9 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
const SizedBox(height: 24.0),
new TextFormField(
decoration: const InputDecoration(
border: const UnderlineInputBorder(),
border: UnderlineInputBorder(),
filled: true,
icon: const Icon(Icons.email),
icon: Icon(Icons.email),
hintText: 'Your email address',
labelText: 'E-mail',
),
@ -226,7 +226,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
const SizedBox(height: 24.0),
new TextFormField(
decoration: const InputDecoration(
border: const OutlineInputBorder(),
border: OutlineInputBorder(),
hintText: 'Tell us about yourself',
helperText: 'Keep it short, this is just a demo.',
labelText: 'Life story',
@ -237,11 +237,11 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
new TextFormField(
keyboardType: TextInputType.number,
decoration: const InputDecoration(
border: const OutlineInputBorder(),
border: OutlineInputBorder(),
labelText: 'Salary',
prefixText: '\$',
suffixText: 'USD',
suffixStyle: const TextStyle(color: Colors.green)
suffixStyle: TextStyle(color: Colors.green)
),
maxLines: 1,
),
@ -260,7 +260,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
new TextFormField(
enabled: person.password != null && person.password.isNotEmpty,
decoration: const InputDecoration(
border: const UnderlineInputBorder(),
border: UnderlineInputBorder(),
filled: true,
labelText: 'Re-type password',
),

View File

@ -50,7 +50,7 @@ class TooltipDemo extends StatelessWidget {
tooltip: 'Place a phone call',
onPressed: () {
Scaffold.of(context).showSnackBar(const SnackBar(
content: const Text('That was an ordinary tap.')
content: Text('That was an ordinary tap.')
));
}
)

View File

@ -13,19 +13,19 @@ class TwoLevelListDemo extends StatelessWidget {
appBar: new AppBar(title: const Text('Expand/collapse list control')),
body: new ListView(
children: <Widget>[
const ListTile(title: const Text('Top')),
const ListTile(title: Text('Top')),
new ExpansionTile(
title: const Text('Sublist'),
backgroundColor: Theme.of(context).accentColor.withOpacity(0.025),
children: const <Widget>[
const ListTile(title: const Text('One')),
const ListTile(title: const Text('Two')),
ListTile(title: Text('One')),
ListTile(title: Text('Two')),
// https://en.wikipedia.org/wiki/Free_Four
const ListTile(title: const Text('Free')),
const ListTile(title: const Text('Four'))
ListTile(title: Text('Free')),
ListTile(title: Text('Four'))
]
),
const ListTile(title: const Text('Bottom'))
const ListTile(title: Text('Bottom'))
]
)
);

View File

@ -86,7 +86,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
child: const Icon(Icons.edit),
onPressed: () {
scaffoldKey.currentState.showSnackBar(const SnackBar(
content: const Text('Not supported.'),
content: Text('Not supported.'),
));
},
),
@ -110,7 +110,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
tooltip: 'Search',
onPressed: () {
scaffoldKey.currentState.showSnackBar(const SnackBar(
content: const Text('Not supported.'),
content: Text('Not supported.'),
));
},
),
@ -366,12 +366,12 @@ class _RecipePageState extends State<RecipePage> {
),
],
flexibleSpace: const FlexibleSpaceBar(
background: const DecoratedBox(
decoration: const BoxDecoration(
gradient: const LinearGradient(
begin: const Alignment(0.0, -1.0),
end: const Alignment(0.0, -0.2),
colors: const<Color>[const Color(0x60000000), const Color(0x00000000)],
background: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(0.0, -1.0),
end: Alignment(0.0, -0.2),
colors: <Color>[Color(0x60000000), Color(0x00000000)],
),
),
),
@ -448,7 +448,7 @@ class RecipeSheet extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
child: new Table(
columnWidths: const <int, TableColumnWidth>{
0: const FixedColumnWidth(64.0)
0: FixedColumnWidth(64.0)
},
children: <TableRow>[
new TableRow(
@ -567,8 +567,8 @@ class RecipeStep {
final String description;
}
const List<Recipe> kPestoRecipes = const <Recipe>[
const Recipe(
const List<Recipe> kPestoRecipes = <Recipe>[
Recipe(
name: 'Pesto Bruschetta',
author: 'Peter Carlsson',
ingredientsImagePath: 'food/icons/quick.png',
@ -576,19 +576,19 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Bask in greens this season by trying this delightful take on traditional bruschetta. Top with a dollop of homemade pesto, and season with freshly ground sea salt and pepper.',
imagePath: 'food/image1.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '6 pieces', description: 'Mozzarella cheese'),
const RecipeIngredient(amount: '6 pieces', description: 'Toasts'),
const RecipeIngredient(amount: '⅔ cup', description: 'Homemade pesto'),
const RecipeIngredient(amount: '1tbsp', description: 'Freshly ground pepper'),
const RecipeIngredient(amount: '1 tsp', description: 'Salt'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '6 pieces', description: 'Mozzarella cheese'),
RecipeIngredient(amount: '6 pieces', description: 'Toasts'),
RecipeIngredient(amount: '⅔ cup', description: 'Homemade pesto'),
RecipeIngredient(amount: '1tbsp', description: 'Freshly ground pepper'),
RecipeIngredient(amount: '1 tsp', description: 'Salt'),
],
steps: const<RecipeStep>[
const RecipeStep(description: 'Put in oven'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(description: 'Put in oven'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Rustic purple mash',
author: 'Trevor Hansen',
ingredientsImagePath: 'food/icons/veggie.png',
@ -596,19 +596,19 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Abundant in color, and healthy, delicious goodness, cooking with these South American purple potatoes is a treat. Boil, mash, bake, or roast them. For taste cook with chicken stock, and a dash of extra virgin olive oil.',
imagePath: 'food/image2.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '2 lbs', description: 'Purple potatoes, skin on'),
const RecipeIngredient(amount: '1 tsp', description: 'Salt'),
const RecipeIngredient(amount: '2 tsp', description: 'Lemon'),
const RecipeIngredient(amount: '4 cups', description: 'Chicken stock'),
const RecipeIngredient(amount: '1tbsp', description: 'Extra virgin olive oil')
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '2 lbs', description: 'Purple potatoes, skin on'),
RecipeIngredient(amount: '1 tsp', description: 'Salt'),
RecipeIngredient(amount: '2 tsp', description: 'Lemon'),
RecipeIngredient(amount: '4 cups', description: 'Chicken stock'),
RecipeIngredient(amount: '1tbsp', description: 'Extra virgin olive oil')
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Bacon Sprouts',
author: 'Ali Connors',
ingredientsImagePath: 'food/icons/main.png',
@ -616,20 +616,20 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'This beautiful sprouts recipe is the most glorious side dish on a cold winters night. Construct it with bacon or fake-on, but always make sure the sprouts are deliciously seasoned and appropriately sautéed.',
imagePath: 'food/image3.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '2 lbs', description: 'Brussel sprouts'),
const RecipeIngredient(amount: '3 lbs', description: 'Bacon'),
const RecipeIngredient(amount: '⅔ cup', description: 'Shaved parmesan cheese'),
const RecipeIngredient(amount: '1tbsp', description: 'Extra virgin olive oil'),
const RecipeIngredient(amount: '1 tsp', description: 'Lemon juice'),
const RecipeIngredient(amount: '1/2 cup', description: 'Sun dried tomatoes'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '2 lbs', description: 'Brussel sprouts'),
RecipeIngredient(amount: '3 lbs', description: 'Bacon'),
RecipeIngredient(amount: '⅔ cup', description: 'Shaved parmesan cheese'),
RecipeIngredient(amount: '1tbsp', description: 'Extra virgin olive oil'),
RecipeIngredient(amount: '1 tsp', description: 'Lemon juice'),
RecipeIngredient(amount: '1/2 cup', description: 'Sun dried tomatoes'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Oven Sausage',
author: 'Sandra Adams',
ingredientsImagePath: 'food/icons/meat.png',
@ -637,16 +637,16 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Robust cuts of portuguese sausage add layers of flavour. Bake or fry until sausages are slightly browned and with a crispy skin. Serve warm and with cuts of pineapple for a delightful mix of sweet and savory flavour. This is the perfect dish after a swim in the sea.',
imagePath: 'food/image4.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '1 1/2 lbs', description: 'Linguisa'),
const RecipeIngredient(amount: '1 lbs', description: 'Pineapple or other fresh citrus fruit'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '1 1/2 lbs', description: 'Linguisa'),
RecipeIngredient(amount: '1 lbs', description: 'Pineapple or other fresh citrus fruit'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Chicken tostadas',
author: 'Peter Carlsson',
ingredientsImagePath: 'food/icons/spicy.png',
@ -654,18 +654,18 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Crisp flavours and a bit of spice make this roasted chicken dish an easy go to when cooking for large groups. Top with Baja sauce for an extra kick of spice.',
imagePath: 'food/image5.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '4-6', description: 'Small corn tortillas'),
const RecipeIngredient(amount: '½ cup', description: 'Chopped onion'),
const RecipeIngredient(amount: '', description: 'Cream'),
const RecipeIngredient(amount: '3-4oz', description: 'Roasted, shredded chicken breast'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '4-6', description: 'Small corn tortillas'),
RecipeIngredient(amount: '½ cup', description: 'Chopped onion'),
RecipeIngredient(amount: '', description: 'Cream'),
RecipeIngredient(amount: '3-4oz', description: 'Roasted, shredded chicken breast'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Coconut rice',
author: 'Ali Connors',
ingredientsImagePath: 'food/icons/healthy.png',
@ -673,19 +673,19 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'This dish is a terrific pairing to almost any main. Bonus- its quick, easy to make, and turns even the simplest of dishes into a delicacy. Sweet coconut cream will leave your mouth watering, with yummy caramelized flecks of rice adding an extra bit of taste. Fluff with fork before serving for best results.',
imagePath: 'food/image6.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '2 cups', description: 'Jasmine rice'),
const RecipeIngredient(amount: '1 1/2 cups', description: 'Water'),
const RecipeIngredient(amount: '1 cup', description: 'Coconut milk'),
const RecipeIngredient(amount: '1 1/2 tbsp', description: 'Sugar'),
const RecipeIngredient(amount: '1tsp', description: 'Salt'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '2 cups', description: 'Jasmine rice'),
RecipeIngredient(amount: '1 1/2 cups', description: 'Water'),
RecipeIngredient(amount: '1 cup', description: 'Coconut milk'),
RecipeIngredient(amount: '1 1/2 tbsp', description: 'Sugar'),
RecipeIngredient(amount: '1tsp', description: 'Salt'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook')
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook')
],
),
const Recipe(
Recipe(
name: 'Gin basil cocktail',
author: 'Trevor Hansen',
ingredientsImagePath: 'food/icons/quick.png',
@ -693,18 +693,18 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'This mellow and herb filled blending of simple ingredients is easy enough to mix that a novice host will feel like a seasoned bartender. Top with crushed basil, shake or stir.',
imagePath: 'food/image7.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '3 parts', description: 'Gin'),
const RecipeIngredient(amount: '1 part', description: 'Fresh lemon juice'),
const RecipeIngredient(amount: '½ part', description: 'Simple syrup'),
const RecipeIngredient(amount: '5', description: 'Basil leaves, crushed'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '3 parts', description: 'Gin'),
RecipeIngredient(amount: '1 part', description: 'Fresh lemon juice'),
RecipeIngredient(amount: '½ part', description: 'Simple syrup'),
RecipeIngredient(amount: '5', description: 'Basil leaves, crushed'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Seared sesame fish',
author: 'Ali Connors',
ingredientsImagePath: 'food/icons/fish.png',
@ -712,20 +712,20 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Cuts of fish like this are perfect for simple searing with bright flavours. Try Sesame seeds on these fillets for crusty skin filled with crunch. For added flavour try dipping in a homemade ponzu sauce - delicious.',
imagePath: 'food/image8.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '1 ½ lbs', description: 'Thin fish fillets'),
const RecipeIngredient(amount: '1 lb', description: 'Salt and black pepper to taste'),
const RecipeIngredient(amount: '3/4 cup', description: 'Sesame seeds'),
const RecipeIngredient(amount: '2tbsp', description: 'Sesame oil'),
const RecipeIngredient(amount: '1tbsp', description: 'Lime juice'),
const RecipeIngredient(amount: '2 tbsp', description: 'Soy sauce'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '1 ½ lbs', description: 'Thin fish fillets'),
RecipeIngredient(amount: '1 lb', description: 'Salt and black pepper to taste'),
RecipeIngredient(amount: '3/4 cup', description: 'Sesame seeds'),
RecipeIngredient(amount: '2tbsp', description: 'Sesame oil'),
RecipeIngredient(amount: '1tbsp', description: 'Lime juice'),
RecipeIngredient(amount: '2 tbsp', description: 'Soy sauce'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Herb artichoke',
author: 'Sandra Adams',
ingredientsImagePath: 'food/icons/healthy.png',
@ -733,20 +733,20 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'This tasty and healthy veggie is a favorite. Artichoke like this can be paired with a hearty main or works well as a small meal with some white wine on the side. Simple and fresh, all foodies love tasty artichoke.',
imagePath: 'food/image9.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '1', description: 'Small garlic clove, peeled'),
const RecipeIngredient(amount: '2', description: 'Whole artichokes'),
const RecipeIngredient(amount: '4 tbsp', description: 'Fresh lemon juice'),
const RecipeIngredient(amount: '4 tbsp', description: 'Unsalted butter'),
const RecipeIngredient(amount: '2 tbsp', description: 'Extra-virgin olive oil'),
const RecipeIngredient(amount: '14 tsp', description: 'Freshly ground black pepper'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '1', description: 'Small garlic clove, peeled'),
RecipeIngredient(amount: '2', description: 'Whole artichokes'),
RecipeIngredient(amount: '4 tbsp', description: 'Fresh lemon juice'),
RecipeIngredient(amount: '4 tbsp', description: 'Unsalted butter'),
RecipeIngredient(amount: '2 tbsp', description: 'Extra-virgin olive oil'),
RecipeIngredient(amount: '14 tsp', description: 'Freshly ground black pepper'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Pesto bruschetta',
author: 'Trevor Hansen',
ingredientsImagePath: 'food/icons/veggie.png',
@ -754,22 +754,22 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Life is good when you add amazingly warm bread, fresh pesto sauce, and roasted tomatoes to the table. This a classic starter to break out in a pinch. Its easy to make and extra tasty.',
imagePath: 'food/image10.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '1 loaf', description: 'Sliced French bread'),
const RecipeIngredient(amount: '½ cup', description: 'Cheese'),
const RecipeIngredient(amount: '1 cup', description: 'Heirloom tomatoes'),
const RecipeIngredient(amount: '1 cup', description: 'Fresh basil'),
const RecipeIngredient(amount: '1 clove', description: 'Garlic '),
const RecipeIngredient(amount: '½ tbsp', description: 'Olive oil'),
const RecipeIngredient(amount: '3tsp', description: 'White wine vinegar'),
const RecipeIngredient(amount: '¼ tsp', description: 'Sea salt'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '1 loaf', description: 'Sliced French bread'),
RecipeIngredient(amount: '½ cup', description: 'Cheese'),
RecipeIngredient(amount: '1 cup', description: 'Heirloom tomatoes'),
RecipeIngredient(amount: '1 cup', description: 'Fresh basil'),
RecipeIngredient(amount: '1 clove', description: 'Garlic '),
RecipeIngredient(amount: '½ tbsp', description: 'Olive oil'),
RecipeIngredient(amount: '3tsp', description: 'White wine vinegar'),
RecipeIngredient(amount: '¼ tsp', description: 'Sea salt'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Garlic bok choy',
author: 'Sandra Adams',
ingredientsImagePath: 'food/icons/spicy.png',
@ -777,19 +777,19 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Great stir-fried bok choy starts at the market. For me, nothing says tasty like garlic and baby bok choy. Choose fresh, crisp greens. Once home, wash, chop, and then ready for the wok. No family style spread is complete without these greens.',
imagePath: 'food/image11.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '1/2 cup', description: 'Chick broth'),
const RecipeIngredient(amount: '1 tbsp', description: 'Soy sauce'),
const RecipeIngredient(amount: '¼ cup', description: 'Sliced garlic'),
const RecipeIngredient(amount: '2-3 lbs', description: 'Bok choy'),
const RecipeIngredient(amount: '2 tsp', description: 'Sesame oil'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '1/2 cup', description: 'Chick broth'),
RecipeIngredient(amount: '1 tbsp', description: 'Soy sauce'),
RecipeIngredient(amount: '¼ cup', description: 'Sliced garlic'),
RecipeIngredient(amount: '2-3 lbs', description: 'Bok choy'),
RecipeIngredient(amount: '2 tsp', description: 'Sesame oil'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Fresh Fettuccine',
author: 'Ali Connors',
ingredientsImagePath: 'food/icons/main.png',
@ -797,20 +797,20 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'Satisfy a need for rich, creamy homemade goodness with this classic. Creamy fettuccine alfredo will have you hitting the gym the next day, but its so good its worth it.',
imagePath: 'food/image12.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '¾ cup', description: 'Milk'),
const RecipeIngredient(amount: '1 ½ tsp', description: 'Salt'),
const RecipeIngredient(amount: '1 tbsp', description: 'Olive oil'),
const RecipeIngredient(amount: '8oz', description: 'Fettuccine'),
const RecipeIngredient(amount: '½ cup', description: 'Fresh basil'),
const RecipeIngredient(amount: '½ cup', description: 'Fresh ground pepper'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '¾ cup', description: 'Milk'),
RecipeIngredient(amount: '1 ½ tsp', description: 'Salt'),
RecipeIngredient(amount: '1 tbsp', description: 'Olive oil'),
RecipeIngredient(amount: '8oz', description: 'Fettuccine'),
RecipeIngredient(amount: '½ cup', description: 'Fresh basil'),
RecipeIngredient(amount: '½ cup', description: 'Fresh ground pepper'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
const Recipe(
Recipe(
name: 'Sicilian-Style sardines',
author: 'Peter Carlsson',
ingredientsImagePath: 'food/icons/quick.png',
@ -818,17 +818,17 @@ const List<Recipe> kPestoRecipes = const <Recipe>[
description: 'My go to way to eat sardines is with a splash of tangy lemon and fresh fennel drizzled on top. The best thing about this dish is the flavour it packs. Prepaid with wild caught sardines or canned.',
imagePath: 'food/image13.jpg',
imagePackage: _kGalleryAssetsPackage,
ingredients: const<RecipeIngredient>[
const RecipeIngredient(amount: '1/4 cup', description: 'Dry white wine'),
const RecipeIngredient(amount: '1', description: 'Finely chopped shallot'),
const RecipeIngredient(amount: '2 tbsp', description: 'Fresh lemon juice'),
const RecipeIngredient(amount: '1 tbsp', description: 'Fennel seeds, crushed'),
const RecipeIngredient(amount: '4 tbsp', description: 'Extra virgin olive oil, to taste'),
const RecipeIngredient(amount: '2 cans', description: 'Sardines in oil, drained'),
ingredients: <RecipeIngredient>[
RecipeIngredient(amount: '1/4 cup', description: 'Dry white wine'),
RecipeIngredient(amount: '1', description: 'Finely chopped shallot'),
RecipeIngredient(amount: '2 tbsp', description: 'Fresh lemon juice'),
RecipeIngredient(amount: '1 tbsp', description: 'Fennel seeds, crushed'),
RecipeIngredient(amount: '4 tbsp', description: 'Extra virgin olive oil, to taste'),
RecipeIngredient(amount: '2 cans', description: 'Sardines in oil, drained'),
],
steps: const<RecipeStep>[
const RecipeStep(duration: '3 min', description: 'Stir'),
const RecipeStep(duration: '45 min', description: 'Cook'),
steps: <RecipeStep>[
RecipeStep(duration: '3 min', description: 'Stir'),
RecipeStep(duration: '45 min', description: 'Cook'),
],
),
];

View File

@ -6,7 +6,7 @@ import 'shrine_types.dart';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
const Vendor _ali = const Vendor(
const Vendor _ali = Vendor(
name: 'Alis shop',
avatarAsset: 'people/square/ali.png',
avatarAssetPackage: _kGalleryAssetsPackage,
@ -16,7 +16,7 @@ const Vendor _ali = const Vendor(
'Custom orders are available upon request if you need something extra special.'
);
const Vendor _peter = const Vendor(
const Vendor _peter = Vendor(
name: 'Peters shop',
avatarAsset: 'people/square/peter.png',
avatarAssetPackage: _kGalleryAssetsPackage,
@ -26,7 +26,7 @@ const Vendor _peter = const Vendor(
'available upon request if you need something extra special.'
);
const Vendor _sandra = const Vendor(
const Vendor _sandra = Vendor(
name: 'Sandras shop',
avatarAsset: 'people/square/sandra.png',
avatarAssetPackage: _kGalleryAssetsPackage,
@ -35,7 +35,7 @@ const Vendor _sandra = const Vendor(
'Custom orders are available if youre looking for a certain color or material.'
);
const Vendor _stella = const Vendor(
const Vendor _stella = Vendor(
name: 'Stellas shop',
avatarAsset: 'people/square/stella.png',
avatarAssetPackage: _kGalleryAssetsPackage,
@ -45,7 +45,7 @@ const Vendor _stella = const Vendor(
'if you need something extra special.'
);
const Vendor _trevor = const Vendor(
const Vendor _trevor = Vendor(
name: 'Trevors shop',
avatarAsset: 'people/square/trevor.png',
avatarAssetPackage: _kGalleryAssetsPackage,
@ -55,23 +55,23 @@ const Vendor _trevor = const Vendor(
'available upon request if you need something extra special.'
);
const List<Product> _allProducts = const <Product> [
const Product(
const List<Product> _allProducts = <Product> [
Product(
name: 'Vintage Brown Belt',
imageAsset: 'products/belt.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['fashion', 'latest'],
categories: <String>['fashion', 'latest'],
price: 300.00,
vendor: _sandra,
description:
'Isnt it cool when things look old, but they\'re not. Looks Old But Not makes '
'awesome vintage goods that are super smart. This ol belt just got an upgrade. '
),
const Product(
Product(
name: 'Sunglasses',
imageAsset: 'products/sunnies.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['travel', 'fashion', 'beauty'],
categories: <String>['travel', 'fashion', 'beauty'],
price: 20.00,
vendor: _trevor,
description:
@ -80,21 +80,21 @@ const List<Product> _allProducts = const <Product> [
'so you can look at the sun for however long you want. Sunglasses make you '
'look cool, wear them.'
),
const Product(
Product(
name: 'Flatwear',
imageAsset: 'products/flatwear.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['furniture'],
categories: <String>['furniture'],
price: 30.00,
vendor: _trevor,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Salmon Sweater',
imageAsset: 'products/sweater.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['fashion'],
categories: <String>['fashion'],
price: 300.00,
vendor: _stella,
description:
@ -102,41 +102,41 @@ const List<Product> _allProducts = const <Product> [
'flavors, including salmon, that pop as soon as they hit your eyes. '
'Sweaters heat quickly, so savor the warmth.'
),
const Product(
Product(
name: 'Pine Table',
imageAsset: 'products/table.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['furniture'],
categories: <String>['furniture'],
price: 63.00,
vendor: _stella,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Green Comfort Jacket',
imageAsset: 'products/jacket.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['fashion'],
categories: <String>['fashion'],
price: 36.00,
vendor: _ali,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Chambray Top',
imageAsset: 'products/top.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['fashion'],
categories: <String>['fashion'],
price: 125.00,
vendor: _peter,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Blue Cup',
imageAsset: 'products/cup.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['travel', 'furniture'],
categories: <String>['travel', 'furniture'],
price: 75.00,
vendor: _sandra,
description:
@ -144,11 +144,11 @@ const List<Product> _allProducts = const <Product> [
'cup purchased Drinksy donates a cup to those in need. Buy yourself a mug, '
'buy someone else a mug.'
),
const Product(
Product(
name: 'Tea Set',
imageAsset: 'products/teaset.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['furniture', 'fashion'],
categories: <String>['furniture', 'fashion'],
price: 70.00,
vendor: _trevor,
featureTitle: 'Beautiful glass teapot',
@ -159,22 +159,22 @@ const List<Product> _allProducts = const <Product> [
'hot liquids and pours them from the spout. Use the handle, shown on the right, '
'so your fingers dont get burnt while pouring.'
),
const Product(
Product(
name: 'Blue linen napkins',
imageAsset: 'products/napkins.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['furniture', 'fashion'],
categories: <String>['furniture', 'fashion'],
price: 89.00,
vendor: _trevor,
description:
'Blue linen napkins were meant to go with friends, so you may want to pick '
'up a bunch of these. These things are absorbant.'
),
const Product(
Product(
name: 'Dipped Earrings',
imageAsset: 'products/earrings.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['fashion', 'beauty'],
categories: <String>['fashion', 'beauty'],
price: 25.00,
vendor: _stella,
description:
@ -182,11 +182,11 @@ const List<Product> _allProducts = const <Product> [
'the office or the beach. Just be sure you dont drop it in a bucket of '
'red paint, then they wont look dipped anymore.'
),
const Product(
Product(
name: 'Perfect Planters',
imageAsset: 'products/planters.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['latest', 'furniture'],
categories: <String>['latest', 'furniture'],
price: 30.00,
vendor: _ali,
description:
@ -194,11 +194,11 @@ const List<Product> _allProducts = const <Product> [
'can pot. This set of Perfect Planters holds succulents and cuttings perfectly. '
'Looks great in any room. Keep out of reach from cats.'
),
const Product(
Product(
name: 'Cloud-White Dress',
imageAsset: 'products/dress.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['fashion'],
categories: <String>['fashion'],
price: 54.00,
vendor: _sandra,
description:
@ -206,11 +206,11 @@ const List<Product> _allProducts = const <Product> [
'This Cloud-White Dress has you covered for those nights when you need '
'to get out, or even if youre just headed to work.'
),
const Product(
Product(
name: 'Backpack',
imageAsset: 'products/backpack.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['travel', 'fashion'],
categories: <String>['travel', 'fashion'],
price: 25.00,
vendor: _peter,
description:
@ -218,11 +218,11 @@ const List<Product> _allProducts = const <Product> [
'a pen, a protractor, notebooks, small animals, plugs for your devices, '
'sunglasses, gym clothes, shoes, gloves, two kittens, and even lunch!'
),
const Product(
Product(
name: 'Charcoal Straw Hat',
imageAsset: 'products/hat.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['travel', 'fashion', 'latest'],
categories: <String>['travel', 'fashion', 'latest'],
price: 25.00,
vendor: _ali,
description:
@ -230,41 +230,41 @@ const List<Product> _allProducts = const <Product> [
'Jetset approved, these hats have been rigorously tested. Keep that face '
'protected from the sun.'
),
const Product(
Product(
name: 'Ginger Scarf',
imageAsset: 'products/scarf.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['latest', 'fashion'],
categories: <String>['latest', 'fashion'],
price: 17.00,
vendor: _peter,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Blush Sweats',
imageAsset: 'products/sweats.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['travel', 'fashion', 'latest'],
categories: <String>['travel', 'fashion', 'latest'],
price: 25.00,
vendor: _stella,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Mint Jumper',
imageAsset: 'products/jumper.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>['travel', 'fashion', 'beauty'],
categories: <String>['travel', 'fashion', 'beauty'],
price: 25.00,
vendor: _peter,
description:
'Leave the tunnel and the rain is fallin amazing things happen when you wait'
),
const Product(
Product(
name: 'Ochre Shirt',
imageAsset: 'products/shirt.png',
imageAssetPackage: _kGalleryAssetsPackage,
categories: const <String>[ 'fashion', 'latest'],
categories: <String>[ 'fashion', 'latest'],
price: 120.00,
vendor: _stella,
description:

View File

@ -182,7 +182,7 @@ class _Heading extends StatelessWidget {
child: const Icon(
Icons.info_outline,
size: 24.0,
color: const Color(0xFFFFE0E0),
color: Color(0xFFFFE0E0),
),
),
new LayoutId(

View File

@ -53,8 +53,8 @@ class ShrinePageState extends State<ShrinePage> {
showModalBottomSheet<void>(context: context, builder: (BuildContext context) {
if (widget.shoppingCart.isEmpty) {
return const Padding(
padding: const EdgeInsets.all(24.0),
child: const Text('The shopping cart is empty')
padding: EdgeInsets.all(24.0),
child: Text('The shopping cart is empty')
);
}
return new ListView(
@ -80,7 +80,7 @@ class ShrinePageState extends State<ShrinePage> {
void _emptyCart() {
widget.shoppingCart.clear();
widget.scaffoldKey.currentState.showSnackBar(const SnackBar(content: const Text('Shopping cart is empty')));
widget.scaffoldKey.currentState.showSnackBar(const SnackBar(content: Text('Shopping cart is empty')));
}
@override
@ -112,15 +112,15 @@ class ShrinePageState extends State<ShrinePage> {
itemBuilder: (BuildContext context) => <PopupMenuItem<ShrineAction>>[
const PopupMenuItem<ShrineAction>(
value: ShrineAction.sortByPrice,
child: const Text('Sort by price')
child: Text('Sort by price')
),
const PopupMenuItem<ShrineAction>(
value: ShrineAction.sortByProduct,
child: const Text('Sort by product')
child: Text('Sort by product')
),
const PopupMenuItem<ShrineAction>(
value: ShrineAction.emptyCart,
child: const Text('Empty shopping cart')
child: Text('Empty shopping cart')
)
],
onSelected: (ShrineAction action) {

View File

@ -14,7 +14,7 @@ Widget buildShrine(BuildContext context, Widget child) {
return new Theme(
data: new ThemeData(
primarySwatch: Colors.grey,
iconTheme: const IconThemeData(color: const Color(0xFF707070)),
iconTheme: const IconThemeData(color: Color(0xFF707070)),
platform: Theme.of(context).platform,
),
child: new ShrineTheme(child: child)

View File

@ -129,7 +129,7 @@ class _VideoPlayerLoadingState extends State<VideoPlayerLoading> {
return new Stack(
children: <Widget>[
new VideoPlayer(widget.controller),
const Center(child: const CircularProgressIndicator()),
const Center(child: CircularProgressIndicator()),
],
fit: StackFit.expand,
);
@ -184,12 +184,12 @@ class _VideoPlayPauseState extends State<VideoPlayPause> {
}
if (controller.value.isPlaying) {
imageFadeAnimation = const FadeAnimation(
child: const Icon(Icons.pause, size: 100.0),
child: Icon(Icons.pause, size: 100.0),
);
controller.pause();
} else {
imageFadeAnimation = const FadeAnimation(
child: const Icon(Icons.play_arrow, size: 100.0),
child: Icon(Icons.play_arrow, size: 100.0),
);
controller.play();
}
@ -283,11 +283,11 @@ class _ConnectivityOverlayState extends State<ConnectivityOverlay> {
StreamSubscription<ConnectivityResult> connectivitySubscription;
bool connected = true;
static const Widget errorSnackBar = const SnackBar(
static const Widget errorSnackBar = SnackBar(
backgroundColor: Colors.red,
content: const ListTile(
title: const Text('No network'),
subtitle: const Text(
content: ListTile(
title: Text('No network'),
subtitle: Text(
'To load the videos you must have an active network connection',
),
),
@ -420,7 +420,7 @@ class _VideoDemoState extends State<VideoDemo>
scaffoldKey: scaffoldKey,
)
: const Center(
child: const Text(
child: Text(
'Video playback not supported on the iOS Simulator.',
),
),

View File

@ -14,12 +14,12 @@ const double _kBackAppBarHeight = 56.0; // back layer (options) appbar height
// The size of the front layer heading's left and right beveled corners.
final Tween<BorderRadius> _kFrontHeadingBevelRadius = new BorderRadiusTween(
begin: const BorderRadius.only(
topLeft: const Radius.circular(12.0),
topRight: const Radius.circular(12.0),
topLeft: Radius.circular(12.0),
topRight: Radius.circular(12.0),
),
end: const BorderRadius.only(
topLeft: const Radius.circular(_kFrontHeadingHeight),
topRight: const Radius.circular(_kFrontHeadingHeight),
topLeft: Radius.circular(_kFrontHeadingHeight),
topRight: Radius.circular(_kFrontHeadingHeight),
),
);

View File

@ -137,7 +137,7 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
Widget body;
if (_exampleCode == null) {
body = const Center(
child: const CircularProgressIndicator()
child: CircularProgressIndicator()
);
} else {
body = new SingleChildScrollView(

View File

@ -31,27 +31,27 @@ class GalleryDemoCategory {
}
}
const GalleryDemoCategory _kDemos = const GalleryDemoCategory._(
const GalleryDemoCategory _kDemos = GalleryDemoCategory._(
name: 'Studies',
icon: GalleryIcons.animation,
);
const GalleryDemoCategory _kStyle = const GalleryDemoCategory._(
const GalleryDemoCategory _kStyle = GalleryDemoCategory._(
name: 'Style',
icon: GalleryIcons.custom_typography,
);
const GalleryDemoCategory _kMaterialComponents = const GalleryDemoCategory._(
const GalleryDemoCategory _kMaterialComponents = GalleryDemoCategory._(
name: 'Material',
icon: GalleryIcons.category_mdc,
);
const GalleryDemoCategory _kCupertinoComponents = const GalleryDemoCategory._(
const GalleryDemoCategory _kCupertinoComponents = GalleryDemoCategory._(
name: 'Cupertino',
icon: GalleryIcons.phone_iphone,
);
const GalleryDemoCategory _kMedia = const GalleryDemoCategory._(
const GalleryDemoCategory _kMedia = GalleryDemoCategory._(
name: 'Media',
icon: GalleryIcons.drive_video,
);

View File

@ -26,7 +26,7 @@ new RaisedButton(
// Buttons are disabled when onPressed isn't
// specified or is null.
const RaisedButton(
child: const Text('BUTTON TITLE'),
child: Text('BUTTON TITLE'),
onPressed: null
);
@ -54,7 +54,7 @@ new OutlineButton(
// Buttons are disabled when onPressed isn't
// specified or is null.
const OutlineButton(
child: const Text('BUTTON TITLE'),
child: Text('BUTTON TITLE'),
onPressed: null
);
@ -82,7 +82,7 @@ new FlatButton(
// Buttons are disabled when onPressed isn't
// specified or is null.
const FlatButton(
child: const Text('BUTTON TITLE'),
child: Text('BUTTON TITLE'),
onPressed: null
);
// END
@ -136,7 +136,7 @@ new Scaffold(
title: const Text('Demo')
),
floatingActionButton: const FloatingActionButton(
child: const Icon(Icons.add),
child: Icon(Icons.add),
onPressed: null
)
);

View File

@ -13,9 +13,9 @@ import 'backdrop.dart';
import 'demos.dart';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
const Color _kFlutterBlue = const Color(0xFF003D75);
const Color _kFlutterBlue = Color(0xFF003D75);
const double _kDemoItemHeight = 64.0;
const Duration _kFrontLayerSwitchDuration = const Duration(milliseconds: 300);
const Duration _kFrontLayerSwitchDuration = Duration(milliseconds: 300);
class _FlutterLogo extends StatelessWidget {
const _FlutterLogo({ Key key }) : super(key: key);
@ -27,8 +27,8 @@ class _FlutterLogo extends StatelessWidget {
width: 34.0,
height: 34.0,
decoration: const BoxDecoration(
image: const DecorationImage(
image: const AssetImage(
image: DecorationImage(
image: AssetImage(
'logos/flutter_white/logo.png',
package: _kGalleryAssetsPackage,
),
@ -325,8 +325,8 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
final MediaQueryData media = MediaQuery.of(context);
final bool centerHome = media.orientation == Orientation.portrait && media.size.height < 800.0;
const Curve switchOutCurve = const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn);
const Curve switchInCurve = const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn);
const Curve switchOutCurve = Interval(0.4, 1.0, curve: Curves.fastOutSlowIn);
const Curve switchInCurve = Interval(0.4, 1.0, curve: Curves.fastOutSlowIn);
Widget home = new Scaffold(
key: _scaffoldKey,

View File

@ -7,44 +7,44 @@ import 'package:flutter/material.dart';
class GalleryIcons {
GalleryIcons._();
static const IconData tooltip = const IconData(0xe900, fontFamily: 'GalleryIcons');
static const IconData text_fields_alt = const IconData(0xe901, fontFamily: 'GalleryIcons');
static const IconData tabs = const IconData(0xe902, fontFamily: 'GalleryIcons');
static const IconData switches = const IconData(0xe903, fontFamily: 'GalleryIcons');
static const IconData sliders = const IconData(0xe904, fontFamily: 'GalleryIcons');
static const IconData shrine = const IconData(0xe905, fontFamily: 'GalleryIcons');
static const IconData sentiment_very_satisfied = const IconData(0xe906, fontFamily: 'GalleryIcons');
static const IconData refresh = const IconData(0xe907, fontFamily: 'GalleryIcons');
static const IconData progress_activity = const IconData(0xe908, fontFamily: 'GalleryIcons');
static const IconData phone_iphone = const IconData(0xe909, fontFamily: 'GalleryIcons');
static const IconData page_control = const IconData(0xe90a, fontFamily: 'GalleryIcons');
static const IconData more_vert = const IconData(0xe90b, fontFamily: 'GalleryIcons');
static const IconData menu = const IconData(0xe90c, fontFamily: 'GalleryIcons');
static const IconData list_alt = const IconData(0xe90d, fontFamily: 'GalleryIcons');
static const IconData grid_on = const IconData(0xe90e, fontFamily: 'GalleryIcons');
static const IconData expand_all = const IconData(0xe90f, fontFamily: 'GalleryIcons');
static const IconData event = const IconData(0xe910, fontFamily: 'GalleryIcons');
static const IconData drive_video = const IconData(0xe911, fontFamily: 'GalleryIcons');
static const IconData dialogs = const IconData(0xe912, fontFamily: 'GalleryIcons');
static const IconData data_table = const IconData(0xe913, fontFamily: 'GalleryIcons');
static const IconData custom_typography = const IconData(0xe914, fontFamily: 'GalleryIcons');
static const IconData colors = const IconData(0xe915, fontFamily: 'GalleryIcons');
static const IconData chips = const IconData(0xe916, fontFamily: 'GalleryIcons');
static const IconData check_box = const IconData(0xe917, fontFamily: 'GalleryIcons');
static const IconData cards = const IconData(0xe918, fontFamily: 'GalleryIcons');
static const IconData buttons = const IconData(0xe919, fontFamily: 'GalleryIcons');
static const IconData bottom_sheets = const IconData(0xe91a, fontFamily: 'GalleryIcons');
static const IconData bottom_navigation = const IconData(0xe91b, fontFamily: 'GalleryIcons');
static const IconData animation = const IconData(0xe91c, fontFamily: 'GalleryIcons');
static const IconData account_box = const IconData(0xe91d, fontFamily: 'GalleryIcons');
static const IconData snackbar = const IconData(0xe91e, fontFamily: 'GalleryIcons');
static const IconData category_mdc = const IconData(0xe91f, fontFamily: 'GalleryIcons');
static const IconData cupertino_progress = const IconData(0xe920, fontFamily: 'GalleryIcons');
static const IconData cupertino_pull_to_refresh = const IconData(0xe921, fontFamily: 'GalleryIcons');
static const IconData cupertino_switch = const IconData(0xe922, fontFamily: 'GalleryIcons');
static const IconData generic_buttons = const IconData(0xe923, fontFamily: 'GalleryIcons');
static const IconData backdrop = const IconData(0xe924, fontFamily: 'GalleryIcons');
static const IconData bottom_app_bar = const IconData(0xe925, fontFamily: 'GalleryIcons');
static const IconData bottom_sheet_persistent = const IconData(0xe926, fontFamily: 'GalleryIcons');
static const IconData lists_leave_behind = const IconData(0xe927, fontFamily: 'GalleryIcons');
static const IconData tooltip = IconData(0xe900, fontFamily: 'GalleryIcons');
static const IconData text_fields_alt = IconData(0xe901, fontFamily: 'GalleryIcons');
static const IconData tabs = IconData(0xe902, fontFamily: 'GalleryIcons');
static const IconData switches = IconData(0xe903, fontFamily: 'GalleryIcons');
static const IconData sliders = IconData(0xe904, fontFamily: 'GalleryIcons');
static const IconData shrine = IconData(0xe905, fontFamily: 'GalleryIcons');
static const IconData sentiment_very_satisfied = IconData(0xe906, fontFamily: 'GalleryIcons');
static const IconData refresh = IconData(0xe907, fontFamily: 'GalleryIcons');
static const IconData progress_activity = IconData(0xe908, fontFamily: 'GalleryIcons');
static const IconData phone_iphone = IconData(0xe909, fontFamily: 'GalleryIcons');
static const IconData page_control = IconData(0xe90a, fontFamily: 'GalleryIcons');
static const IconData more_vert = IconData(0xe90b, fontFamily: 'GalleryIcons');
static const IconData menu = IconData(0xe90c, fontFamily: 'GalleryIcons');
static const IconData list_alt = IconData(0xe90d, fontFamily: 'GalleryIcons');
static const IconData grid_on = IconData(0xe90e, fontFamily: 'GalleryIcons');
static const IconData expand_all = IconData(0xe90f, fontFamily: 'GalleryIcons');
static const IconData event = IconData(0xe910, fontFamily: 'GalleryIcons');
static const IconData drive_video = IconData(0xe911, fontFamily: 'GalleryIcons');
static const IconData dialogs = IconData(0xe912, fontFamily: 'GalleryIcons');
static const IconData data_table = IconData(0xe913, fontFamily: 'GalleryIcons');
static const IconData custom_typography = IconData(0xe914, fontFamily: 'GalleryIcons');
static const IconData colors = IconData(0xe915, fontFamily: 'GalleryIcons');
static const IconData chips = IconData(0xe916, fontFamily: 'GalleryIcons');
static const IconData check_box = IconData(0xe917, fontFamily: 'GalleryIcons');
static const IconData cards = IconData(0xe918, fontFamily: 'GalleryIcons');
static const IconData buttons = IconData(0xe919, fontFamily: 'GalleryIcons');
static const IconData bottom_sheets = IconData(0xe91a, fontFamily: 'GalleryIcons');
static const IconData bottom_navigation = IconData(0xe91b, fontFamily: 'GalleryIcons');
static const IconData animation = IconData(0xe91c, fontFamily: 'GalleryIcons');
static const IconData account_box = IconData(0xe91d, fontFamily: 'GalleryIcons');
static const IconData snackbar = IconData(0xe91e, fontFamily: 'GalleryIcons');
static const IconData category_mdc = IconData(0xe91f, fontFamily: 'GalleryIcons');
static const IconData cupertino_progress = IconData(0xe920, fontFamily: 'GalleryIcons');
static const IconData cupertino_pull_to_refresh = IconData(0xe921, fontFamily: 'GalleryIcons');
static const IconData cupertino_switch = IconData(0xe922, fontFamily: 'GalleryIcons');
static const IconData generic_buttons = IconData(0xe923, fontFamily: 'GalleryIcons');
static const IconData backdrop = IconData(0xe924, fontFamily: 'GalleryIcons');
static const IconData bottom_app_bar = IconData(0xe925, fontFamily: 'GalleryIcons');
static const IconData bottom_sheet_persistent = IconData(0xe926, fontFamily: 'GalleryIcons');
static const IconData lists_leave_behind = IconData(0xe927, fontFamily: 'GalleryIcons');
}

View File

@ -84,7 +84,7 @@ class GalleryOptions {
}
const double _kItemHeight = 48.0;
const EdgeInsetsDirectional _kItemPadding = const EdgeInsetsDirectional.only(start: 56.0);
const EdgeInsetsDirectional _kItemPadding = EdgeInsetsDirectional.only(start: 56.0);
class _OptionsItem extends StatelessWidget {
const _OptionsItem({ Key key, this.child }) : super(key: key);

View File

@ -28,10 +28,10 @@ class GalleryTextScaleValue {
}
const List<GalleryTextScaleValue> kAllGalleryTextScaleValues = const <GalleryTextScaleValue>[
const GalleryTextScaleValue(null, 'System Default'),
const GalleryTextScaleValue(0.8, 'Small'),
const GalleryTextScaleValue(1.0, 'Normal'),
const GalleryTextScaleValue(1.3, 'Large'),
const GalleryTextScaleValue(2.0, 'Huge'),
const List<GalleryTextScaleValue> kAllGalleryTextScaleValues = <GalleryTextScaleValue>[
GalleryTextScaleValue(null, 'System Default'),
GalleryTextScaleValue(0.8, 'Small'),
GalleryTextScaleValue(1.0, 'Normal'),
GalleryTextScaleValue(1.3, 'Large'),
GalleryTextScaleValue(2.0, 'Huge'),
];

View File

@ -19,27 +19,27 @@ class SyntaxHighlighterStyle {
static SyntaxHighlighterStyle lightThemeStyle() {
return new SyntaxHighlighterStyle(
baseStyle: const TextStyle(color: const Color(0xFF000000)),
numberStyle: const TextStyle(color: const Color(0xFF1565C0)),
commentStyle: const TextStyle(color: const Color(0xFF9E9E9E)),
keywordStyle: const TextStyle(color: const Color(0xFF9C27B0)),
stringStyle: const TextStyle(color: const Color(0xFF43A047)),
punctuationStyle: const TextStyle(color: const Color(0xFF000000)),
classStyle: const TextStyle(color: const Color(0xFF512DA8)),
constantStyle: const TextStyle(color: const Color(0xFF795548))
baseStyle: const TextStyle(color: Color(0xFF000000)),
numberStyle: const TextStyle(color: Color(0xFF1565C0)),
commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
keywordStyle: const TextStyle(color: Color(0xFF9C27B0)),
stringStyle: const TextStyle(color: Color(0xFF43A047)),
punctuationStyle: const TextStyle(color: Color(0xFF000000)),
classStyle: const TextStyle(color: Color(0xFF512DA8)),
constantStyle: const TextStyle(color: Color(0xFF795548))
);
}
static SyntaxHighlighterStyle darkThemeStyle() {
return new SyntaxHighlighterStyle(
baseStyle: const TextStyle(color: const Color(0xFFFFFFFF)),
numberStyle: const TextStyle(color: const Color(0xFF1565C0)),
commentStyle: const TextStyle(color: const Color(0xFF9E9E9E)),
keywordStyle: const TextStyle(color: const Color(0xFF80CBC4)),
stringStyle: const TextStyle(color: const Color(0xFF009688)),
punctuationStyle: const TextStyle(color: const Color(0xFFFFFFFF)),
classStyle: const TextStyle(color: const Color(0xFF009688)),
constantStyle: const TextStyle(color: const Color(0xFF795548))
baseStyle: const TextStyle(color: Color(0xFFFFFFFF)),
numberStyle: const TextStyle(color: Color(0xFF1565C0)),
commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
keywordStyle: const TextStyle(color: Color(0xFF80CBC4)),
stringStyle: const TextStyle(color: Color(0xFF009688)),
punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
classStyle: const TextStyle(color: Color(0xFF009688)),
constantStyle: const TextStyle(color: Color(0xFF795548))
);
}
@ -65,7 +65,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
SyntaxHighlighterStyle _style;
static const List<String> _keywords = const <String>[
static const List<String> _keywords = <String>[
'abstract', 'as', 'assert', 'async', 'await', 'break', 'case', 'catch',
'class', 'const', 'continue', 'default', 'deferred', 'do', 'dynamic', 'else',
'enum', 'export', 'external', 'extends', 'factory', 'false', 'final',
@ -75,7 +75,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
'void', 'while', 'with', 'yield'
];
static const List<String> _builtInTypes = const <String>[
static const List<String> _builtInTypes = <String>[
'int', 'double', 'num', 'bool'
];

View File

@ -23,7 +23,7 @@ TextTheme _buildTextTheme(TextTheme base) {
}
ThemeData _buildDarkTheme() {
const Color primaryColor = const Color(0xFF0175c2);
const Color primaryColor = Color(0xFF0175c2);
final ThemeData base = new ThemeData.dark();
return base.copyWith(
primaryColor: primaryColor,
@ -44,7 +44,7 @@ ThemeData _buildDarkTheme() {
}
ThemeData _buildLightTheme() {
const Color primaryColor = const Color(0xFF0175c2);
const Color primaryColor = Color(0xFF0175c2);
final ThemeData base = new ThemeData.light();
return base.copyWith(
primaryColor: primaryColor,

View File

@ -14,11 +14,11 @@ import 'package:flutter_gallery/gallery/demos.dart';
import 'package:flutter_gallery/gallery/app.dart' show GalleryApp;
// Reports success or failure to the native code.
const MethodChannel _kTestChannel = const MethodChannel('io.flutter.demo.gallery/TestLifecycleListener');
const MethodChannel _kTestChannel = MethodChannel('io.flutter.demo.gallery/TestLifecycleListener');
// We don't want to wait for animations to complete before tapping the
// back button in the demos with these titles.
const List<String> _kUnsynchronizedDemoTitles = const <String>[
const List<String> _kUnsynchronizedDemoTitles = <String>[
'Progress indicators',
'Activity Indicator',
'Video',
@ -26,7 +26,7 @@ const List<String> _kUnsynchronizedDemoTitles = const <String>[
// These demos can't be backed out of by tapping a button whose
// tooltip is 'Back'.
const List<String> _kSkippedDemoTitles = const <String>[
const List<String> _kSkippedDemoTitles = <String>[
'Pull to refresh',
'Progress indicators',
'Activity Indicator',

View File

@ -16,10 +16,10 @@ void main() {
await tester.pumpWidget(
// The bug only manifests itself when the screen's orientation is portrait
const Center(
child: const SizedBox(
child: SizedBox(
width: 450.0,
height: 800.0,
child: const GalleryApp(testMode: true)
child: GalleryApp(testMode: true)
)
)
);

View File

@ -11,7 +11,7 @@ import 'package:flutter_driver/flutter_driver.dart';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
const FileSystem _fs = const LocalFileSystem();
const FileSystem _fs = LocalFileSystem();
// Demos for which timeline data will be collected using
// FlutterDriver.traceAction().
@ -23,7 +23,7 @@ const FileSystem _fs = const LocalFileSystem();
//
// These names must match GalleryItem titles from kAllGalleryDemos
// in examples/flutter_gallery/lib/gallery/demos.dart
const List<String> kProfiledDemos = const <String>[
const List<String> kProfiledDemos = <String>[
'Shrine@Studies',
'Contact profile@Studies',
'Animation@Studies',
@ -39,13 +39,13 @@ const List<String> kProfiledDemos = const <String>[
//
// These names must match GalleryItem titles from kAllGalleryDemos
// in examples/flutter_gallery/lib/gallery/demos.dart
const List<String> kUnsynchronizedDemos = const <String>[
const List<String> kUnsynchronizedDemos = <String>[
'Progress indicators@Material',
'Activity Indicator@Cupertino',
'Video@Media',
];
const List<String> kSkippedDemos = const <String>[
const List<String> kSkippedDemos = <String>[
'Pull to refresh@Cupertino', // The back button lacks a tooltip.
];
@ -220,6 +220,6 @@ void main([List<String> args = const <String>[]]) {
final Set<String> unprofiledDemos = new Set<String>.from(_allDemos)..removeAll(kProfiledDemos);
await runDemos(unprofiledDemos.toList(), driver);
}, timeout: const Timeout(const Duration(minutes: 5)));
}, timeout: const Timeout(Duration(minutes: 5)));
});
}

View File

@ -30,7 +30,7 @@ class _MyHomePageState extends State<MyHomePage> {
static const String _pong = 'pong';
static const String _emptyMessage = '';
static const BasicMessageChannel<String> platform =
const BasicMessageChannel<String>(_channel, const StringCodec());
BasicMessageChannel<String>(_channel, StringCodec());
int _counter = 0;
@ -69,7 +69,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: new Row(
children: <Widget>[
new Image.asset('assets/flutter-mark-square-64.png', scale: 1.5),
const Text('Flutter', style: const TextStyle(fontSize: 30.0)),
const Text('Flutter', style: TextStyle(fontSize: 30.0)),
],
),
),

View File

@ -4,4 +4,4 @@
import 'package:flutter/widgets.dart';
void main() => runApp(const Center(child: const Text('برنامج أهلا بالعالم', textDirection: TextDirection.rtl)));
void main() => runApp(const Center(child: Text('برنامج أهلا بالعالم', textDirection: TextDirection.rtl)));

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