Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev/manual_tests/card_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class CardCollectionState extends State<CardCollection> {
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.bold);

// TODO(hansmuller): need a local image asset
static const _sunshineURL = "http://www.walltor.com/images/wallpaper/good-morning-sunshine-58540.jpg";
static const String _sunshineURL = "http://www.walltor.com/images/wallpaper/good-morning-sunshine-58540.jpg";

static const kCardMargins = 8.0;
static const double kCardMargins = 8.0;

final TextStyle backgroundTextStyle =
Typography.white.title.copyWith(textAlign: TextAlign.center);
Expand Down
2 changes: 1 addition & 1 deletion dev/manual_tests/pageable_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PageableListAppState extends State<PageableListApp> {
List<Size> cardSizes = [
[100.0, 300.0], [300.0, 100.0], [200.0, 400.0], [400.0, 400.0], [300.0, 400.0]
]
.map((args) => new Size(args[0], args[1]))
.map((List<double> args) => new Size(args[0], args[1]))
.toList();

cardModels = new List<CardModel>.generate(cardSizes.length, (int i) {
Expand Down
12 changes: 6 additions & 6 deletions examples/layers/services/media_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PianoKey {
player.ptr.pause();
}

Future load(MediaServiceProxy mediaService) async {
Future<Null> load(MediaServiceProxy mediaService) async {
try {
mediaService.ptr.createPlayer(player);
UrlResponse response = await fetchUrl(soundUrl);
Expand All @@ -61,11 +61,11 @@ class PianoApp extends StatelessComponent {
new PianoKey(Colors.purple[500], iLoveYou),
];

Future loadSounds() async {
Future<Null> loadSounds() async {
MediaServiceProxy mediaService = new MediaServiceProxy.unbound();
try {
shell.connectToService("mojo:media_service", mediaService);
List<Future<MediaPlayerPrepareResponseParams>> pending = <Future<MediaPlayerPrepareResponseParams>>[];
List<Future<Null>> pending = <Future<Null>>[];
for (PianoKey key in keys)
pending.add(key.load(mediaService));
await Future.wait(pending);
Expand Down Expand Up @@ -93,8 +93,8 @@ class PianoApp extends StatelessComponent {
}

Widget statusBox(Widget child) {
const mediumGray = const Color(0xff555555);
const darkGray = const Color(0xff222222);
const Color mediumGray = const Color(0xff555555);
const Color darkGray = const Color(0xff222222);
return new Center(
child: new Container(
decoration: const BoxDecoration(
Expand All @@ -121,7 +121,7 @@ Widget splashScreen() {
);
}

Future main() async {
Future<Null> main() async {
runApp(splashScreen());

PianoApp app = new PianoApp();
Expand Down
10 changes: 5 additions & 5 deletions examples/material_gallery/lib/demo/buttons_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
tooltip: 'Open FAB demos',
child: new Icon(icon: Icons.add),
onPressed: () {
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (BuildContext context) => new TabsFabDemo()
));
}
Expand All @@ -97,7 +97,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
new RaisedButton(
child: new Text("Launch Demo"),
onPressed: () {
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (BuildContext context) => new SnackBarDemo()
));
}
Expand Down Expand Up @@ -127,7 +127,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
new FlatButton(
child: new Text("Launch Demo"),
onPressed: () {
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (_) => new DialogDemo()
));
}
Expand Down Expand Up @@ -200,10 +200,10 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
center: new Text("Buttons"),
tabBar: new TabBar<_ButtonDemo>(
isScrollable: true,
labels: new Map.fromIterable(demos, value: (_ButtonDemo demo) => demo.tabLabel)
labels: new Map<_ButtonDemo, TabLabel>.fromIterable(demos, value: (_ButtonDemo demo) => demo.tabLabel)
)
),
body: new TabBarView(
body: new TabBarView<_ButtonDemo>(
children: demos.map(buildTabView).toList()
)
)
Expand Down
8 changes: 4 additions & 4 deletions examples/material_gallery/lib/demo/colors_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class ColorSwatchTabView extends StatelessComponent {
}

final ColorSwatch swatch;
final blackTextStyle = Typography.black.body1;
final whiteTextStyle = Typography.white.body1;
final TextStyle blackTextStyle = Typography.black.body1;
final TextStyle whiteTextStyle = Typography.white.body1;

Widget build(BuildContext context) {
List<Widget> colorItems = swatch.colors.keys.map((int index) {
Expand Down Expand Up @@ -116,12 +116,12 @@ class ColorsDemo extends StatelessComponent {
center: new Text("Colors"),
tabBar: new TabBar<ColorSwatch>(
isScrollable: true,
labels: new Map.fromIterable(colorSwatches, value: (ColorSwatch swatch) {
labels: new Map<ColorSwatch, TabLabel>.fromIterable(colorSwatches, value: (ColorSwatch swatch) {
return new TabLabel(text: swatch.name);
})
)
),
body: new TabBarView(
body: new TabBarView<ColorSwatch>(
children: colorSwatches.map((ColorSwatch swatch) {
return new ColorSwatchTabView(swatch: swatch);
})
Expand Down
2 changes: 1 addition & 1 deletion examples/material_gallery/lib/demo/date_picker_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DatePickerDemo extends StatefulComponent {
class _DatePickerDemoState extends State<DatePickerDemo> {
DateTime _selectedDate = new DateTime.now();

Future _handleSelectDate() async {
Future<Null> _handleSelectDate() async {
DateTime picked = await showDatePicker(
context: context,
initialDate: _selectedDate,
Expand Down
16 changes: 8 additions & 8 deletions examples/material_gallery/lib/demo/dialog_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ class DialogDemo extends StatefulComponent {
class DialogDemoState extends State<DialogDemo> {
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();

void showDemoDialog({ BuildContext context, Dialog dialog }) {
showDialog(
void showDemoDialog/*<T>*/({ BuildContext context, Dialog dialog }) {
showDialog/*<T>*/(
context: context,
child: dialog
)
.then((dynamic value) { // The value passed to Navigator.pop() or null.
.then((dynamic/*=T*/ value) { // The value passed to Navigator.pop() or null.
if (value != null) {
scaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text('You selected: $value')
Expand All @@ -89,7 +89,7 @@ class DialogDemoState extends State<DialogDemo> {
new RaisedButton(
child: new Text('ALERT'),
onPressed: () {
showDemoDialog(
showDemoDialog/*<DialogDemoAction>*/(
context: context,
dialog: new Dialog(
content: new Text(
Expand All @@ -113,7 +113,7 @@ class DialogDemoState extends State<DialogDemo> {
new RaisedButton(
child: new Text('ALERT WITH TITLE'),
onPressed: () {
showDemoDialog(
showDemoDialog/*<DialogDemoAction>*/(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a strange syntax.

context: context,
dialog: new Dialog(
title: new Text("Use Google's location service?"),
Expand All @@ -138,7 +138,7 @@ class DialogDemoState extends State<DialogDemo> {
new RaisedButton(
child: new Text('SIMPLE'),
onPressed: () {
showDemoDialog(
showDemoDialog/*<String>*/(
context: context,
dialog: new Dialog(
title: new Text('Set backup account'),
Expand Down Expand Up @@ -174,7 +174,7 @@ class DialogDemoState extends State<DialogDemo> {
context: context,
initialTime: const TimeOfDay(hour: 15, minute: 30)
)
.then((value) { // The value passed to Navigator.pop() or null.
.then((TimeOfDay value) { // The value passed to Navigator.pop() or null.
if (value != null) {
scaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text('You selected: $value')
Expand All @@ -186,7 +186,7 @@ class DialogDemoState extends State<DialogDemo> {
new RaisedButton(
child: new Text('FULLSCREEN'),
onPressed: () {
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (BuildContext context) => new FullScreenDialogDemo()
));
}
Expand Down
8 changes: 4 additions & 4 deletions examples/material_gallery/lib/demo/fitness_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _FitnessDemoContents extends StatefulComponent {

class _FitnessDemoContentsState extends State<_FitnessDemoContents> {

Future _loadAssets(AssetBundle bundle) async {
Future<Null> _loadAssets(AssetBundle bundle) async {
_images = new ImageMap(bundle);
await _images.load(<String>[
'packages/flutter_gallery_assets/jumpingjack.png',
Expand Down Expand Up @@ -267,9 +267,9 @@ class _WorkoutAnimationNode extends NodeWithSize {
class _ProgressCircle extends NodeWithSize {
_ProgressCircle(Size size, [this.value = 0.0]) : super(size);

static const _kTwoPI = math.PI * 2.0;
static const _kEpsilon = .0000001;
static const _kSweep = _kTwoPI - _kEpsilon;
static const double _kTwoPI = math.PI * 2.0;
static const double _kEpsilon = .0000001;
static const double _kSweep = _kTwoPI - _kEpsilon;

double value;

Expand Down
4 changes: 2 additions & 2 deletions examples/material_gallery/lib/demo/grid_list_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GridDemoPhotoItem extends StatelessComponent {
final GridDemoTileStyle tileStyle;

void showPhoto(BuildContext context) {
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (BuildContext context) {
return new Scaffold(
toolBar: new ToolBar(
Expand Down Expand Up @@ -138,7 +138,7 @@ class GridListDemoState extends State<GridListDemo> {
GridDemoTileStyle tileStyle = GridDemoTileStyle.twoLine;

void showTileStyleMenu(BuildContext context) {
final List<PopupMenuItem> items = <PopupMenuItem<GridDemoTileStyle>>[
final List<PopupMenuItem<GridDemoTileStyle>> items = <PopupMenuItem<GridDemoTileStyle>>[
new PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.imageOnly,
child: new Text('Image only')
Expand Down
4 changes: 2 additions & 2 deletions examples/material_gallery/lib/demo/leave_behind_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
List<LeaveBehindItem> leaveBehindItems;

void initListItems() {
leaveBehindItems = new List.generate(16, (int index) {
leaveBehindItems = new List<LeaveBehindItem>.generate(16, (int index) {
return new LeaveBehindItem(
index: index,
name: 'Item $index Sender',
Expand Down Expand Up @@ -130,7 +130,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
right: <Widget>[
new PopupMenuButton<LeaveBehindDemoAction>(
onSelected: handleDemoAction,
items: <PopupMenuEntry>[
items: <PopupMenuEntry<LeaveBehindDemoAction>>[
new PopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.reset,
child: new Text('Reset the list')
Expand Down
2 changes: 1 addition & 1 deletion examples/material_gallery/lib/demo/list_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ListDemo extends StatefulComponent {
class ListDemoState extends State<ListDemo> {
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();

ScaffoldFeatureController _bottomSheet;
PersistentBottomSheetController<Null> _bottomSheet;
ListDemoItemSize _itemSize = ListDemoItemSize.threeLine;
bool _dense = false;
bool _showAvatars = true;
Expand Down
2 changes: 1 addition & 1 deletion examples/material_gallery/lib/demo/menu_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class MenuDemoState extends State<MenuDemo> {
right: new PopupMenuButton<String>(
onSelected: showCheckedMenuSelections,
items: <PopupMenuItem<String>>[
new CheckedPopupMenuItem(
new CheckedPopupMenuItem<String>(
value: _checkedValue1,
checked: isChecked(_checkedValue1),
child: new Text(_checkedValue1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ModalBottomSheetDemo extends StatelessComponent {
child: new RaisedButton(
child: new Text('Show the modal bottom sheet', style: textStyle),
onPressed: () {
showModalBottomSheet(context: context, builder: (_) {
showModalBottomSheet/*<Null>*/(context: context, builder: (BuildContext context) {
return new Container(
child: new Padding(
padding: const EdgeDims.all(32.0),
Expand Down
4 changes: 2 additions & 2 deletions examples/material_gallery/lib/demo/page_selector_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
class PageSelectorDemo extends StatelessComponent {

void _handleArrowButtonPress(BuildContext context, int delta) {
final TabBarSelectionState selection = TabBarSelection.of(context);
final TabBarSelectionState<IconData> selection = TabBarSelection.of/*<IconData>*/(context);
if (!selection.valueIsChanging)
selection.value = selection.values[(selection.index + delta).clamp(0, selection.values.length - 1)];
}
Expand Down Expand Up @@ -53,7 +53,7 @@ class PageSelectorDemo extends StatelessComponent {
)
),
new Flexible(
child: new TabBarView(
child: new TabBarView<IconData>(
children: icons.map((IconData icon) {
return new Container(
key: new ObjectKey(icon),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _TechniqueItem extends StatelessComponent {
final WidgetBuilder builder;

void showDemo(BuildContext context) {
Navigator.push(context, new MaterialPageRoute(builder: builder));
Navigator.push(context, new MaterialPageRoute<Null>(builder: builder));
}

Widget build(BuildContext context) {
Expand Down
8 changes: 4 additions & 4 deletions examples/material_gallery/lib/demo/tabs_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ class TabsDemo extends StatelessComponent {

Widget build(BuildContext context) {
final Color iconColor = Theme.of(context).accentColor;
return new TabBarSelection(
return new TabBarSelection<IconData>(
values: icons,
child: new Scaffold(
toolBar: new ToolBar(
center: new Text("Scrollable Tabs"),
tabBar: new TabBar<String>(
tabBar: new TabBar<IconData>(
isScrollable: true,
labels: new Map.fromIterable(
labels: new Map<IconData, TabLabel>.fromIterable(
icons,
value: (IconData icon) => new TabLabel(text: labels[icon], icon: icon)
)
)
),
body: new TabBarView(
body: new TabBarView<IconData>(
children: icons.map((IconData icon) {
return new Container(
key: new ObjectKey(icon),
Expand Down
4 changes: 2 additions & 2 deletions examples/material_gallery/lib/demo/tabs_fab_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
toolBar: new ToolBar(
center: new Text("FAB per Tab"),
tabBar: new TabBar<_Page>(
labels: new Map.fromIterable(pages, value: (_Page page) => page.tabLabel)
labels: new Map<_Page, TabLabel>.fromIterable(pages, value: (_Page page) => page.tabLabel)
)
),
floatingActionButton: !selectedPage.fabDefined ? null : new FloatingActionButton(
Expand All @@ -107,7 +107,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
child: selectedPage.fabIcon,
onPressed: _showExplanatoryText
),
body: new TabBarView(children: pages.map(buildTabView).toList())
body: new TabBarView<_Page>(children: pages.map(buildTabView).toList())
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/material_gallery/lib/demo/time_picker_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TimePickerDemo extends StatefulComponent {
class _TimePickerDemoState extends State<TimePickerDemo> {
TimeOfDay _selectedTime = const TimeOfDay(hour: 7, minute: 28);

Future _handleSelectTime() async {
Future<Null> _handleSelectTime() async {
TimeOfDay picked = await showTimePicker(
context: context,
initialTime: _selectedTime
Expand Down
2 changes: 1 addition & 1 deletion examples/material_gallery/lib/demo/weather_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WeatherDemo extends StatefulComponent {

class _WeatherDemoState extends State<WeatherDemo> {

Future _loadAssets(AssetBundle bundle) async {
Future<Null> _loadAssets(AssetBundle bundle) async {
_images = new ImageMap(bundle);
await _images.load(<String>[
'packages/flutter_gallery_assets/clouds-0.png',
Expand Down
4 changes: 2 additions & 2 deletions examples/material_gallery/lib/gallery/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GallerySection extends StatelessComponent {
final List<GalleryDemo> demos;

void showDemo(GalleryDemo demo, BuildContext context, ThemeData theme) {
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (BuildContext context) {
Widget child = (demo.builder == null) ? null : demo.builder();
return new Theme(data: theme, child: child);
Expand All @@ -31,7 +31,7 @@ class GallerySection extends StatelessComponent {
);
final double appBarHeight = 200.0;
final Key scrollableKey = new ValueKey<String>(title); // assume section titles differ
Navigator.push(context, new MaterialPageRoute(
Navigator.push(context, new MaterialPageRoute<Null>(
builder: (BuildContext context) {
return new Theme(
data: theme,
Expand Down
Loading