add missing type parameter on methods (#22096)
This commit is contained in:
committed by
GitHub
parent
48fb726b01
commit
f62afdcf57
@@ -89,7 +89,7 @@ class SampleInfo {
|
||||
final String classNames = commentValues['classes'];
|
||||
if (classNames == null)
|
||||
return const <String>[];
|
||||
return classNames.split(',').map((String s) => s.trim()).where((String s) => s.isNotEmpty);
|
||||
return classNames.split(',').map<String>((String s) => s.trim()).where((String s) => s.isNotEmpty);
|
||||
}
|
||||
|
||||
// The relative import path for this sample, like '../lib/foo.dart'.
|
||||
@@ -163,7 +163,7 @@ void generate(String commit) {
|
||||
final String entryTemplate = inputFile('bin', 'entry.md.template').readAsStringSync();
|
||||
|
||||
// Write the sample catalog's home page: index.md
|
||||
final Iterable<String> entries = samples.map((SampleInfo sample) {
|
||||
final Iterable<String> entries = samples.map<String>((SampleInfo sample) {
|
||||
return expandTemplate(entryTemplate, sample.commentValues);
|
||||
});
|
||||
writeExpandedTemplate(
|
||||
@@ -195,7 +195,7 @@ void generate(String commit) {
|
||||
}
|
||||
}
|
||||
for (String className in classToSamples.keys) {
|
||||
final Iterable<String> entries = classToSamples[className].map((SampleInfo sample) {
|
||||
final Iterable<String> entries = classToSamples[className].map<String>((SampleInfo sample) {
|
||||
return expandTemplate(entryTemplate, sample.commentValues);
|
||||
});
|
||||
writeExpandedTemplate(
|
||||
@@ -215,10 +215,10 @@ void generate(String commit) {
|
||||
outputFile('screenshot.dart', driverDirectory),
|
||||
inputFile('bin', 'screenshot.dart.template').readAsStringSync(),
|
||||
<String, String>{
|
||||
'imports': samples.map((SampleInfo page) {
|
||||
'imports': samples.map<String>((SampleInfo page) {
|
||||
return "import '${page.importPath}' show ${page.sampleClass};\n";
|
||||
}).toList().join(),
|
||||
'widgets': samples.map((SampleInfo sample) {
|
||||
'widgets': samples.map<String>((SampleInfo sample) {
|
||||
return 'new ${sample.sampleClass}(),\n';
|
||||
}).toList().join(),
|
||||
},
|
||||
@@ -230,7 +230,7 @@ void generate(String commit) {
|
||||
outputFile('screenshot_test.dart', driverDirectory),
|
||||
inputFile('bin', 'screenshot_test.dart.template').readAsStringSync(),
|
||||
<String, String>{
|
||||
'paths': samples.map((SampleInfo sample) {
|
||||
'paths': samples.map<String>((SampleInfo sample) {
|
||||
return "'${outputFile(sample.sourceName + '.png').path}'";
|
||||
}).toList().join(',\n'),
|
||||
},
|
||||
|
||||
@@ -63,7 +63,7 @@ class _AppBarBottomSampleState extends State<AppBarBottomSample> with SingleTick
|
||||
),
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: choices.map((Choice choice) {
|
||||
children: choices.map<Widget>((Choice choice) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ChoiceCard(choice: choice),
|
||||
|
||||
@@ -37,7 +37,7 @@ class _BasicAppBarSampleState extends State<BasicAppBarSample> {
|
||||
PopupMenuButton<Choice>( // overflow menu
|
||||
onSelected: _select,
|
||||
itemBuilder: (BuildContext context) {
|
||||
return choices.skip(2).map((Choice choice) {
|
||||
return choices.skip(2).map<PopupMenuItem<Choice>>((Choice choice) {
|
||||
return PopupMenuItem<Choice>(
|
||||
value: choice,
|
||||
child: Text(choice.title),
|
||||
|
||||
@@ -50,7 +50,7 @@ class AdjustableDropdownListTile extends StatelessWidget {
|
||||
trailing: DropdownButton<String>(
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
items: items.map((String item) {
|
||||
items: items.map<DropdownMenuItem<String>>((String item) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: Text(item),
|
||||
|
||||
@@ -78,7 +78,7 @@ class EntryItem extends StatelessWidget {
|
||||
return ExpansionTile(
|
||||
key: PageStorageKey<Entry>(root),
|
||||
title: Text(root.title),
|
||||
children: root.children.map(_buildTiles).toList(),
|
||||
children: root.children.map<Widget>(_buildTiles).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class TabbedAppBarSample extends StatelessWidget {
|
||||
title: const Text('Tabbed AppBar'),
|
||||
bottom: TabBar(
|
||||
isScrollable: true,
|
||||
tabs: choices.map((Choice choice) {
|
||||
tabs: choices.map<Widget>((Choice choice) {
|
||||
return Tab(
|
||||
text: choice.title,
|
||||
icon: Icon(choice.icon),
|
||||
@@ -24,7 +24,7 @@ class TabbedAppBarSample extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: choices.map((Choice choice) {
|
||||
children: choices.map<Widget>((Choice choice) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ChoiceCard(choice: choice),
|
||||
|
||||
Reference in New Issue
Block a user