add missing type parameter on methods (#22096)
This commit is contained in:
committed by
GitHub
parent
48fb726b01
commit
f62afdcf57
@@ -22,7 +22,7 @@ class IconsList extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
children: samples.map((IconSample s) => IconSampleRow(s)).toList(),
|
||||
children: samples.map<IconSampleRow>((IconSample s) => IconSampleRow(s)).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
|
||||
appBar: AppBar(
|
||||
title: const Text('Animation'),
|
||||
bottom: TabBar(
|
||||
tabs: _allDemos.map((_ArcDemo demo) => Tab(text: demo.title)).toList(),
|
||||
tabs: _allDemos.map<Tab>((_ArcDemo demo) => Tab(text: demo.title)).toList(),
|
||||
),
|
||||
),
|
||||
floatingActionButton: Builder(
|
||||
@@ -466,7 +466,7 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
|
||||
},
|
||||
),
|
||||
body: TabBarView(
|
||||
children: _allDemos.map((_ArcDemo demo) => demo.builder(demo)).toList()
|
||||
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -119,7 +119,7 @@ class PageViewAppState extends State<PageViewApp> {
|
||||
|
||||
Widget _buildBody(BuildContext context) {
|
||||
return PageView(
|
||||
children: cardModels.map(buildCard).toList(),
|
||||
children: cardModels.map<Widget>(buildCard).toList(),
|
||||
// TODO(abarth): itemsWrap: itemsWrap,
|
||||
scrollDirection: scrollDirection,
|
||||
);
|
||||
|
||||
@@ -189,7 +189,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
||||
switch (_random.nextInt(10)) {
|
||||
case 0:
|
||||
if (value == null)
|
||||
return pickFromList(_random, Colors.primaries)[(_random.nextInt(9) + 1) * 100];
|
||||
return pickFromList<MaterialColor>(_random, Colors.primaries)[(_random.nextInt(9) + 1) * 100];
|
||||
switch (_random.nextInt(4)) {
|
||||
case 0:
|
||||
return value.withAlpha(value.alpha + _random.nextInt(10) - 5);
|
||||
@@ -240,7 +240,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
||||
case 0:
|
||||
return null;
|
||||
case 1:
|
||||
return pickFromList(_random, TextDecorationStyle.values);
|
||||
return pickFromList<TextDecorationStyle>(_random, TextDecorationStyle.values);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -250,7 +250,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
||||
case 0:
|
||||
return null;
|
||||
case 1:
|
||||
return pickFromList(_random, FontWeight.values);
|
||||
return pickFromList<FontWeight>(_random, FontWeight.values);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
||||
case 0:
|
||||
return null;
|
||||
case 1:
|
||||
return pickFromList(_random, FontStyle.values);
|
||||
return pickFromList<FontStyle>(_random, FontStyle.values);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -938,7 +938,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
|
||||
if (mounted && intrinsicKey.currentContext.size.height != controlKey.currentContext.size.height) {
|
||||
debugPrint('Found some text that unexpectedly renders at different heights.');
|
||||
debugPrint('Text: $_text');
|
||||
debugPrint(_text.runes.map((int index) => 'U+' + index.toRadixString(16).padLeft(4, '0')).join(' '));
|
||||
debugPrint(_text.runes.map<String>((int index) => 'U+' + index.toRadixString(16).padLeft(4, '0')).join(' '));
|
||||
setState(() {
|
||||
_ticker.stop();
|
||||
});
|
||||
@@ -1045,7 +1045,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
|
||||
FlatButton(
|
||||
onPressed: _ticker.isActive ? null : () {
|
||||
print('The currently visible text is: $_text');
|
||||
print(_text.runes.map((int value) => 'U+${value.toRadixString(16).padLeft(4, '0').toUpperCase()}').join(' '));
|
||||
print(_text.runes.map<String>((int value) => 'U+${value.toRadixString(16).padLeft(4, '0').toUpperCase()}').join(' '));
|
||||
},
|
||||
child: const Text('DUMP TEXT TO LOGS'),
|
||||
),
|
||||
@@ -2109,7 +2109,7 @@ int randomCharacter(math.Random random) {
|
||||
Range(0x2ceb0, 0x2ebe0),
|
||||
Range(0x2f800, 0x2fa1d),
|
||||
];
|
||||
final Range range = pickFromList(random, characterRanges);
|
||||
final Range range = pickFromList<Range>(random, characterRanges);
|
||||
if (range.start == range.end)
|
||||
return range.start;
|
||||
return range.start + random.nextInt(range.end - range.start);
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'mock_image_http.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Card Collection smoke test', (WidgetTester tester) async {
|
||||
HttpOverrides.runZoned(() async {
|
||||
HttpOverrides.runZoned<Future<void>>(() async {
|
||||
card_collection.main(); // builds the app and schedules a frame but doesn't trigger one
|
||||
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
||||
await tester.pump(); // triggers a frame
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'mock_image_http.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Color testing demo smoke test', (WidgetTester tester) async {
|
||||
HttpOverrides.runZoned(() async {
|
||||
HttpOverrides.runZoned<Future<void>>(() async {
|
||||
color_testing_demo.main(); // builds the app and schedules a frame but doesn't trigger one
|
||||
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
||||
await tester.pump(); // triggers a frame
|
||||
|
||||
Reference in New Issue
Block a user