mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add missing trailing commas (#28673)
* add trailing commas on list/map/parameters * add trailing commas on Invocation with nb of arg>1 * add commas for widget containing widgets * add trailing commas if instantiation contains trailing comma * revert bad change
This commit is contained in:
parent
046f960ae2
commit
387f885481
@ -71,7 +71,7 @@ class TileScrollLayout extends StatelessWidget {
|
|||||||
child: IconBar(),
|
child: IconBar(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
drawer: const GalleryDrawer(),
|
drawer: const GalleryDrawer(),
|
||||||
);
|
);
|
||||||
@ -101,8 +101,8 @@ class ComplexLayoutState extends State<ComplexLayout> {
|
|||||||
print('Pressed search');
|
print('Pressed search');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TopBarMenu()
|
TopBarMenu(),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -115,7 +115,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
|
|||||||
else
|
else
|
||||||
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
|
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
BottomBar(),
|
BottomBar(),
|
||||||
],
|
],
|
||||||
@ -133,45 +133,45 @@ class TopBarMenu extends StatelessWidget {
|
|||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Friends',
|
value: 'Friends',
|
||||||
child: MenuItemWithIcon(Icons.people, 'Friends', '5 new')
|
child: MenuItemWithIcon(Icons.people, 'Friends', '5 new'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
|
child: MenuItemWithIcon(Icons.event, 'Events', '12 upcoming'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.group, 'Groups', '14')
|
child: MenuItemWithIcon(Icons.group, 'Groups', '14'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.image, 'Pictures', '12')
|
child: MenuItemWithIcon(Icons.image, 'Pictures', '12'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
|
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Friends',
|
value: 'Friends',
|
||||||
child: MenuItemWithIcon(Icons.people, 'Friends', '5')
|
child: MenuItemWithIcon(Icons.people, 'Friends', '5'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.event, 'Events', '12')
|
child: MenuItemWithIcon(Icons.event, 'Events', '12'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.group, 'Groups', '14')
|
child: MenuItemWithIcon(Icons.group, 'Groups', '14'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.image, 'Pictures', '12')
|
child: MenuItemWithIcon(Icons.image, 'Pictures', '12'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
|
child: MenuItemWithIcon(Icons.near_me, 'Nearby', '33'),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,10 +190,10 @@ class MenuItemWithIcon extends StatelessWidget {
|
|||||||
Icon(icon),
|
Icon(icon),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||||||
child: Text(title)
|
child: Text(title),
|
||||||
),
|
),
|
||||||
Text(subtitle, style: Theme.of(context).textTheme.caption)
|
Text(subtitle, style: Theme.of(context).textTheme.caption),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,11 +213,11 @@ class FancyImageItem extends StatelessWidget {
|
|||||||
InfoBar(),
|
InfoBar(),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Divider()
|
child: Divider(),
|
||||||
),
|
),
|
||||||
IconBar(),
|
IconBar(),
|
||||||
FatDivider()
|
FatDivider(),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -235,11 +235,11 @@ class FancyGalleryItem extends StatelessWidget {
|
|||||||
InfoBar(),
|
InfoBar(),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Divider()
|
child: Divider(),
|
||||||
),
|
),
|
||||||
IconBar(),
|
IconBar(),
|
||||||
FatDivider()
|
FatDivider(),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -253,9 +253,9 @@ class InfoBar extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const MiniIconWithText(Icons.thumb_up, '42'),
|
const MiniIconWithText(Icons.thumb_up, '42'),
|
||||||
Text('3 Comments', style: Theme.of(context).textTheme.caption)
|
Text('3 Comments', style: Theme.of(context).textTheme.caption),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,8 +271,8 @@ class IconBar extends StatelessWidget {
|
|||||||
IconWithText(Icons.thumb_up, 'Like'),
|
IconWithText(Icons.thumb_up, 'Like'),
|
||||||
IconWithText(Icons.comment, 'Comment'),
|
IconWithText(Icons.comment, 'Comment'),
|
||||||
IconWithText(Icons.share, 'Share'),
|
IconWithText(Icons.share, 'Share'),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,10 +290,10 @@ class IconWithText extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(icon),
|
icon: Icon(icon),
|
||||||
onPressed: () { print('Pressed $title button'); }
|
onPressed: () { print('Pressed $title button'); },
|
||||||
),
|
),
|
||||||
Text(title)
|
Text(title),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,13 +316,13 @@ class MiniIconWithText extends StatelessWidget {
|
|||||||
height: 16.0,
|
height: 16.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
shape: BoxShape.circle
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: Icon(icon, color: Colors.white, size: 12.0)
|
child: Icon(icon, color: Colors.white, size: 12.0),
|
||||||
)
|
|
||||||
),
|
),
|
||||||
Text(title, style: Theme.of(context).textTheme.caption)
|
),
|
||||||
]
|
Text(title, style: Theme.of(context).textTheme.caption),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,8 +354,8 @@ class UserHeader extends StatelessWidget {
|
|||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage('packages/flutter_gallery_assets/people/square/ali.png'),
|
image: AssetImage('packages/flutter_gallery_assets/people/square/ali.png'),
|
||||||
width: 32.0,
|
width: 32.0,
|
||||||
height: 32.0
|
height: 32.0,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -367,21 +367,21 @@ class UserHeader extends StatelessWidget {
|
|||||||
children: <TextSpan>[
|
children: <TextSpan>[
|
||||||
TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)),
|
TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||||
const TextSpan(text: ' shared a new '),
|
const TextSpan(text: ' shared a new '),
|
||||||
const TextSpan(text: 'photo', style: TextStyle(fontWeight: FontWeight.bold))
|
const TextSpan(text: 'photo', style: TextStyle(fontWeight: FontWeight.bold)),
|
||||||
]
|
],
|
||||||
)),
|
)),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text('Yesterday at 11:55 • ', style: Theme.of(context).textTheme.caption),
|
Text('Yesterday at 11:55 • ', style: Theme.of(context).textTheme.caption),
|
||||||
Icon(Icons.people, size: 16.0, color: Theme.of(context).textTheme.caption.color)
|
Icon(Icons.people, size: 16.0, color: Theme.of(context).textTheme.caption.color),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
|
),
|
||||||
|
TopBarMenu(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
TopBarMenu()
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -391,7 +391,7 @@ class ItemDescription extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.all(8.0),
|
padding: EdgeInsets.all(8.0),
|
||||||
child: Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
|
child: Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -411,7 +411,7 @@ class ItemImageBox extends StatelessWidget {
|
|||||||
height: 230.0,
|
height: 230.0,
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage('packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png')
|
image: AssetImage('packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png')
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Theme(
|
Theme(
|
||||||
data: ThemeData.dark(),
|
data: ThemeData.dark(),
|
||||||
@ -420,14 +420,14 @@ class ItemImageBox extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.edit),
|
icon: const Icon(Icons.edit),
|
||||||
onPressed: () { print('Pressed edit button'); }
|
onPressed: () { print('Pressed edit button'); },
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.zoom_in),
|
icon: const Icon(Icons.zoom_in),
|
||||||
onPressed: () { print('Pressed zoom button'); }
|
onPressed: () { print('Pressed zoom button'); },
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 4.0,
|
bottom: 4.0,
|
||||||
@ -435,7 +435,7 @@ class ItemImageBox extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
borderRadius: BorderRadius.circular(2.0)
|
borderRadius: BorderRadius.circular(2.0),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
child: const RichText(
|
child: const RichText(
|
||||||
@ -447,14 +447,14 @@ class ItemImageBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
text: 'Chris Godley'
|
text: 'Chris Godley',
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
)
|
||||||
,
|
,
|
||||||
Padding(
|
Padding(
|
||||||
@ -464,13 +464,13 @@ class ItemImageBox extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text('Artisans of Southern India', style: Theme.of(context).textTheme.body2),
|
Text('Artisans of Southern India', style: Theme.of(context).textTheme.body2),
|
||||||
Text('Silk Spinners', style: Theme.of(context).textTheme.body1),
|
Text('Silk Spinners', style: Theme.of(context).textTheme.body1),
|
||||||
Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption)
|
Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -483,7 +483,7 @@ class ItemGalleryBox extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final List<String> tabNames = <String>[
|
final List<String> tabNames = <String>[
|
||||||
'A', 'B', 'C', 'D'
|
'A', 'B', 'C', 'D',
|
||||||
];
|
];
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
@ -507,8 +507,8 @@ class ItemGalleryBox extends StatelessWidget {
|
|||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(tabName, style: Theme.of(context).textTheme.headline.copyWith(color: Colors.white)),
|
child: Text(tabName, style: Theme.of(context).textTheme.headline.copyWith(color: Colors.white)),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -524,24 +524,24 @@ class ItemGalleryBox extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
child: Text('This is item $tabName'),
|
child: Text('This is item $tabName'),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList(),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: const TabPageSelector()
|
child: const TabPageSelector(),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -554,9 +554,9 @@ class BottomBar extends StatelessWidget {
|
|||||||
border: Border(
|
border: Border(
|
||||||
top: BorderSide(
|
top: BorderSide(
|
||||||
color: Theme.of(context).dividerColor,
|
color: Theme.of(context).dividerColor,
|
||||||
width: 1.0
|
width: 1.0,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@ -586,11 +586,11 @@ class BottomBarButton extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(icon),
|
icon: Icon(icon),
|
||||||
onPressed: () { print('Pressed: $title'); }
|
onPressed: () { print('Pressed: $title'); },
|
||||||
|
),
|
||||||
|
Text(title, style: Theme.of(context).textTheme.caption),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Text(title, style: Theme.of(context).textTheme.caption)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -625,7 +625,7 @@ class GalleryDrawer extends StatelessWidget {
|
|||||||
_changeScrollMode(context, currentMode == ScrollMode.complex ? ScrollMode.tile : ScrollMode.complex);
|
_changeScrollMode(context, currentMode == ScrollMode.complex ? ScrollMode.tile : ScrollMode.complex);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
trailing: Text(currentMode == ScrollMode.complex ? 'Tile' : 'Complex')
|
trailing: Text(currentMode == ScrollMode.complex ? 'Tile' : 'Complex'),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.brightness_5),
|
leading: const Icon(Icons.brightness_5),
|
||||||
@ -635,7 +635,7 @@ class GalleryDrawer extends StatelessWidget {
|
|||||||
trailing: Radio<bool>(
|
trailing: Radio<bool>(
|
||||||
value: true,
|
value: true,
|
||||||
groupValue: ComplexLayoutApp.of(context).lightTheme,
|
groupValue: ComplexLayoutApp.of(context).lightTheme,
|
||||||
onChanged: (bool value) { _changeTheme(context, value); }
|
onChanged: (bool value) { _changeTheme(context, value); },
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@ -657,7 +657,7 @@ class GalleryDrawer extends StatelessWidget {
|
|||||||
onTap: () { ComplexLayoutApp.of(context).toggleAnimationSpeed(); },
|
onTap: () { ComplexLayoutApp.of(context).toggleAnimationSpeed(); },
|
||||||
trailing: Checkbox(
|
trailing: Checkbox(
|
||||||
value: timeDilation != 1.0,
|
value: timeDilation != 1.0,
|
||||||
onChanged: (bool value) { ComplexLayoutApp.of(context).toggleAnimationSpeed(); }
|
onChanged: (bool value) { ComplexLayoutApp.of(context).toggleAnimationSpeed(); },
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -47,7 +47,7 @@ class HomePage extends StatelessWidget {
|
|||||||
onPressed: (){
|
onPressed: (){
|
||||||
Navigator.pushNamed(context, kCubicBezierRouteName);
|
Navigator.pushNamed(context, kCubicBezierRouteName);
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -263,7 +263,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
|||||||
PathDetail(bezier2Path, translate: <double>[29.45, 151.0], rotation: -1.5708),
|
PathDetail(bezier2Path, translate: <double>[29.45, 151.0], rotation: -1.5708),
|
||||||
PathDetail(bezier3Path,
|
PathDetail(bezier3Path,
|
||||||
translate: <double>[53.0, 200.48], rotation: -3.14159),
|
translate: <double>[53.0, 200.48], rotation: -3.14159),
|
||||||
PathDetail(bezier4Path, translate: <double>[122.48, 77.0], rotation: -4.71239)
|
PathDetail(bezier4Path, translate: <double>[122.48, 77.0], rotation: -4.71239),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,6 @@ void main() {
|
|||||||
'cull_opacity_perf',
|
'cull_opacity_perf',
|
||||||
kCullOpacityRouteName,
|
kCullOpacityRouteName,
|
||||||
pageDelay: const Duration(seconds: 1),
|
pageDelay: const Duration(seconds: 1),
|
||||||
duration: const Duration(seconds: 10)
|
duration: const Duration(seconds: 10),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -236,7 +236,7 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _runFlutterAnalyze(String workingDirectory, {
|
Future<void> _runFlutterAnalyze(String workingDirectory, {
|
||||||
List<String> options = const <String>[]
|
List<String> options = const <String>[],
|
||||||
}) {
|
}) {
|
||||||
return runCommand(flutter, <String>['analyze', '--dartdocs']..addAll(options),
|
return runCommand(flutter, <String>['analyze', '--dartdocs']..addAll(options),
|
||||||
workingDirectory: workingDirectory,
|
workingDirectory: workingDirectory,
|
||||||
|
@ -58,7 +58,7 @@ Future<void> runCommand(String executable, List<String> arguments, {
|
|||||||
if (printOutput) {
|
if (printOutput) {
|
||||||
await Future.wait<void>(<Future<void>>[
|
await Future.wait<void>(<Future<void>>[
|
||||||
stdout.addStream(process.stdout),
|
stdout.addStream(process.stdout),
|
||||||
stderr.addStream(process.stderr)
|
stderr.addStream(process.stderr),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
savedStdout = process.stdout.toList();
|
savedStdout = process.stdout.toList();
|
||||||
|
@ -309,7 +309,7 @@ Future<void> _runCoverage() async {
|
|||||||
Future<void> _pubRunTest(
|
Future<void> _pubRunTest(
|
||||||
String workingDirectory, {
|
String workingDirectory, {
|
||||||
String testPath,
|
String testPath,
|
||||||
bool enableFlutterToolAsserts = false
|
bool enableFlutterToolAsserts = false,
|
||||||
}) {
|
}) {
|
||||||
final List<String> args = <String>['run', 'test', '-rcompact', '-j1'];
|
final List<String> args = <String>['run', 'test', '-rcompact', '-j1'];
|
||||||
if (!hasColor)
|
if (!hasColor)
|
||||||
|
@ -103,7 +103,7 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
|||||||
when(runSync(
|
when(runSync(
|
||||||
any,
|
any,
|
||||||
environment: anyNamed('environment'),
|
environment: anyNamed('environment'),
|
||||||
workingDirectory: anyNamed('workingDirectory')
|
workingDirectory: anyNamed('workingDirectory'),
|
||||||
)).thenAnswer(_nextResultSync);
|
)).thenAnswer(_nextResultSync);
|
||||||
|
|
||||||
when(runSync(any)).thenAnswer(_nextResultSync);
|
when(runSync(any)).thenAnswer(_nextResultSync);
|
||||||
|
@ -27,10 +27,10 @@ void main() {
|
|||||||
test('start works', () async {
|
test('start works', () async {
|
||||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||||
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output1', '')
|
ProcessResult(0, 0, 'output1', ''),
|
||||||
],
|
],
|
||||||
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output2', '')
|
ProcessResult(0, 0, 'output2', ''),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
processManager.fakeResults = calls;
|
processManager.fakeResults = calls;
|
||||||
@ -49,10 +49,10 @@ void main() {
|
|||||||
test('run works', () async {
|
test('run works', () async {
|
||||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||||
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output1', '')
|
ProcessResult(0, 0, 'output1', ''),
|
||||||
],
|
],
|
||||||
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output2', '')
|
ProcessResult(0, 0, 'output2', ''),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
processManager.fakeResults = calls;
|
processManager.fakeResults = calls;
|
||||||
@ -66,10 +66,10 @@ void main() {
|
|||||||
test('runSync works', () async {
|
test('runSync works', () async {
|
||||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||||
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output1', '')
|
ProcessResult(0, 0, 'output1', ''),
|
||||||
],
|
],
|
||||||
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output2', '')
|
ProcessResult(0, 0, 'output2', ''),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
processManager.fakeResults = calls;
|
processManager.fakeResults = calls;
|
||||||
@ -83,10 +83,10 @@ void main() {
|
|||||||
test('captures stdin', () async {
|
test('captures stdin', () async {
|
||||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||||
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output1', '')
|
ProcessResult(0, 0, 'output1', ''),
|
||||||
],
|
],
|
||||||
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
|
||||||
ProcessResult(0, 0, 'output2', '')
|
ProcessResult(0, 0, 'output2', ''),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
processManager.fakeResults = calls;
|
processManager.fakeResults = calls;
|
||||||
|
@ -41,7 +41,7 @@ Future<TaskResult> createFlutterRunTask() async {
|
|||||||
startProcess(
|
startProcess(
|
||||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||||
<String>['run']..addAll(options),
|
<String>['run']..addAll(options),
|
||||||
environment: null
|
environment: null,
|
||||||
);
|
);
|
||||||
final Completer<void> finished = Completer<void>();
|
final Completer<void> finished = Completer<void>();
|
||||||
final StreamSubscription<void> subscription = device.logcat.listen((String line) {
|
final StreamSubscription<void> subscription = device.logcat.listen((String line) {
|
||||||
|
@ -276,7 +276,7 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task,
|
|||||||
'./gradlew',
|
'./gradlew',
|
||||||
args,
|
args,
|
||||||
workingDirectory: workingDirectory,
|
workingDirectory: workingDirectory,
|
||||||
environment: <String, String>{ 'JAVA_HOME': javaHome }
|
environment: <String, String>{ 'JAVA_HOME': javaHome },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ Future<void> main() async {
|
|||||||
'--org',
|
'--org',
|
||||||
'io.flutter.devicelab',
|
'io.flutter.devicelab',
|
||||||
'--template=module',
|
'--template=module',
|
||||||
'hello'
|
'hello',
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -100,7 +100,7 @@ void main() {
|
|||||||
final Map<String, dynamic> req = <String, dynamic>{
|
final Map<String, dynamic> req = <String, dynamic>{
|
||||||
'id': requestId,
|
'id': requestId,
|
||||||
'method': method,
|
'method': method,
|
||||||
'params': params
|
'params': params,
|
||||||
};
|
};
|
||||||
final String jsonEncoded = json.encode(<Map<String, dynamic>>[req]);
|
final String jsonEncoded = json.encode(<Map<String, dynamic>>[req]);
|
||||||
print('run:stdin: $jsonEncoded');
|
print('run:stdin: $jsonEncoded');
|
||||||
|
@ -40,7 +40,7 @@ Future<void> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
|||||||
final List<File> xcconfigFiles = <File>[
|
final List<File> xcconfigFiles = <File>[
|
||||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')),
|
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')),
|
||||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Debug.xcconfig')),
|
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Debug.xcconfig')),
|
||||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Release.xcconfig'))
|
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Release.xcconfig')),
|
||||||
];
|
];
|
||||||
|
|
||||||
bool xcconfigFileExists = false;
|
bool xcconfigFileExists = false;
|
||||||
|
@ -23,7 +23,7 @@ TaskFunction createHotModeTest() {
|
|||||||
final File benchmarkFile = file(path.join(_editedFlutterGalleryDir.path, 'hot_benchmark.json'));
|
final File benchmarkFile = file(path.join(_editedFlutterGalleryDir.path, 'hot_benchmark.json'));
|
||||||
rm(benchmarkFile);
|
rm(benchmarkFile);
|
||||||
final List<String> options = <String>[
|
final List<String> options = <String>[
|
||||||
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident'
|
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident',
|
||||||
];
|
];
|
||||||
setLocalEngineOptionIfNecessary(options);
|
setLocalEngineOptionIfNecessary(options);
|
||||||
int hotReloadCount = 0;
|
int hotReloadCount = 0;
|
||||||
@ -40,7 +40,7 @@ TaskFunction createHotModeTest() {
|
|||||||
final Process process = await startProcess(
|
final Process process = await startProcess(
|
||||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||||
<String>['run']..addAll(options),
|
<String>['run']..addAll(options),
|
||||||
environment: null
|
environment: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
final Completer<void> stdoutDone = Completer<void>();
|
final Completer<void> stdoutDone = Completer<void>();
|
||||||
@ -53,11 +53,11 @@ TaskFunction createHotModeTest() {
|
|||||||
if (hotReloadCount == 0) {
|
if (hotReloadCount == 0) {
|
||||||
// Update the file and reload again.
|
// Update the file and reload again.
|
||||||
final File appDartSource = file(path.join(
|
final File appDartSource = file(path.join(
|
||||||
_editedFlutterGalleryDir.path, 'lib/gallery/app.dart'
|
_editedFlutterGalleryDir.path, 'lib/gallery/app.dart',
|
||||||
));
|
));
|
||||||
appDartSource.writeAsStringSync(
|
appDartSource.writeAsStringSync(
|
||||||
appDartSource.readAsStringSync().replaceFirst(
|
appDartSource.readAsStringSync().replaceFirst(
|
||||||
"'Flutter Gallery'", "'Updated Flutter Gallery'"
|
"'Flutter Gallery'", "'Updated Flutter Gallery'",
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
process.stdin.writeln('r');
|
process.stdin.writeln('r');
|
||||||
@ -94,7 +94,7 @@ TaskFunction createHotModeTest() {
|
|||||||
final Process process = await startProcess(
|
final Process process = await startProcess(
|
||||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||||
<String>['run']..addAll(options),
|
<String>['run']..addAll(options),
|
||||||
environment: null
|
environment: null,
|
||||||
);
|
);
|
||||||
final Completer<void> stdoutDone = Completer<void>();
|
final Completer<void> stdoutDone = Completer<void>();
|
||||||
final Completer<void> stderrDone = Completer<void>();
|
final Completer<void> stderrDone = Completer<void>();
|
||||||
@ -156,7 +156,7 @@ TaskFunction createHotModeTest() {
|
|||||||
'hotReloadFlutterReassembleMillisecondsAfterChange',
|
'hotReloadFlutterReassembleMillisecondsAfterChange',
|
||||||
'hotReloadVMReloadMillisecondsAfterChange',
|
'hotReloadVMReloadMillisecondsAfterChange',
|
||||||
'hotReloadInitialDevFSSyncAfterRelaunchMilliseconds',
|
'hotReloadInitialDevFSSyncAfterRelaunchMilliseconds',
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ TaskFunction createFlavorsTest() {
|
|||||||
return DriverTest(
|
return DriverTest(
|
||||||
'${flutterDirectory.path}/dev/integration_tests/flavors',
|
'${flutterDirectory.path}/dev/integration_tests/flavors',
|
||||||
'lib/main.dart',
|
'lib/main.dart',
|
||||||
extraOptions: <String>['--flavor', 'paid']
|
extraOptions: <String>['--flavor', 'paid'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ TaskFunction createCodegenerationIntegrationTest() {
|
|||||||
'${flutterDirectory.path}/dev/integration_tests/codegen',
|
'${flutterDirectory.path}/dev/integration_tests/codegen',
|
||||||
'lib/main.dart',
|
'lib/main.dart',
|
||||||
environment: <String, String>{
|
environment: <String, String>{
|
||||||
'FLUTTER_EXPERIMENTAL_BUILD': 'true'
|
'FLUTTER_EXPERIMENTAL_BUILD': 'true',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class FlutterProject {
|
|||||||
await inDirectory(directory, () async {
|
await inDirectory(directory, () async {
|
||||||
await flutter(
|
await flutter(
|
||||||
'create',
|
'create',
|
||||||
options: <String>['--template=app', '--org', 'io.flutter.devicelab']..addAll(options)..add('plugintest')
|
options: <String>['--template=app', '--org', 'io.flutter.devicelab']..addAll(options)..add('plugintest'),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
return FlutterProject(directory, 'plugintest');
|
return FlutterProject(directory, 'plugintest');
|
||||||
|
@ -80,7 +80,7 @@ tasks:
|
|||||||
tasks:
|
tasks:
|
||||||
- a
|
- a
|
||||||
- b
|
- b
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -89,7 +89,7 @@ tasks:
|
|||||||
'''
|
'''
|
||||||
tasks:
|
tasks:
|
||||||
1: 2
|
1: 2
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -98,7 +98,7 @@ tasks:
|
|||||||
'''
|
'''
|
||||||
tasks:
|
tasks:
|
||||||
foo: 2
|
foo: 2
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -108,7 +108,7 @@ tasks:
|
|||||||
tasks:
|
tasks:
|
||||||
foo:
|
foo:
|
||||||
bar: 2
|
bar: 2
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -118,7 +118,7 @@ tasks:
|
|||||||
tasks:
|
tasks:
|
||||||
foo:
|
foo:
|
||||||
required_agent_capabilities: 1
|
required_agent_capabilities: 1
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -128,7 +128,7 @@ tasks:
|
|||||||
tasks:
|
tasks:
|
||||||
foo:
|
foo:
|
||||||
required_agent_capabilities: [1]
|
required_agent_capabilities: [1]
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -138,7 +138,7 @@ tasks:
|
|||||||
tasks:
|
tasks:
|
||||||
foo:
|
foo:
|
||||||
required_agent_capabilities: ["a"]
|
required_agent_capabilities: ["a"]
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -149,7 +149,7 @@ tasks:
|
|||||||
foo:
|
foo:
|
||||||
description: b
|
description: b
|
||||||
required_agent_capabilities: ["a"]
|
required_agent_capabilities: ["a"]
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -161,7 +161,7 @@ tasks:
|
|||||||
description: b
|
description: b
|
||||||
stage: c
|
stage: c
|
||||||
required_agent_capabilities: []
|
required_agent_capabilities: []
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
testManifestError(
|
testManifestError(
|
||||||
@ -174,7 +174,7 @@ tasks:
|
|||||||
stage: c
|
stage: c
|
||||||
required_agent_capabilities: ["a"]
|
required_agent_capabilities: ["a"]
|
||||||
flaky: not-a-boolean
|
flaky: not-a-boolean
|
||||||
'''
|
''',
|
||||||
);
|
);
|
||||||
|
|
||||||
test('accepts boolean flaky option', () {
|
test('accepts boolean flaky option', () {
|
||||||
|
@ -109,9 +109,9 @@ class PlatformViewState extends State<PlatformViewPage> {
|
|||||||
key: const ValueKey<String>('play'),
|
key: const ValueKey<String>('play'),
|
||||||
child: const Text('PLAY FILE'),
|
child: const Text('PLAY FILE'),
|
||||||
onPressed: () { playEventsFile(); },
|
onPressed: () { playEventsFile(); },
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ const List<int> kPointerActions = <int>[
|
|||||||
0, // DOWN
|
0, // DOWN
|
||||||
1, // UP
|
1, // UP
|
||||||
5, // POINTER_DOWN
|
5, // POINTER_DOWN
|
||||||
6 // POINTER_UP
|
6, // POINTER_UP
|
||||||
];
|
];
|
||||||
|
|
||||||
const double kDoubleErrorMargin = 0.0001;
|
const double kDoubleErrorMargin = 0.0001;
|
||||||
@ -152,7 +152,7 @@ String getActionName(int actionMasked, int action) {
|
|||||||
'HOVER_ENTER',
|
'HOVER_ENTER',
|
||||||
'HOVER_EXIT',
|
'HOVER_EXIT',
|
||||||
'BUTTON_PRESS',
|
'BUTTON_PRESS',
|
||||||
'BUTTON_RELEASE'
|
'BUTTON_RELEASE',
|
||||||
];
|
];
|
||||||
if (actionMasked < actionNames.length)
|
if (actionMasked < actionNames.length)
|
||||||
return '${actionNames[actionMasked]}($action)';
|
return '${actionNames[actionMasked]}($action)';
|
||||||
|
@ -31,7 +31,7 @@ class _TestAppState extends State<TestApp> {
|
|||||||
0.0,
|
0.0,
|
||||||
'hello',
|
'hello',
|
||||||
<dynamic>[
|
<dynamic>[
|
||||||
<String, dynamic>{'key': 42}
|
<String, dynamic>{'key': 42},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
static final Map<String, dynamic> aMap = <String, dynamic>{
|
static final Map<String, dynamic> aMap = <String, dynamic>{
|
||||||
@ -40,7 +40,7 @@ class _TestAppState extends State<TestApp> {
|
|||||||
'c': 0.0,
|
'c': 0.0,
|
||||||
'd': 'hello',
|
'd': 'hello',
|
||||||
'e': <dynamic>[
|
'e': <dynamic>[
|
||||||
<String, dynamic>{'key': 42}
|
<String, dynamic>{'key': 42},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
static final Uint8List someUint8s = Uint8List.fromList(<int>[
|
static final Uint8List someUint8s = Uint8List.fromList(<int>[
|
||||||
|
@ -56,14 +56,14 @@ class CardCollectionState extends State<CardCollection> {
|
|||||||
(int i) {
|
(int i) {
|
||||||
_cardModels[i].height = _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i];
|
_cardModels[i].height = _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i];
|
||||||
return _cardModels[i];
|
return _cardModels[i];
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initVariableSizedCardModels() {
|
void _initVariableSizedCardModels() {
|
||||||
_cardModels = List<CardModel>.generate(
|
_cardModels = List<CardModel>.generate(
|
||||||
_cardHeights.length,
|
_cardHeights.length,
|
||||||
(int i) => CardModel(i, _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i])
|
(int i) => CardModel(i, _editable ? max(_cardHeights[i], 60.0) : _cardHeights[i]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ class CardCollectionState extends State<CardCollection> {
|
|||||||
Widget _buildAppBar(BuildContext context) {
|
Widget _buildAppBar(BuildContext context) {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
Text(_dismissDirectionText(_dismissDirection))
|
Text(_dismissDirectionText(_dismissDirection)),
|
||||||
],
|
],
|
||||||
flexibleSpace: Container(
|
flexibleSpace: Container(
|
||||||
padding: const EdgeInsets.only(left: 72.0),
|
padding: const EdgeInsets.only(left: 72.0),
|
||||||
|
@ -32,11 +32,11 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
|
|||||||
color: data.isEmpty ? _color : Colors.grey.shade200,
|
color: data.isEmpty ? _color : Colors.grey.shade200,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 3.0,
|
width: 3.0,
|
||||||
color: data.isEmpty ? Colors.white : Colors.blue
|
color: data.isEmpty ? Colors.white : Colors.blue,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,10 +65,10 @@ class DotState extends State<Dot> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: widget.color,
|
color: widget.color,
|
||||||
border: Border.all(width: taps.toDouble()),
|
border: Border.all(width: taps.toDouble()),
|
||||||
shape: BoxShape.circle
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: widget.child,
|
||||||
),
|
),
|
||||||
child: widget.child
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ class ExampleDragSource extends StatelessWidget {
|
|||||||
this.color,
|
this.color,
|
||||||
this.heavy = false,
|
this.heavy = false,
|
||||||
this.under = true,
|
this.under = true,
|
||||||
this.child
|
this.child,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final Color color;
|
final Color color;
|
||||||
@ -103,13 +103,13 @@ class ExampleDragSource extends StatelessWidget {
|
|||||||
child: Dot(
|
child: Dot(
|
||||||
color: color,
|
color: color,
|
||||||
size: size,
|
size: size,
|
||||||
child: Center(child: child)
|
child: Center(child: child),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget feedback = Opacity(
|
Widget feedback = Opacity(
|
||||||
opacity: 0.75,
|
opacity: 0.75,
|
||||||
child: contents
|
child: contents,
|
||||||
);
|
);
|
||||||
|
|
||||||
Offset feedbackOffset;
|
Offset feedbackOffset;
|
||||||
@ -118,7 +118,7 @@ class ExampleDragSource extends StatelessWidget {
|
|||||||
feedback = Transform(
|
feedback = Transform(
|
||||||
transform: Matrix4.identity()
|
transform: Matrix4.identity()
|
||||||
..translate(-size / 2.0, -(size / 2.0 + kFingerSize)),
|
..translate(-size / 2.0, -(size / 2.0 + kFingerSize)),
|
||||||
child: feedback
|
child: feedback,
|
||||||
);
|
);
|
||||||
feedbackOffset = const Offset(0.0, -kFingerSize);
|
feedbackOffset = const Offset(0.0, -kFingerSize);
|
||||||
anchor = DragAnchor.pointer;
|
anchor = DragAnchor.pointer;
|
||||||
@ -133,7 +133,7 @@ class ExampleDragSource extends StatelessWidget {
|
|||||||
child: contents,
|
child: contents,
|
||||||
feedback: feedback,
|
feedback: feedback,
|
||||||
feedbackOffset: feedbackOffset,
|
feedbackOffset: feedbackOffset,
|
||||||
dragAnchor: anchor
|
dragAnchor: anchor,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Draggable<Color>(
|
return Draggable<Color>(
|
||||||
@ -141,7 +141,7 @@ class ExampleDragSource extends StatelessWidget {
|
|||||||
child: contents,
|
child: contents,
|
||||||
feedback: feedback,
|
feedback: feedback,
|
||||||
feedbackOffset: feedbackOffset,
|
feedbackOffset: feedbackOffset,
|
||||||
dragAnchor: anchor
|
dragAnchor: anchor,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,15 +193,15 @@ class MovableBall extends StatelessWidget {
|
|||||||
color: Colors.blue.shade700,
|
color: Colors.blue.shade700,
|
||||||
size: kBallSize,
|
size: kBallSize,
|
||||||
tappable: true,
|
tappable: true,
|
||||||
child: const Center(child: Text('BALL'))
|
child: const Center(child: Text('BALL')),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
final Widget dashedBall = Container(
|
final Widget dashedBall = Container(
|
||||||
width: kBallSize,
|
width: kBallSize,
|
||||||
height: kBallSize,
|
height: kBallSize,
|
||||||
child: const CustomPaint(
|
child: const CustomPaint(
|
||||||
painter: DashOutlineCirclePainter()
|
painter: DashOutlineCirclePainter()
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
if (position == ballPosition) {
|
if (position == ballPosition) {
|
||||||
return Draggable<bool>(
|
return Draggable<bool>(
|
||||||
@ -209,14 +209,14 @@ class MovableBall extends StatelessWidget {
|
|||||||
child: ball,
|
child: ball,
|
||||||
childWhenDragging: dashedBall,
|
childWhenDragging: dashedBall,
|
||||||
feedback: ball,
|
feedback: ball,
|
||||||
maxSimultaneousDrags: 1
|
maxSimultaneousDrags: 1,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return DragTarget<bool>(
|
return DragTarget<bool>(
|
||||||
onAccept: (bool data) { callback(position); },
|
onAccept: (bool data) { callback(position); },
|
||||||
builder: (BuildContext context, List<bool> accepted, List<dynamic> rejected) {
|
builder: (BuildContext context, List<bool> accepted, List<dynamic> rejected) {
|
||||||
return dashedBall;
|
return dashedBall;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Drag and Drop Flutter Demo')
|
title: const Text('Drag and Drop Flutter Demo'),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -251,22 +251,22 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
|||||||
color: Colors.yellow.shade300,
|
color: Colors.yellow.shade300,
|
||||||
under: true,
|
under: true,
|
||||||
heavy: false,
|
heavy: false,
|
||||||
child: const Text('under')
|
child: const Text('under'),
|
||||||
),
|
),
|
||||||
ExampleDragSource(
|
ExampleDragSource(
|
||||||
color: Colors.green.shade300,
|
color: Colors.green.shade300,
|
||||||
under: false,
|
under: false,
|
||||||
heavy: true,
|
heavy: true,
|
||||||
child: const Text('long-press above')
|
child: const Text('long-press above'),
|
||||||
),
|
),
|
||||||
ExampleDragSource(
|
ExampleDragSource(
|
||||||
color: Colors.indigo.shade300,
|
color: Colors.indigo.shade300,
|
||||||
under: false,
|
under: false,
|
||||||
heavy: false,
|
heavy: false,
|
||||||
child: const Text('above')
|
child: const Text('above'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -275,8 +275,8 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
|||||||
Expanded(child: ExampleDragTarget()),
|
Expanded(child: ExampleDragTarget()),
|
||||||
Expanded(child: ExampleDragTarget()),
|
Expanded(child: ExampleDragTarget()),
|
||||||
Expanded(child: ExampleDragTarget()),
|
Expanded(child: ExampleDragTarget()),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -286,10 +286,10 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
|||||||
MovableBall(2, position, moveBall),
|
MovableBall(2, position, moveBall),
|
||||||
MovableBall(3, position, moveBall),
|
MovableBall(3, position, moveBall),
|
||||||
],
|
],
|
||||||
)
|
|
||||||
),
|
),
|
||||||
]
|
),
|
||||||
)
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,6 +297,6 @@ class DragAndDropAppState extends State<DragAndDropApp> {
|
|||||||
void main() {
|
void main() {
|
||||||
runApp(MaterialApp(
|
runApp(MaterialApp(
|
||||||
title: 'Drag and Drop Flutter Demo',
|
title: 'Drag and Drop Flutter Demo',
|
||||||
home: DragAndDropApp()
|
home: DragAndDropApp(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class _IgnoreDrag extends Drag {
|
|||||||
class _PointDemoPainter extends CustomPainter {
|
class _PointDemoPainter extends CustomPainter {
|
||||||
_PointDemoPainter({
|
_PointDemoPainter({
|
||||||
Animation<double> repaint,
|
Animation<double> repaint,
|
||||||
this.arc
|
this.arc,
|
||||||
}) : _repaint = repaint, super(repaint: repaint);
|
}) : _repaint = repaint, super(repaint: repaint);
|
||||||
|
|
||||||
final MaterialPointArcTween arc;
|
final MaterialPointArcTween arc;
|
||||||
@ -202,7 +202,7 @@ class _PointDemoState extends State<_PointDemo> {
|
|||||||
key: _painterKey,
|
key: _painterKey,
|
||||||
foregroundPainter: _PointDemoPainter(
|
foregroundPainter: _PointDemoPainter(
|
||||||
repaint: _animation,
|
repaint: _animation,
|
||||||
arc: arc
|
arc: arc,
|
||||||
),
|
),
|
||||||
// Watch out: if this IgnorePointer is left out, then gestures that
|
// Watch out: if this IgnorePointer is left out, then gestures that
|
||||||
// fail _PointDemoPainter.hitTest() will still be recognized because
|
// fail _PointDemoPainter.hitTest() will still be recognized because
|
||||||
@ -213,12 +213,12 @@ class _PointDemoState extends State<_PointDemo> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Tap the refresh button to run the animation. Drag the green '
|
'Tap the refresh button to run the animation. Drag the green '
|
||||||
"and red points to change the animation's path.",
|
"and red points to change the animation's path.",
|
||||||
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0)
|
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ class _PointDemoState extends State<_PointDemo> {
|
|||||||
class _RectangleDemoPainter extends CustomPainter {
|
class _RectangleDemoPainter extends CustomPainter {
|
||||||
_RectangleDemoPainter({
|
_RectangleDemoPainter({
|
||||||
Animation<double> repaint,
|
Animation<double> repaint,
|
||||||
this.arc
|
this.arc,
|
||||||
}) : _repaint = repaint, super(repaint: repaint);
|
}) : _repaint = repaint, super(repaint: repaint);
|
||||||
|
|
||||||
final MaterialRectArcTween arc;
|
final MaterialRectArcTween arc;
|
||||||
@ -350,11 +350,11 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
|||||||
_screenSize = screenSize;
|
_screenSize = screenSize;
|
||||||
_begin = Rect.fromLTWH(
|
_begin = Rect.fromLTWH(
|
||||||
screenSize.width * 0.5, screenSize.height * 0.2,
|
screenSize.width * 0.5, screenSize.height * 0.2,
|
||||||
screenSize.width * 0.4, screenSize.height * 0.2
|
screenSize.width * 0.4, screenSize.height * 0.2,
|
||||||
);
|
);
|
||||||
_end = Rect.fromLTWH(
|
_end = Rect.fromLTWH(
|
||||||
screenSize.width * 0.1, screenSize.height * 0.4,
|
screenSize.width * 0.1, screenSize.height * 0.4,
|
||||||
screenSize.width * 0.3, screenSize.height * 0.3
|
screenSize.width * 0.3, screenSize.height * 0.3,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
|||||||
key: _painterKey,
|
key: _painterKey,
|
||||||
foregroundPainter: _RectangleDemoPainter(
|
foregroundPainter: _RectangleDemoPainter(
|
||||||
repaint: _animation,
|
repaint: _animation,
|
||||||
arc: arc
|
arc: arc,
|
||||||
),
|
),
|
||||||
// Watch out: if this IgnorePointer is left out, then gestures that
|
// Watch out: if this IgnorePointer is left out, then gestures that
|
||||||
// fail _RectDemoPainter.hitTest() will still be recognized because
|
// fail _RectDemoPainter.hitTest() will still be recognized because
|
||||||
@ -386,12 +386,12 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Tap the refresh button to run the animation. Drag the rectangles '
|
'Tap the refresh button to run the animation. Drag the rectangles '
|
||||||
"to change the animation's path.",
|
"to change the animation's path.",
|
||||||
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0)
|
style: Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -426,13 +426,13 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
|
|||||||
_ArcDemo('POINT', (_ArcDemo demo) {
|
_ArcDemo('POINT', (_ArcDemo demo) {
|
||||||
return _PointDemo(
|
return _PointDemo(
|
||||||
key: demo.key,
|
key: demo.key,
|
||||||
controller: demo.controller
|
controller: demo.controller,
|
||||||
);
|
);
|
||||||
}, this),
|
}, this),
|
||||||
_ArcDemo('RECTANGLE', (_ArcDemo demo) {
|
_ArcDemo('RECTANGLE', (_ArcDemo demo) {
|
||||||
return _RectangleDemo(
|
return _RectangleDemo(
|
||||||
key: demo.key,
|
key: demo.key,
|
||||||
controller: demo.controller
|
controller: demo.controller,
|
||||||
);
|
);
|
||||||
}, this),
|
}, this),
|
||||||
];
|
];
|
||||||
@ -466,9 +466,9 @@ class _AnimationDemoState extends State<AnimationDemo> with TickerProviderStateM
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: TabBarView(
|
body: TabBarView(
|
||||||
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList()
|
children: _allDemos.map<Widget>((_ArcDemo demo) => demo.builder(demo)).toList(),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,7 +515,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
|||||||
debugPrint(_textSpan.toStringDeep());
|
debugPrint(_textSpan.toStringDeep());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -573,7 +573,7 @@ class _UnderlinesState extends State<Underlines> {
|
|||||||
),
|
),
|
||||||
child: ListBody(
|
child: ListBody(
|
||||||
children: lines,
|
children: lines,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -668,7 +668,7 @@ class _FallbackState extends State<Fallback> {
|
|||||||
child: ListBody(
|
child: ListBody(
|
||||||
children: lines,
|
children: lines,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -39,7 +39,7 @@ void main(List<String> argList) {
|
|||||||
'application template.',
|
'application template.',
|
||||||
getEnumName(SnippetType.sample):
|
getEnumName(SnippetType.sample):
|
||||||
'Produce a nicely formatted piece of sample code. Does not embed the '
|
'Produce a nicely formatted piece of sample code. Does not embed the '
|
||||||
'sample into an application template.'
|
'sample into an application template.',
|
||||||
},
|
},
|
||||||
help: 'The type of snippet to produce.',
|
help: 'The type of snippet to produce.',
|
||||||
);
|
);
|
||||||
|
@ -222,7 +222,7 @@ List<SvgPath> _interpretSvgGroup(List<XmlNode> children, _Transform transform) {
|
|||||||
|
|
||||||
final _Transform subtreeTransform = _Transform(
|
final _Transform subtreeTransform = _Transform(
|
||||||
transformMatrix: transformMatrix,
|
transformMatrix: transformMatrix,
|
||||||
opacity: opacity
|
opacity: opacity,
|
||||||
);
|
);
|
||||||
paths.addAll(_interpretSvgGroup(element.children, subtreeTransform));
|
paths.addAll(_interpretSvgGroup(element.children, subtreeTransform));
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ List<Point<double>> parsePoints(String points) {
|
|||||||
final Match m = _pointMatcher.firstMatch(unParsed);
|
final Match m = _pointMatcher.firstMatch(unParsed);
|
||||||
result.add(Point<double>(
|
result.add(Point<double>(
|
||||||
double.parse(m.group(1)),
|
double.parse(m.group(1)),
|
||||||
double.parse(m.group(2))
|
double.parse(m.group(2)),
|
||||||
));
|
));
|
||||||
unParsed = m.group(3);
|
unParsed = m.group(3);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ class CardItem extends StatelessWidget {
|
|||||||
@required this.animation,
|
@required this.animation,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
@required this.item,
|
@required this.item,
|
||||||
this.selected = false
|
this.selected = false,
|
||||||
}) : assert(animation != null),
|
}) : assert(animation != null),
|
||||||
assert(item != null && item >= 0),
|
assert(item != null && item >= 0),
|
||||||
assert(selected != null),
|
assert(selected != null),
|
||||||
|
@ -58,7 +58,7 @@ class AdjustableDropdownListTile extends StatelessWidget {
|
|||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ class AdjustableDropdownExampleState extends State<AdjustableDropdownExample> {
|
|||||||
'5 seconds',
|
'5 seconds',
|
||||||
'15 seconds',
|
'15 seconds',
|
||||||
'30 seconds',
|
'30 seconds',
|
||||||
'1 minute'
|
'1 minute',
|
||||||
];
|
];
|
||||||
String timeout;
|
String timeout;
|
||||||
|
|
||||||
|
@ -509,7 +509,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_maybeScroll(midScrollOffset, index, xOffset);
|
_maybeScroll(midScrollOffset, index, xOffset);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
|
|||||||
tooltip: 'Back',
|
tooltip: 'Back',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_handleBackButton(appBarMidScrollOffset);
|
_handleBackButton(appBarMidScrollOffset);
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -116,7 +116,7 @@ class _CalculatorState extends State<Calculator> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Theme.of(context).canvasColor,
|
backgroundColor: Theme.of(context).canvasColor,
|
||||||
elevation: 0.0
|
elevation: 0.0,
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
@ -124,15 +124,15 @@ class _CalculatorState extends State<Calculator> {
|
|||||||
// Give the key-pad 3/5 of the vertical space and the display 2/5.
|
// Give the key-pad 3/5 of the vertical space and the display 2/5.
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: CalcDisplay(content: _expression.toString())
|
child: CalcDisplay(content: _expression.toString()),
|
||||||
),
|
),
|
||||||
const Divider(height: 1.0),
|
const Divider(height: 1.0),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
child: KeyPad(calcState: this)
|
child: KeyPad(calcState: this),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,8 +147,8 @@ class CalcDisplay extends StatelessWidget {
|
|||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
content,
|
content,
|
||||||
style: const TextStyle(fontSize: 24.0)
|
style: const TextStyle(fontSize: 24.0),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,25 +180,25 @@ class KeyPad extends StatelessWidget {
|
|||||||
KeyRow(<Widget>[
|
KeyRow(<Widget>[
|
||||||
NumberKey(7, calcState),
|
NumberKey(7, calcState),
|
||||||
NumberKey(8, calcState),
|
NumberKey(8, calcState),
|
||||||
NumberKey(9, calcState)
|
NumberKey(9, calcState),
|
||||||
]),
|
]),
|
||||||
KeyRow(<Widget>[
|
KeyRow(<Widget>[
|
||||||
NumberKey(4, calcState),
|
NumberKey(4, calcState),
|
||||||
NumberKey(5, calcState),
|
NumberKey(5, calcState),
|
||||||
NumberKey(6, calcState)
|
NumberKey(6, calcState),
|
||||||
]),
|
]),
|
||||||
KeyRow(<Widget>[
|
KeyRow(<Widget>[
|
||||||
NumberKey(1, calcState),
|
NumberKey(1, calcState),
|
||||||
NumberKey(2, calcState),
|
NumberKey(2, calcState),
|
||||||
NumberKey(3, calcState)
|
NumberKey(3, calcState),
|
||||||
]),
|
]),
|
||||||
KeyRow(<Widget>[
|
KeyRow(<Widget>[
|
||||||
CalcKey('.', calcState.handlePointTap),
|
CalcKey('.', calcState.handlePointTap),
|
||||||
NumberKey(0, calcState),
|
NumberKey(0, calcState),
|
||||||
CalcKey('=', calcState.handleEqualsTap),
|
CalcKey('=', calcState.handleEqualsTap),
|
||||||
])
|
]),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Material(
|
||||||
@ -209,14 +209,14 @@ class KeyPad extends StatelessWidget {
|
|||||||
CalcKey('\u00F7', calcState.handleDivTap),
|
CalcKey('\u00F7', calcState.handleDivTap),
|
||||||
CalcKey('\u00D7', calcState.handleMultTap),
|
CalcKey('\u00D7', calcState.handleMultTap),
|
||||||
CalcKey('-', calcState.handleMinusTap),
|
CalcKey('-', calcState.handleMinusTap),
|
||||||
CalcKey('+', calcState.handlePlusTap)
|
CalcKey('+', calcState.handlePlusTap),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -231,8 +231,8 @@ class KeyRow extends StatelessWidget {
|
|||||||
return Expanded(
|
return Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: keys
|
children: keys,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -254,10 +254,10 @@ class CalcKey extends StatelessWidget {
|
|||||||
text,
|
text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: (orientation == Orientation.portrait) ? 32.0 : 24.0
|
fontSize: (orientation == Orientation.portrait) ? 32.0 : 24.0
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,9 @@ class _ContactCategory extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 24.0),
|
padding: const EdgeInsets.symmetric(vertical: 24.0),
|
||||||
width: 72.0,
|
width: 72.0,
|
||||||
child: Icon(icon, color: themeData.primaryColor)
|
child: Icon(icon, color: themeData.primaryColor),
|
||||||
),
|
),
|
||||||
Expanded(child: Column(children: children))
|
Expanded(child: Column(children: children)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -61,9 +61,9 @@ class _ContactItem extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: columnChildren
|
children: columnChildren,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
if (icon != null) {
|
if (icon != null) {
|
||||||
rowChildren.add(SizedBox(
|
rowChildren.add(SizedBox(
|
||||||
@ -71,8 +71,8 @@ class _ContactItem extends StatelessWidget {
|
|||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: Icon(icon),
|
icon: Icon(icon),
|
||||||
color: themeData.primaryColor,
|
color: themeData.primaryColor,
|
||||||
onPressed: onPressed
|
onPressed: onPressed,
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
return MergeSemantics(
|
return MergeSemantics(
|
||||||
@ -80,8 +80,8 @@ class _ContactItem extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: rowChildren
|
children: rowChildren,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Edit',
|
tooltip: 'Edit',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text("Editing isn't supported in this screen.")
|
content: Text("Editing isn't supported in this screen."),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -138,19 +138,19 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<AppBarBehavior>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<AppBarBehavior>>[
|
||||||
const PopupMenuItem<AppBarBehavior>(
|
const PopupMenuItem<AppBarBehavior>(
|
||||||
value: AppBarBehavior.normal,
|
value: AppBarBehavior.normal,
|
||||||
child: Text('App bar scrolls away')
|
child: Text('App bar scrolls away'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<AppBarBehavior>(
|
const PopupMenuItem<AppBarBehavior>(
|
||||||
value: AppBarBehavior.pinned,
|
value: AppBarBehavior.pinned,
|
||||||
child: Text('App bar stays put')
|
child: Text('App bar stays put'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<AppBarBehavior>(
|
const PopupMenuItem<AppBarBehavior>(
|
||||||
value: AppBarBehavior.floating,
|
value: AppBarBehavior.floating,
|
||||||
child: Text('App bar floats')
|
child: Text('App bar floats'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<AppBarBehavior>(
|
const PopupMenuItem<AppBarBehavior>(
|
||||||
value: AppBarBehavior.snapping,
|
value: AppBarBehavior.snapping,
|
||||||
child: Text('App bar snaps')
|
child: Text('App bar snaps'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -193,7 +193,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Send message',
|
tooltip: 'Send message',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('Pretend that this opened your SMS application.')
|
content: Text('Pretend that this opened your SMS application.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -206,7 +206,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Send message',
|
tooltip: 'Send message',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('A messaging app appears.')
|
content: Text('A messaging app appears.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -219,7 +219,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Send message',
|
tooltip: 'Send message',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('Imagine if you will, a messaging application.')
|
content: Text('Imagine if you will, a messaging application.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -238,7 +238,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Send personal e-mail',
|
tooltip: 'Send personal e-mail',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('Here, your e-mail application would open.')
|
content: Text('Here, your e-mail application would open.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -251,7 +251,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Send work e-mail',
|
tooltip: 'Send work e-mail',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('Summon your favorite e-mail application here.')
|
content: Text('Summon your favorite e-mail application here.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -269,7 +269,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Open map',
|
tooltip: 'Open map',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('This would show a map of San Francisco.')
|
content: Text('This would show a map of San Francisco.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -283,7 +283,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Open map',
|
tooltip: 'Open map',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('This would show a map of Mountain View.')
|
content: Text('This would show a map of Mountain View.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
@ -297,7 +297,7 @@ class ContactsDemoState extends State<ContactsDemo> {
|
|||||||
tooltip: 'Open map',
|
tooltip: 'Open map',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text('This would also show a map, if this was not a demo.')
|
content: Text('This would also show a map, if this was not a demo.'),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
lines: const <String>[
|
lines: const <String>[
|
||||||
|
@ -178,7 +178,7 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context, 'Cancel');
|
Navigator.pop(context, 'Cancel');
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -56,7 +56,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
|
|||||||
child: const Text('Cupertino Button'),
|
child: const Text('Cupertino Button'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() { _pressedCount += 1; });
|
setState(() { _pressedCount += 1; });
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
const CupertinoButton(
|
const CupertinoButton(
|
||||||
child: Text('Disabled'),
|
child: Text('Disabled'),
|
||||||
@ -70,7 +70,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
|
|||||||
child: const Text('With Background'),
|
child: const Text('With Background'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() { _pressedCount += 1; });
|
setState(() { _pressedCount += 1; });
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.all(12.0)),
|
const Padding(padding: EdgeInsets.all(12.0)),
|
||||||
const CupertinoButton.filled(
|
const CupertinoButton.filled(
|
||||||
@ -83,7 +83,7 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ class CupertinoNavigationDemo extends StatelessWidget {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return CupertinoDemoTab1(
|
return CupertinoDemoTab1(
|
||||||
colorItems: colorItems,
|
colorItems: colorItems,
|
||||||
colorNameItems: colorNameItems
|
colorNameItems: colorNameItems,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
defaultTitle: 'Colors',
|
defaultTitle: 'Colors',
|
||||||
@ -750,7 +750,7 @@ class CupertinoDemoTab3 extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'Sign in',
|
'Sign in',
|
||||||
style: TextStyle(color: CupertinoTheme.of(context).primaryColor),
|
style: TextStyle(color: CupertinoTheme.of(context).primaryColor),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -32,7 +32,7 @@ class _CupertinoRefreshControlDemoState extends State<CupertinoRefreshControlDem
|
|||||||
return contacts[random.nextInt(contacts.length)]
|
return contacts[random.nextInt(contacts.length)]
|
||||||
// Randomly adds a telephone icon next to the contact or not.
|
// Randomly adds a telephone icon next to the contact or not.
|
||||||
..add(random.nextBool().toString());
|
..add(random.nextBool().toString());
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,10 +46,10 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_value = value;
|
_value = value;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
Text('Cupertino Continuous: ${_value.toStringAsFixed(1)}'),
|
Text('Cupertino Continuous: ${_value.toStringAsFixed(1)}'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -63,10 +63,10 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_discreteValue = value;
|
_discreteValue = value;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
Text('Cupertino Discrete: $_discreteValue'),
|
Text('Cupertino Discrete: $_discreteValue'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -116,7 +116,7 @@ class FruitPage extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
' ¬ ',
|
' ¬ ',
|
||||||
// TODO(larche): Replace textTheme.display3.color with a ColorScheme value when known.
|
// TODO(larche): Replace textTheme.display3.color with a ColorScheme value when known.
|
||||||
style: textTheme.overline.apply(color: textTheme.display3.color)
|
style: textTheme.overline.apply(color: textTheme.display3.color),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'CULTURE',
|
'CULTURE',
|
||||||
@ -160,7 +160,7 @@ class FruitPage extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -170,7 +170,7 @@ class FruitPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -34,7 +34,7 @@ class ImagesDemo extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ class _RadioItem<T> extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -333,7 +333,7 @@ class _DemoBottomAppBar extends StatelessWidget {
|
|||||||
const _DemoBottomAppBar({
|
const _DemoBottomAppBar({
|
||||||
this.color,
|
this.color,
|
||||||
this.fabLocation,
|
this.fabLocation,
|
||||||
this.shape
|
this.shape,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Color color;
|
final Color color;
|
||||||
|
@ -96,7 +96,7 @@ class CustomInactiveIcon extends StatelessWidget {
|
|||||||
height: iconTheme.size - 8.0,
|
height: iconTheme.size - 8.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: iconTheme.color, width: 2.0),
|
border: Border.all(color: iconTheme.color, width: 2.0),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
|
|||||||
title: 'Event',
|
title: 'Event',
|
||||||
color: Colors.pink,
|
color: Colors.pink,
|
||||||
vsync: this,
|
vsync: this,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
_navigationViews[_currentIndex].controller.value = 1.0;
|
_navigationViews[_currentIndex].controller.value = 1.0;
|
||||||
@ -218,13 +218,13 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
|
|||||||
const PopupMenuItem<BottomNavigationBarType>(
|
const PopupMenuItem<BottomNavigationBarType>(
|
||||||
value: BottomNavigationBarType.shifting,
|
value: BottomNavigationBarType.shifting,
|
||||||
child: Text('Shifting'),
|
child: Text('Shifting'),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: _buildTransitionsStack()
|
child: _buildTransitionsStack(),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: botNavBar,
|
bottomNavigationBar: botNavBar,
|
||||||
);
|
);
|
||||||
|
@ -323,7 +323,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
|||||||
},
|
},
|
||||||
items: <String>[
|
items: <String>[
|
||||||
'One', 'Two', 'Free', 'Four', 'Can', 'I', 'Have', 'A', 'Little',
|
'One', 'Two', 'Free', 'Four', 'Can', 'I', 'Have', 'A', 'Little',
|
||||||
'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'
|
'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten',
|
||||||
]
|
]
|
||||||
.map<DropdownMenuItem<String>>((String value) {
|
.map<DropdownMenuItem<String>>((String value) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
@ -363,7 +363,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
|||||||
semanticLabel: 'Thumbs not up',
|
semanticLabel: 'Thumbs not up',
|
||||||
),
|
),
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
.map<Widget>((Widget button) => SizedBox(width: 64.0, height: 64.0, child: button))
|
.map<Widget>((Widget button) => SizedBox(width: 64.0, height: 64.0, child: button))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
@ -66,7 +66,7 @@ const List<TravelDestination> destinations = <TravelDestination>[
|
|||||||
city: 'Thanjavur',
|
city: 'Thanjavur',
|
||||||
location: 'Thanjavur, Tamil Nadu',
|
location: 'Thanjavur, Tamil Nadu',
|
||||||
type: CardDemoType.selectable,
|
type: CardDemoType.selectable,
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
class TravelDestinationItem extends StatelessWidget {
|
class TravelDestinationItem extends StatelessWidget {
|
||||||
@ -215,7 +215,7 @@ class _SelectableTravelDestinationItemState extends State<SelectableTravelDestin
|
|||||||
Icons.check_circle,
|
Icons.check_circle,
|
||||||
color: _isSelected ? colorScheme.primary : Colors.transparent,
|
color: _isSelected ? colorScheme.primary : Colors.transparent,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -232,7 +232,7 @@ class _SelectableTravelDestinationItemState extends State<SelectableTravelDestin
|
|||||||
class SectionTitle extends StatelessWidget {
|
class SectionTitle extends StatelessWidget {
|
||||||
const SectionTitle({
|
const SectionTitle({
|
||||||
Key key,
|
Key key,
|
||||||
this.title
|
this.title,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
@ -277,7 +277,7 @@ class TravelDestinationContent extends StatelessWidget {
|
|||||||
image: AssetImage(destination.assetName, package: destination.assetPackage),
|
image: AssetImage(destination.assetName, package: destination.assetPackage),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
child: Container(),
|
child: Container(),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 16.0,
|
bottom: 16.0,
|
||||||
@ -408,8 +408,8 @@ class _CardsDemoState extends State<CardsDemo> {
|
|||||||
margin: const EdgeInsets.only(bottom: 8.0),
|
margin: const EdgeInsets.only(bottom: 8.0),
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList(),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ class _ChipsTile extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: cardChildren,
|
children: cardChildren,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ class _ChipDemoState extends State<ChipDemo> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.vignette, semanticLabel: 'Update border shape'),
|
icon: const Icon(Icons.vignette, semanticLabel: 'Update border shape'),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: ChipTheme(
|
body: ChipTheme(
|
||||||
|
@ -121,7 +121,7 @@ class DessertDataSource extends DataTableSource {
|
|||||||
DataCell(Text('${dessert.sodium}')),
|
DataCell(Text('${dessert.sodium}')),
|
||||||
DataCell(Text('${dessert.calcium}%')),
|
DataCell(Text('${dessert.calcium}%')),
|
||||||
DataCell(Text('${dessert.iron}%')),
|
DataCell(Text('${dessert.iron}%')),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,50 +185,50 @@ class _DataTableDemoState extends State<DataTableDemo> {
|
|||||||
columns: <DataColumn>[
|
columns: <DataColumn>[
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Dessert (100g serving)'),
|
label: const Text('Dessert (100g serving)'),
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<String>((Dessert d) => d.name, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<String>((Dessert d) => d.name, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Calories'),
|
label: const Text('Calories'),
|
||||||
tooltip: 'The total amount of food energy in the given serving size.',
|
tooltip: 'The total amount of food energy in the given serving size.',
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calories, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calories, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Fat (g)'),
|
label: const Text('Fat (g)'),
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.fat, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.fat, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Carbs (g)'),
|
label: const Text('Carbs (g)'),
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.carbs, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.carbs, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Protein (g)'),
|
label: const Text('Protein (g)'),
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.protein, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.protein, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Sodium (mg)'),
|
label: const Text('Sodium (mg)'),
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.sodium, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.sodium, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Calcium (%)'),
|
label: const Text('Calcium (%)'),
|
||||||
tooltip: 'The amount of calcium as a percentage of the recommended daily amount.',
|
tooltip: 'The amount of calcium as a percentage of the recommended daily amount.',
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calcium, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calcium, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: const Text('Iron (%)'),
|
label: const Text('Iron (%)'),
|
||||||
numeric: true,
|
numeric: true,
|
||||||
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.iron, columnIndex, ascending)
|
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.iron, columnIndex, ascending),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
source: _dessertsDataSource
|
source: _dessertsDataSource,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class _InputDropdown extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(valueText, style: valueStyle),
|
Text(valueText, style: valueStyle),
|
||||||
Icon(Icons.arrow_drop_down,
|
Icon(Icons.arrow_drop_down,
|
||||||
color: Theme.of(context).brightness == Brightness.light ? Colors.grey.shade700 : Colors.white70
|
color: Theme.of(context).brightness == Brightness.light ? Colors.grey.shade700 : Colors.white70,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -55,7 +55,7 @@ class _DateTimePicker extends StatelessWidget {
|
|||||||
this.selectedDate,
|
this.selectedDate,
|
||||||
this.selectedTime,
|
this.selectedTime,
|
||||||
this.selectDate,
|
this.selectDate,
|
||||||
this.selectTime
|
this.selectTime,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String labelText;
|
final String labelText;
|
||||||
@ -69,7 +69,7 @@ class _DateTimePicker extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
initialDate: selectedDate,
|
initialDate: selectedDate,
|
||||||
firstDate: DateTime(2015, 8),
|
firstDate: DateTime(2015, 8),
|
||||||
lastDate: DateTime(2101)
|
lastDate: DateTime(2101),
|
||||||
);
|
);
|
||||||
if (picked != null && picked != selectedDate)
|
if (picked != null && picked != selectedDate)
|
||||||
selectDate(picked);
|
selectDate(picked);
|
||||||
@ -78,7 +78,7 @@ class _DateTimePicker extends StatelessWidget {
|
|||||||
Future<void> _selectTime(BuildContext context) async {
|
Future<void> _selectTime(BuildContext context) async {
|
||||||
final TimeOfDay picked = await showTimePicker(
|
final TimeOfDay picked = await showTimePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialTime: selectedTime
|
initialTime: selectedTime,
|
||||||
);
|
);
|
||||||
if (picked != null && picked != selectedTime)
|
if (picked != null && picked != selectedTime)
|
||||||
selectTime(picked);
|
selectTime(picked);
|
||||||
|
@ -74,7 +74,7 @@ class DialogDemoState extends State<DialogDemo> {
|
|||||||
.then<void>((T value) { // The value passed to Navigator.pop() or null.
|
.then<void>((T value) { // The value passed to Navigator.pop() or null.
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||||
content: Text('You selected: $value')
|
content: Text('You selected: $value'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -102,21 +102,21 @@ class DialogDemoState extends State<DialogDemo> {
|
|||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
content: Text(
|
content: Text(
|
||||||
_alertWithoutTitleText,
|
_alertWithoutTitleText,
|
||||||
style: dialogTextStyle
|
style: dialogTextStyle,
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: const Text('CANCEL'),
|
child: const Text('CANCEL'),
|
||||||
onPressed: () { Navigator.pop(context, DialogDemoAction.cancel); }
|
onPressed: () { Navigator.pop(context, DialogDemoAction.cancel); },
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: const Text('DISCARD'),
|
child: const Text('DISCARD'),
|
||||||
onPressed: () { Navigator.pop(context, DialogDemoAction.discard); }
|
onPressed: () { Navigator.pop(context, DialogDemoAction.discard); },
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
child: const Text('ALERT WITH TITLE'),
|
child: const Text('ALERT WITH TITLE'),
|
||||||
@ -127,21 +127,21 @@ class DialogDemoState extends State<DialogDemo> {
|
|||||||
title: const Text('Use Google\'s location service?'),
|
title: const Text('Use Google\'s location service?'),
|
||||||
content: Text(
|
content: Text(
|
||||||
_alertWithTitleText,
|
_alertWithTitleText,
|
||||||
style: dialogTextStyle
|
style: dialogTextStyle,
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: const Text('DISAGREE'),
|
child: const Text('DISAGREE'),
|
||||||
onPressed: () { Navigator.pop(context, DialogDemoAction.disagree); }
|
onPressed: () { Navigator.pop(context, DialogDemoAction.disagree); },
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: const Text('AGREE'),
|
child: const Text('AGREE'),
|
||||||
onPressed: () { Navigator.pop(context, DialogDemoAction.agree); }
|
onPressed: () { Navigator.pop(context, DialogDemoAction.agree); },
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
child: const Text('SIMPLE'),
|
child: const Text('SIMPLE'),
|
||||||
@ -155,40 +155,40 @@ class DialogDemoState extends State<DialogDemo> {
|
|||||||
icon: Icons.account_circle,
|
icon: Icons.account_circle,
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
text: 'username@gmail.com',
|
text: 'username@gmail.com',
|
||||||
onPressed: () { Navigator.pop(context, 'username@gmail.com'); }
|
onPressed: () { Navigator.pop(context, 'username@gmail.com'); },
|
||||||
),
|
),
|
||||||
DialogDemoItem(
|
DialogDemoItem(
|
||||||
icon: Icons.account_circle,
|
icon: Icons.account_circle,
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
text: 'user02@gmail.com',
|
text: 'user02@gmail.com',
|
||||||
onPressed: () { Navigator.pop(context, 'user02@gmail.com'); }
|
onPressed: () { Navigator.pop(context, 'user02@gmail.com'); },
|
||||||
),
|
),
|
||||||
DialogDemoItem(
|
DialogDemoItem(
|
||||||
icon: Icons.add_circle,
|
icon: Icons.add_circle,
|
||||||
text: 'add account',
|
text: 'add account',
|
||||||
color: theme.disabledColor
|
color: theme.disabledColor,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
child: const Text('CONFIRMATION'),
|
child: const Text('CONFIRMATION'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showTimePicker(
|
showTimePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialTime: _selectedTime
|
initialTime: _selectedTime,
|
||||||
)
|
)
|
||||||
.then<void>((TimeOfDay value) {
|
.then<void>((TimeOfDay value) {
|
||||||
if (value != null && value != _selectedTime) {
|
if (value != null && value != _selectedTime) {
|
||||||
_selectedTime = value;
|
_selectedTime = value;
|
||||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||||
content: Text('You selected: ${value.format(context)}')
|
content: Text('You selected: ${value.format(context)}'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
child: const Text('FULLSCREEN'),
|
child: const Text('FULLSCREEN'),
|
||||||
@ -197,18 +197,18 @@ class DialogDemoState extends State<DialogDemo> {
|
|||||||
builder: (BuildContext context) => FullScreenDialogDemo(),
|
builder: (BuildContext context) => FullScreenDialogDemo(),
|
||||||
fullscreenDialog: true,
|
fullscreenDialog: true,
|
||||||
));
|
));
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
// Add a little space between the buttons
|
// Add a little space between the buttons
|
||||||
.map<Widget>((Widget button) {
|
.map<Widget>((Widget button) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: button
|
child: button,
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.toList()
|
.toList(),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
|
|||||||
void _showNotImplementedMessage() {
|
void _showNotImplementedMessage() {
|
||||||
Navigator.pop(context); // Dismiss the drawer.
|
Navigator.pop(context); // Dismiss the drawer.
|
||||||
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
_scaffoldKey.currentState.showSnackBar(const SnackBar(
|
||||||
content: Text("The drawer's items don't do anything")
|
content: Text("The drawer's items don't do anything"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ class _ElevationDemoState extends State<ElevationDemo> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() => _showElevation = !_showElevation);
|
setState(() => _showElevation = !_showElevation);
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
|
@ -21,7 +21,7 @@ class DualHeaderWithHint extends StatelessWidget {
|
|||||||
this.name,
|
this.name,
|
||||||
this.value,
|
this.value,
|
||||||
this.hint,
|
this.hint,
|
||||||
this.showHint
|
this.showHint,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String name;
|
final String name;
|
||||||
@ -69,11 +69,11 @@ class DualHeaderWithHint extends StatelessWidget {
|
|||||||
child: _crossFade(
|
child: _crossFade(
|
||||||
Text(value, style: textTheme.caption.copyWith(fontSize: 15.0)),
|
Text(value, style: textTheme.caption.copyWith(fontSize: 15.0)),
|
||||||
Text(hint, style: textTheme.caption.copyWith(fontSize: 15.0)),
|
Text(hint, style: textTheme.caption.copyWith(fontSize: 15.0)),
|
||||||
showHint
|
showHint,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ class CollapsibleBody extends StatelessWidget {
|
|||||||
this.margin = EdgeInsets.zero,
|
this.margin = EdgeInsets.zero,
|
||||||
this.child,
|
this.child,
|
||||||
this.onSave,
|
this.onSave,
|
||||||
this.onCancel
|
this.onCancel,
|
||||||
});
|
});
|
||||||
|
|
||||||
final EdgeInsets margin;
|
final EdgeInsets margin;
|
||||||
@ -102,14 +102,14 @@ class CollapsibleBody extends StatelessWidget {
|
|||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(
|
||||||
left: 24.0,
|
left: 24.0,
|
||||||
right: 24.0,
|
right: 24.0,
|
||||||
bottom: 24.0
|
bottom: 24.0,
|
||||||
) - margin,
|
) - margin,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: DefaultTextStyle(
|
child: DefaultTextStyle(
|
||||||
style: textTheme.caption.copyWith(fontSize: 15.0),
|
style: textTheme.caption.copyWith(fontSize: 15.0),
|
||||||
child: child
|
child: child,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
const Divider(height: 1.0),
|
const Divider(height: 1.0),
|
||||||
Container(
|
Container(
|
||||||
@ -124,22 +124,22 @@ class CollapsibleBody extends StatelessWidget {
|
|||||||
child: const Text('CANCEL', style: TextStyle(
|
child: const Text('CANCEL', style: TextStyle(
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
fontSize: 15.0,
|
fontSize: 15.0,
|
||||||
fontWeight: FontWeight.w500
|
fontWeight: FontWeight.w500,
|
||||||
))
|
)),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(right: 8.0),
|
margin: const EdgeInsets.only(right: 8.0),
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
onPressed: onSave,
|
onPressed: onSave,
|
||||||
textTheme: ButtonTextTheme.accent,
|
textTheme: ButtonTextTheme.accent,
|
||||||
child: const Text('SAVE')
|
child: const Text('SAVE'),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ class DemoItem<T> {
|
|||||||
this.value,
|
this.value,
|
||||||
this.hint,
|
this.hint,
|
||||||
this.builder,
|
this.builder,
|
||||||
this.valueToString
|
this.valueToString,
|
||||||
}) : textController = TextEditingController(text: valueToString(value));
|
}) : textController = TextEditingController(text: valueToString(value));
|
||||||
|
|
||||||
final String name;
|
final String name;
|
||||||
@ -167,7 +167,7 @@ class DemoItem<T> {
|
|||||||
name: name,
|
name: name,
|
||||||
value: valueToString(value),
|
value: valueToString(value),
|
||||||
hint: hint,
|
hint: hint,
|
||||||
showHint: isExpanded
|
showHint: isExpanded,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -269,15 +269,15 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
|
|||||||
groupValue: field.value,
|
groupValue: field.value,
|
||||||
onChanged: field.didChange,
|
onChanged: field.didChange,
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
),
|
),
|
||||||
DemoItem<double>(
|
DemoItem<double>(
|
||||||
name: 'Sun',
|
name: 'Sun',
|
||||||
@ -314,10 +314,10 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,9 +346,9 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
|
|||||||
return ExpansionPanel(
|
return ExpansionPanel(
|
||||||
isExpanded: item.isExpanded,
|
isExpanded: item.isExpanded,
|
||||||
headerBuilder: item.headerBuilder,
|
headerBuilder: item.headerBuilder,
|
||||||
body: item.build()
|
body: item.build(),
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -27,12 +27,12 @@ class ExpansionTileListDemo extends StatelessWidget {
|
|||||||
ListTile(title: Text('Two')),
|
ListTile(title: Text('Two')),
|
||||||
// https://en.wikipedia.org/wiki/Free_Four
|
// https://en.wikipedia.org/wiki/Free_Four
|
||||||
ListTile(title: Text('Free')),
|
ListTile(title: Text('Free')),
|
||||||
ListTile(title: Text('Four'))
|
ListTile(title: Text('Four')),
|
||||||
]
|
],
|
||||||
|
),
|
||||||
|
const ListTile(title: Text('Bottom')),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const ListTile(title: Text('Bottom'))
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class DateTimeItem extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
initialDate: date,
|
initialDate: date,
|
||||||
firstDate: date.subtract(const Duration(days: 30)),
|
firstDate: date.subtract(const Duration(days: 30)),
|
||||||
lastDate: date.add(const Duration(days: 30))
|
lastDate: date.add(const Duration(days: 30)),
|
||||||
)
|
)
|
||||||
.then<void>((DateTime value) {
|
.then<void>((DateTime value) {
|
||||||
if (value != null)
|
if (value != null)
|
||||||
@ -59,10 +59,10 @@ class DateTimeItem extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(DateFormat('EEE, MMM d yyyy').format(date)),
|
Text(DateFormat('EEE, MMM d yyyy').format(date)),
|
||||||
const Icon(Icons.arrow_drop_down, color: Colors.black54),
|
const Icon(Icons.arrow_drop_down, color: Colors.black54),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 8.0),
|
margin: const EdgeInsets.only(left: 8.0),
|
||||||
@ -74,7 +74,7 @@ class DateTimeItem extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
showTimePicker(
|
showTimePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialTime: time
|
initialTime: time,
|
||||||
)
|
)
|
||||||
.then<void>((TimeOfDay value) {
|
.then<void>((TimeOfDay value) {
|
||||||
if (value != null)
|
if (value != null)
|
||||||
@ -85,12 +85,12 @@ class DateTimeItem extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text('${time.format(context)}'),
|
Text('${time.format(context)}'),
|
||||||
const Icon(Icons.arrow_drop_down, color: Colors.black54),
|
const Icon(Icons.arrow_drop_down, color: Colors.black54),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,21 +123,21 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
content: Text(
|
content: Text(
|
||||||
'Discard new event?',
|
'Discard new event?',
|
||||||
style: dialogTextStyle
|
style: dialogTextStyle,
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: const Text('CANCEL'),
|
child: const Text('CANCEL'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(false); // Pops the confirmation dialog but not the page.
|
Navigator.of(context).pop(false); // Pops the confirmation dialog but not the page.
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: const Text('DISCARD'),
|
child: const Text('DISCARD'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(true); // Returning true to _onWillPop will pop again.
|
Navigator.of(context).pop(true); // Returning true to _onWillPop will pop again.
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -156,9 +156,9 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
child: Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
|
child: Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context, DismissDialogAction.save);
|
Navigator.pop(context, DismissDialogAction.save);
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
body: Form(
|
body: Form(
|
||||||
onWillPop: _onWillPop,
|
onWillPop: _onWillPop,
|
||||||
@ -171,7 +171,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
child: TextField(
|
child: TextField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Event name',
|
labelText: 'Event name',
|
||||||
filled: true
|
filled: true,
|
||||||
),
|
),
|
||||||
style: theme.textTheme.headline,
|
style: theme.textTheme.headline,
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
@ -181,8 +181,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
_eventName = value;
|
_eventName = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
@ -191,14 +191,14 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Location',
|
labelText: 'Location',
|
||||||
hintText: 'Where is the event?',
|
hintText: 'Where is the event?',
|
||||||
filled: true
|
filled: true,
|
||||||
),
|
),
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_hasLocation = value.isNotEmpty;
|
_hasLocation = value.isNotEmpty;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -211,9 +211,9 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
_fromDateTime = value;
|
_fromDateTime = value;
|
||||||
_saveNeeded = true;
|
_saveNeeded = true;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -226,10 +226,10 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
_toDateTime = value;
|
_toDateTime = value;
|
||||||
_saveNeeded = true;
|
_saveNeeded = true;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
const Text('All-day'),
|
const Text('All-day'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -244,22 +244,22 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
_allDayValue = value;
|
_allDayValue = value;
|
||||||
_saveNeeded = true;
|
_saveNeeded = true;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
const Text('All-day'),
|
const Text('All-day'),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
.map<Widget>((Widget child) {
|
.map<Widget>((Widget child) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
height: 96.0,
|
height: 96.0,
|
||||||
child: child
|
child: child,
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.toList()
|
.toList(),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
|
|||||||
final double distance = (Offset.zero & context.size).shortestSide;
|
final double distance = (Offset.zero & context.size).shortestSide;
|
||||||
_flingAnimation = _controller.drive(Tween<Offset>(
|
_flingAnimation = _controller.drive(Tween<Offset>(
|
||||||
begin: _offset,
|
begin: _offset,
|
||||||
end: _clampOffset(_offset + direction * distance)
|
end: _clampOffset(_offset + direction * distance),
|
||||||
));
|
));
|
||||||
_controller
|
_controller
|
||||||
..value = 0.0
|
..value = 0.0
|
||||||
@ -155,7 +155,7 @@ class GridDemoPhotoItem extends StatelessWidget {
|
|||||||
Key key,
|
Key key,
|
||||||
@required this.photo,
|
@required this.photo,
|
||||||
@required this.tileStyle,
|
@required this.tileStyle,
|
||||||
@required this.onBannerTap
|
@required this.onBannerTap,
|
||||||
}) : assert(photo != null && photo.isValid),
|
}) : assert(photo != null && photo.isValid),
|
||||||
assert(tileStyle != null),
|
assert(tileStyle != null),
|
||||||
assert(onBannerTap != null),
|
assert(onBannerTap != null),
|
||||||
@ -170,7 +170,7 @@ class GridDemoPhotoItem extends StatelessWidget {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(photo.title)
|
title: Text(photo.title),
|
||||||
),
|
),
|
||||||
body: SizedBox.expand(
|
body: SizedBox.expand(
|
||||||
child: Hero(
|
child: Hero(
|
||||||
@ -194,8 +194,8 @@ class GridDemoPhotoItem extends StatelessWidget {
|
|||||||
photo.assetName,
|
photo.assetName,
|
||||||
package: photo.assetPackage,
|
package: photo.assetPackage,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final IconData icon = photo.isFavorite ? Icons.star : Icons.star_border;
|
final IconData icon = photo.isFavorite ? Icons.star : Icons.star_border;
|
||||||
@ -382,7 +382,7 @@ class GridListDemoState extends State<GridListDemo> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
photo.isFavorite = !photo.isFavorite;
|
photo.isFavorite = !photo.isFavorite;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
@ -83,7 +83,7 @@ class _IconsDemoCard extends StatelessWidget {
|
|||||||
icon: Icon(icon),
|
icon: Icon(icon),
|
||||||
iconSize: iconSize,
|
iconSize: iconSize,
|
||||||
tooltip: "${enabled ? 'Enabled' : 'Disabled'} icon button",
|
tooltip: "${enabled ? 'Enabled' : 'Disabled'} icon button",
|
||||||
onPressed: enabled ? handleIconButtonPress : null
|
onPressed: enabled ? handleIconButtonPress : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
|||||||
index: index,
|
index: index,
|
||||||
name: 'Item $index Sender',
|
name: 'Item $index Sender',
|
||||||
subject: 'Subject: $index',
|
subject: 'Subject: $index',
|
||||||
body: "[$index] first line of the message's body..."
|
body: "[$index] first line of the message's body...",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -96,8 +96,8 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
|||||||
content: Text('You archived item ${item.index}'),
|
content: Text('You archived item ${item.index}'),
|
||||||
action: SnackBarAction(
|
action: SnackBarAction(
|
||||||
label: 'UNDO',
|
label: 'UNDO',
|
||||||
onPressed: () { handleUndo(item); }
|
onPressed: () { handleUndo(item); },
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,8 +109,8 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
|||||||
content: Text('You deleted item ${item.index}'),
|
content: Text('You deleted item ${item.index}'),
|
||||||
action: SnackBarAction(
|
action: SnackBarAction(
|
||||||
label: 'UNDO',
|
label: 'UNDO',
|
||||||
onPressed: () { handleUndo(item); }
|
onPressed: () { handleUndo(item); },
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
|||||||
onDelete: _handleDelete,
|
onDelete: _handleDelete,
|
||||||
dismissDirection: _dismissDirection,
|
dismissDirection: _dismissDirection,
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,27 +148,27 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
|||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<LeaveBehindDemoAction>>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry<LeaveBehindDemoAction>>[
|
||||||
const PopupMenuItem<LeaveBehindDemoAction>(
|
const PopupMenuItem<LeaveBehindDemoAction>(
|
||||||
value: LeaveBehindDemoAction.reset,
|
value: LeaveBehindDemoAction.reset,
|
||||||
child: Text('Reset the list')
|
child: Text('Reset the list'),
|
||||||
),
|
),
|
||||||
const PopupMenuDivider(),
|
const PopupMenuDivider(),
|
||||||
CheckedPopupMenuItem<LeaveBehindDemoAction>(
|
CheckedPopupMenuItem<LeaveBehindDemoAction>(
|
||||||
value: LeaveBehindDemoAction.horizontalSwipe,
|
value: LeaveBehindDemoAction.horizontalSwipe,
|
||||||
checked: _dismissDirection == DismissDirection.horizontal,
|
checked: _dismissDirection == DismissDirection.horizontal,
|
||||||
child: const Text('Horizontal swipe')
|
child: const Text('Horizontal swipe'),
|
||||||
),
|
),
|
||||||
CheckedPopupMenuItem<LeaveBehindDemoAction>(
|
CheckedPopupMenuItem<LeaveBehindDemoAction>(
|
||||||
value: LeaveBehindDemoAction.leftSwipe,
|
value: LeaveBehindDemoAction.leftSwipe,
|
||||||
checked: _dismissDirection == DismissDirection.endToStart,
|
checked: _dismissDirection == DismissDirection.endToStart,
|
||||||
child: const Text('Only swipe left')
|
child: const Text('Only swipe left'),
|
||||||
),
|
),
|
||||||
CheckedPopupMenuItem<LeaveBehindDemoAction>(
|
CheckedPopupMenuItem<LeaveBehindDemoAction>(
|
||||||
value: LeaveBehindDemoAction.rightSwipe,
|
value: LeaveBehindDemoAction.rightSwipe,
|
||||||
checked: _dismissDirection == DismissDirection.startToEnd,
|
checked: _dismissDirection == DismissDirection.startToEnd,
|
||||||
child: const Text('Only swipe right')
|
child: const Text('Only swipe right'),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
body: body,
|
body: body,
|
||||||
);
|
);
|
||||||
@ -217,24 +217,24 @@ class _LeaveBehindListItem extends StatelessWidget {
|
|||||||
background: Container(
|
background: Container(
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
child: const ListTile(
|
child: const ListTile(
|
||||||
leading: Icon(Icons.delete, color: Colors.white, size: 36.0)
|
leading: Icon(Icons.delete, color: Colors.white, size: 36.0),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
secondaryBackground: Container(
|
secondaryBackground: Container(
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
child: const ListTile(
|
child: const ListTile(
|
||||||
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0)
|
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.canvasColor,
|
color: theme.canvasColor,
|
||||||
border: Border(bottom: BorderSide(color: theme.dividerColor))
|
border: Border(bottom: BorderSide(color: theme.dividerColor)),
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(item.name),
|
title: Text(item.name),
|
||||||
subtitle: Text('${item.subject}\n${item.body}'),
|
subtitle: Text('${item.subject}\n${item.body}'),
|
||||||
isThreeLine: true
|
isThreeLine: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -68,7 +68,7 @@ class _ListDemoState extends State<ListDemo> {
|
|||||||
value: _showAvatars ? _MaterialListType.oneLineWithAvatar : _MaterialListType.oneLine,
|
value: _showAvatars ? _MaterialListType.oneLineWithAvatar : _MaterialListType.oneLine,
|
||||||
groupValue: _itemType,
|
groupValue: _itemType,
|
||||||
onChanged: changeItemType,
|
onChanged: changeItemType,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MergeSemantics(
|
MergeSemantics(
|
||||||
@ -79,7 +79,7 @@ class _ListDemoState extends State<ListDemo> {
|
|||||||
value: _MaterialListType.twoLine,
|
value: _MaterialListType.twoLine,
|
||||||
groupValue: _itemType,
|
groupValue: _itemType,
|
||||||
onChanged: changeItemType,
|
onChanged: changeItemType,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MergeSemantics(
|
MergeSemantics(
|
||||||
|
@ -38,7 +38,7 @@ class MenuDemoState extends State<MenuDemo> {
|
|||||||
|
|
||||||
void showInSnackBar(String value) {
|
void showInSnackBar(String value) {
|
||||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||||
content: Text(value)
|
content: Text(value),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,15 +72,15 @@ class MenuDemoState extends State<MenuDemo> {
|
|||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Toolbar menu',
|
value: 'Toolbar menu',
|
||||||
child: Text('Toolbar menu')
|
child: Text('Toolbar menu'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Right here',
|
value: 'Right here',
|
||||||
child: Text('Right here')
|
child: Text('Right here'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Hooray!',
|
value: 'Hooray!',
|
||||||
child: Text('Hooray!')
|
child: Text('Hooray!'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -100,18 +100,18 @@ class MenuDemoState extends State<MenuDemo> {
|
|||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
value: _simpleValue1,
|
value: _simpleValue1,
|
||||||
child: const Text('Context menu item one')
|
child: const Text('Context menu item one'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
child: Text('A disabled menu item')
|
child: Text('A disabled menu item'),
|
||||||
),
|
),
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
value: _simpleValue3,
|
value: _simpleValue3,
|
||||||
child: const Text('Context menu item three')
|
child: const Text('Context menu item three'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
// Pressing the PopupMenuButton on the right of this item shows
|
// Pressing the PopupMenuButton on the right of this item shows
|
||||||
// a menu whose items have text labels and icons and a divider
|
// a menu whose items have text labels and icons and a divider
|
||||||
@ -126,33 +126,33 @@ class MenuDemoState extends State<MenuDemo> {
|
|||||||
value: 'Preview',
|
value: 'Preview',
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Icon(Icons.visibility),
|
leading: Icon(Icons.visibility),
|
||||||
title: Text('Preview')
|
title: Text('Preview'),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Share',
|
value: 'Share',
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Icon(Icons.person_add),
|
leading: Icon(Icons.person_add),
|
||||||
title: Text('Share')
|
title: Text('Share'),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Get Link',
|
value: 'Get Link',
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Icon(Icons.link),
|
leading: Icon(Icons.link),
|
||||||
title: Text('Get link')
|
title: Text('Get link'),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
const PopupMenuDivider(),
|
const PopupMenuDivider(),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Remove',
|
value: 'Remove',
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Icon(Icons.delete),
|
leading: Icon(Icons.delete),
|
||||||
title: Text('Remove')
|
title: Text('Remove'),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
// This entire list item is a PopupMenuButton. Tapping anywhere shows
|
// This entire list item is a PopupMenuButton. Tapping anywhere shows
|
||||||
// a menu whose current value is highlighted and aligned over the
|
// a menu whose current value is highlighted and aligned over the
|
||||||
@ -163,22 +163,22 @@ class MenuDemoState extends State<MenuDemo> {
|
|||||||
onSelected: showMenuSelection,
|
onSelected: showMenuSelection,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: const Text('An item with a simple menu'),
|
title: const Text('An item with a simple menu'),
|
||||||
subtitle: Text(_simpleValue)
|
subtitle: Text(_simpleValue),
|
||||||
),
|
),
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
value: _simpleValue1,
|
value: _simpleValue1,
|
||||||
child: Text(_simpleValue1)
|
child: Text(_simpleValue1),
|
||||||
),
|
),
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
value: _simpleValue2,
|
value: _simpleValue2,
|
||||||
child: Text(_simpleValue2)
|
child: Text(_simpleValue2),
|
||||||
),
|
),
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
value: _simpleValue3,
|
value: _simpleValue3,
|
||||||
child: Text(_simpleValue3)
|
child: Text(_simpleValue3),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
// Pressing the PopupMenuButton on the right of this item shows a menu
|
// Pressing the PopupMenuButton on the right of this item shows a menu
|
||||||
// whose items have checked icons that reflect this app's state.
|
// whose items have checked icons that reflect this app's state.
|
||||||
@ -191,29 +191,29 @@ class MenuDemoState extends State<MenuDemo> {
|
|||||||
CheckedPopupMenuItem<String>(
|
CheckedPopupMenuItem<String>(
|
||||||
value: _checkedValue1,
|
value: _checkedValue1,
|
||||||
checked: isChecked(_checkedValue1),
|
checked: isChecked(_checkedValue1),
|
||||||
child: Text(_checkedValue1)
|
child: Text(_checkedValue1),
|
||||||
),
|
),
|
||||||
CheckedPopupMenuItem<String>(
|
CheckedPopupMenuItem<String>(
|
||||||
value: _checkedValue2,
|
value: _checkedValue2,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
checked: isChecked(_checkedValue2),
|
checked: isChecked(_checkedValue2),
|
||||||
child: Text(_checkedValue2)
|
child: Text(_checkedValue2),
|
||||||
),
|
),
|
||||||
CheckedPopupMenuItem<String>(
|
CheckedPopupMenuItem<String>(
|
||||||
value: _checkedValue3,
|
value: _checkedValue3,
|
||||||
checked: isChecked(_checkedValue3),
|
checked: isChecked(_checkedValue3),
|
||||||
child: Text(_checkedValue3)
|
child: Text(_checkedValue3),
|
||||||
),
|
),
|
||||||
CheckedPopupMenuItem<String>(
|
CheckedPopupMenuItem<String>(
|
||||||
value: _checkedValue4,
|
value: _checkedValue4,
|
||||||
checked: isChecked(_checkedValue4),
|
checked: isChecked(_checkedValue4),
|
||||||
child: Text(_checkedValue4)
|
child: Text(_checkedValue4),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,15 +28,15 @@ class ModalBottomSheetDemo extends StatelessWidget {
|
|||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).accentColor,
|
color: Theme.of(context).accentColor,
|
||||||
fontSize: 24.0
|
fontSize: 24.0,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
|
|||||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
|
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
|
||||||
static final List<String> _items = <String>[
|
static final List<String> _items = <String>[
|
||||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||||
];
|
];
|
||||||
|
|
||||||
Future<void> _handleRefresh() {
|
Future<void> _handleRefresh() {
|
||||||
@ -36,8 +36,8 @@ class OverscrollDemoState extends State<OverscrollDemo> {
|
|||||||
label: 'RETRY',
|
label: 'RETRY',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_refreshIndicatorKey.currentState.show();
|
_refreshIndicatorKey.currentState.show();
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -55,9 +55,9 @@ class OverscrollDemoState extends State<OverscrollDemo> {
|
|||||||
tooltip: 'Refresh',
|
tooltip: 'Refresh',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_refreshIndicatorKey.currentState.show();
|
_refreshIndicatorKey.currentState.show();
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
body: RefreshIndicator(
|
body: RefreshIndicator(
|
||||||
key: _refreshIndicatorKey,
|
key: _refreshIndicatorKey,
|
||||||
|
@ -34,18 +34,18 @@ class _PageSelector extends StatelessWidget {
|
|||||||
icon: const Icon(Icons.chevron_left),
|
icon: const Icon(Icons.chevron_left),
|
||||||
color: color,
|
color: color,
|
||||||
onPressed: () { _handleArrowButtonPress(context, -1); },
|
onPressed: () { _handleArrowButtonPress(context, -1); },
|
||||||
tooltip: 'Page back'
|
tooltip: 'Page back',
|
||||||
),
|
),
|
||||||
TabPageSelector(controller: controller),
|
TabPageSelector(controller: controller),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.chevron_right),
|
icon: const Icon(Icons.chevron_right),
|
||||||
color: color,
|
color: color,
|
||||||
onPressed: () { _handleArrowButtonPress(context, 1); },
|
onPressed: () { _handleArrowButtonPress(context, 1); },
|
||||||
tooltip: 'Page forward'
|
tooltip: 'Page forward',
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: IconTheme(
|
child: IconTheme(
|
||||||
@ -63,7 +63,7 @@ class _PageSelector extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -40,10 +40,10 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
|
|||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeData.accentColor,
|
color: themeData.accentColor,
|
||||||
fontSize: 24.0
|
fontSize: 24.0,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.closed.whenComplete(() {
|
.closed.whenComplete(() {
|
||||||
@ -66,8 +66,8 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: const Text('OK')
|
child: const Text('OK'),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -95,9 +95,9 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
|
|||||||
body: Center(
|
body: Center(
|
||||||
child: RaisedButton(
|
child: RaisedButton(
|
||||||
onPressed: _showBottomSheetCallback,
|
onPressed: _showBottomSheetCallback,
|
||||||
child: const Text('SHOW BOTTOM SHEET')
|
child: const Text('SHOW BOTTOM SHEET'),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
|
|||||||
_animation = CurvedAnimation(
|
_animation = CurvedAnimation(
|
||||||
parent: _controller,
|
parent: _controller,
|
||||||
curve: const Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
|
curve: const Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
|
||||||
reverseCurve: Curves.fastOutSlowIn
|
reverseCurve: Curves.fastOutSlowIn,
|
||||||
)..addStatusListener((AnimationStatus status) {
|
)..addStatusListener((AnimationStatus status) {
|
||||||
if (status == AnimationStatus.dismissed)
|
if (status == AnimationStatus.dismissed)
|
||||||
_controller.forward();
|
_controller.forward();
|
||||||
@ -68,7 +68,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
|
|||||||
final List<Widget> indicators = <Widget>[
|
final List<Widget> indicators = <Widget>[
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 200.0,
|
width: 200.0,
|
||||||
child: LinearProgressIndicator()
|
child: LinearProgressIndicator(),
|
||||||
),
|
),
|
||||||
const LinearProgressIndicator(),
|
const LinearProgressIndicator(),
|
||||||
const LinearProgressIndicator(),
|
const LinearProgressIndicator(),
|
||||||
@ -80,13 +80,13 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20.0,
|
width: 20.0,
|
||||||
height: 20.0,
|
height: 20.0,
|
||||||
child: CircularProgressIndicator(value: _animation.value)
|
child: CircularProgressIndicator(value: _animation.value),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 20.0,
|
height: 20.0,
|
||||||
child: Text('${(_animation.value * 100.0).toStringAsFixed(1)}%',
|
child: Text('${(_animation.value * 100.0).toStringAsFixed(1)}%',
|
||||||
textAlign: TextAlign.right
|
textAlign: TextAlign.right,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -120,7 +120,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
|
||||||
child: AnimatedBuilder(
|
child: AnimatedBuilder(
|
||||||
animation: _animation,
|
animation: _animation,
|
||||||
builder: _buildIndicators
|
builder: _buildIndicators,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -141,15 +141,15 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
|
|||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<TabsDemoStyle>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<TabsDemoStyle>>[
|
||||||
const PopupMenuItem<TabsDemoStyle>(
|
const PopupMenuItem<TabsDemoStyle>(
|
||||||
value: TabsDemoStyle.iconsAndText,
|
value: TabsDemoStyle.iconsAndText,
|
||||||
child: Text('Icons and text')
|
child: Text('Icons and text'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<TabsDemoStyle>(
|
const PopupMenuItem<TabsDemoStyle>(
|
||||||
value: TabsDemoStyle.iconsOnly,
|
value: TabsDemoStyle.iconsOnly,
|
||||||
child: Text('Icons only')
|
child: Text('Icons only'),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<TabsDemoStyle>(
|
const PopupMenuItem<TabsDemoStyle>(
|
||||||
value: TabsDemoStyle.textOnly,
|
value: TabsDemoStyle.textOnly,
|
||||||
child: Text('Text only')
|
child: Text('Text only'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -193,7 +193,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList()
|
}).toList(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class _SearchDemoState extends State<SearchDemo> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 64.0),
|
const SizedBox(height: 64.0),
|
||||||
Text('Last selected integer: ${_lastIntegerSelected ?? 'NONE' }.')
|
Text('Last selected integer: ${_lastIntegerSelected ?? 'NONE' }.'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -219,7 +219,7 @@ class _SearchDemoSearchDelegate extends SearchDelegate<int> {
|
|||||||
query = '';
|
query = '';
|
||||||
showSuggestions(context);
|
showSuggestions(context);
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,12 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
|
|||||||
demoWidget: buildSwitch(),
|
demoWidget: buildSwitch(),
|
||||||
exampleCodeTag: _switchCode,
|
exampleCodeTag: _switchCode,
|
||||||
documentationUrl: 'https://docs.flutter.io/flutter/material/Switch-class.html',
|
documentationUrl: 'https://docs.flutter.io/flutter/material/Switch-class.html',
|
||||||
)
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
return TabbedComponentDemoScaffold(
|
return TabbedComponentDemoScaffold(
|
||||||
title: 'Selection controls',
|
title: 'Selection controls',
|
||||||
demos: demos
|
demos: demos,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,10 +122,10 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
|
|||||||
Checkbox(value: true, onChanged: null),
|
Checkbox(value: true, onChanged: null),
|
||||||
Checkbox(value: false, onChanged: null),
|
Checkbox(value: false, onChanged: null),
|
||||||
Checkbox(value: null, tristate: true, onChanged: null),
|
Checkbox(value: null, tristate: true, onChanged: null),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,19 +141,19 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
|
|||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 0,
|
value: 0,
|
||||||
groupValue: radioValue,
|
groupValue: radioValue,
|
||||||
onChanged: handleRadioValueChanged
|
onChanged: handleRadioValueChanged,
|
||||||
),
|
),
|
||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 1,
|
value: 1,
|
||||||
groupValue: radioValue,
|
groupValue: radioValue,
|
||||||
onChanged: handleRadioValueChanged
|
onChanged: handleRadioValueChanged,
|
||||||
),
|
),
|
||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 2,
|
value: 2,
|
||||||
groupValue: radioValue,
|
groupValue: radioValue,
|
||||||
onChanged: handleRadioValueChanged
|
onChanged: handleRadioValueChanged,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
// Disabled radio buttons
|
// Disabled radio buttons
|
||||||
Row(
|
Row(
|
||||||
@ -162,22 +162,22 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
|
|||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 0,
|
value: 0,
|
||||||
groupValue: 0,
|
groupValue: 0,
|
||||||
onChanged: null
|
onChanged: null,
|
||||||
),
|
),
|
||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 1,
|
value: 1,
|
||||||
groupValue: 0,
|
groupValue: 0,
|
||||||
onChanged: null
|
onChanged: null,
|
||||||
),
|
),
|
||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 2,
|
value: 2,
|
||||||
groupValue: 0,
|
groupValue: 0,
|
||||||
onChanged: null
|
onChanged: null,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
switchValue = value;
|
switchValue = value;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
// Disabled switches
|
// Disabled switches
|
||||||
const Switch.adaptive(value: true, onChanged: null),
|
const Switch.adaptive(value: true, onChanged: null),
|
||||||
|
@ -50,12 +50,12 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
|
|||||||
label: 'ACTION',
|
label: 'ACTION',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
Scaffold.of(context).showSnackBar(SnackBar(
|
||||||
content: Text('You pressed snackbar $thisSnackBarIndex\'s action.')
|
content: Text('You pressed snackbar $thisSnackBarIndex\'s action.'),
|
||||||
));
|
));
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Text(_text3),
|
const Text(_text3),
|
||||||
@ -63,10 +63,10 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
|
|||||||
.map<Widget>((Widget child) {
|
.map<Widget>((Widget child) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 12.0),
|
margin: const EdgeInsets.symmetric(vertical: 12.0),
|
||||||
child: child
|
child: child,
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.toList()
|
.toList(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
|
|||||||
// Create an inner BuildContext so that the snackBar onPressed methods
|
// Create an inner BuildContext so that the snackBar onPressed methods
|
||||||
// can refer to the Scaffold with Scaffold.of().
|
// can refer to the Scaffold with Scaffold.of().
|
||||||
builder: buildBody
|
builder: buildBody
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,8 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
|||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(32.0),
|
padding: const EdgeInsets.all(32.0),
|
||||||
child: Text(_explanatoryText, style: Theme.of(context).textTheme.subhead)
|
child: Text(_explanatoryText, style: Theme.of(context).textTheme.subhead),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -93,12 +93,12 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
|||||||
child: Text(page.label,
|
child: Text(page.label,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: page.labelColor,
|
color: page.labelColor,
|
||||||
fontSize: 32.0
|
fontSize: 32.0,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -115,7 +115,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
|||||||
backgroundColor: page.fabColor,
|
backgroundColor: page.fabColor,
|
||||||
icon: page.fabIcon,
|
icon: page.fabIcon,
|
||||||
label: Text(page.label.toUpperCase()),
|
label: Text(page.label.toUpperCase()),
|
||||||
onPressed: _showExplanatoryText
|
onPressed: _showExplanatoryText,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
|||||||
tooltip: 'Show explanation',
|
tooltip: 'Show explanation',
|
||||||
backgroundColor: page.fabColor,
|
backgroundColor: page.fabColor,
|
||||||
child: page.fabIcon,
|
child: page.fabIcon,
|
||||||
onPressed: _showExplanatoryText
|
onPressed: _showExplanatoryText,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
|||||||
floatingActionButton: buildFloatingActionButton(_selectedPage),
|
floatingActionButton: buildFloatingActionButton(_selectedPage),
|
||||||
body: TabBarView(
|
body: TabBarView(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
children: _allPages.map<Widget>(buildTabView).toList()
|
children: _allPages.map<Widget>(buildTabView).toList(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
|||||||
|
|
||||||
void showInSnackBar(String value) {
|
void showInSnackBar(String value) {
|
||||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||||
content: Text(value)
|
content: Text(value),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
|||||||
labelText: 'Salary',
|
labelText: 'Salary',
|
||||||
prefixText: '\$',
|
prefixText: '\$',
|
||||||
suffixText: 'USD',
|
suffixText: 'USD',
|
||||||
suffixStyle: TextStyle(color: Colors.green)
|
suffixStyle: TextStyle(color: Colors.green),
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
),
|
),
|
||||||
@ -288,7 +288,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
|||||||
const SizedBox(height: 24.0),
|
const SizedBox(height: 24.0),
|
||||||
Text(
|
Text(
|
||||||
'* indicates required field',
|
'* indicates required field',
|
||||||
style: Theme.of(context).textTheme.caption
|
style: Theme.of(context).textTheme.caption,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24.0),
|
const SizedBox(height: 24.0),
|
||||||
],
|
],
|
||||||
@ -305,7 +305,7 @@ class _UsNumberTextInputFormatter extends TextInputFormatter {
|
|||||||
@override
|
@override
|
||||||
TextEditingValue formatEditUpdate(
|
TextEditingValue formatEditUpdate(
|
||||||
TextEditingValue oldValue,
|
TextEditingValue oldValue,
|
||||||
TextEditingValue newValue
|
TextEditingValue newValue,
|
||||||
) {
|
) {
|
||||||
final int newTextLength = newValue.text.length;
|
final int newTextLength = newValue.text.length;
|
||||||
int selectionIndex = newValue.selection.end;
|
int selectionIndex = newValue.selection.end;
|
||||||
|
@ -39,11 +39,11 @@ class TooltipDemo extends StatelessWidget {
|
|||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.call,
|
Icons.call,
|
||||||
size: 18.0,
|
size: 18.0,
|
||||||
color: theme.iconTheme.color
|
color: theme.iconTheme.color,
|
||||||
)
|
|
||||||
),
|
),
|
||||||
Text(' icon.', style: theme.textTheme.subhead)
|
),
|
||||||
]
|
Text(' icon.', style: theme.textTheme.subhead),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
@ -53,23 +53,23 @@ class TooltipDemo extends StatelessWidget {
|
|||||||
tooltip: 'Place a phone call',
|
tooltip: 'Place a phone call',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Scaffold.of(context).showSnackBar(const SnackBar(
|
Scaffold.of(context).showSnackBar(const SnackBar(
|
||||||
content: Text('That was an ordinary tap.')
|
content: Text('That was an ordinary tap.'),
|
||||||
));
|
));
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
.map<Widget>((Widget widget) {
|
.map<Widget>((Widget widget) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
|
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
|
||||||
child: widget
|
child: widget,
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.toList()
|
.toList(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
|||||||
bottom: extraPadding,
|
bottom: extraPadding,
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0))
|
child: PestoLogo(height: logoHeight, t: t.clamp(0.0, 1.0)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -143,7 +143,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
|
|||||||
top: 8.0,
|
top: 8.0,
|
||||||
left: 8.0 + mediaPadding.left,
|
left: 8.0 + mediaPadding.left,
|
||||||
right: 8.0 + mediaPadding.right,
|
right: 8.0 + mediaPadding.right,
|
||||||
bottom: 8.0
|
bottom: 8.0,
|
||||||
);
|
);
|
||||||
return SliverPadding(
|
return SliverPadding(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
@ -206,7 +206,7 @@ class _PestoLogoState extends State<PestoLogo> {
|
|||||||
final TextStyle titleStyle = const PestoStyle(fontSize: kTextHeight, fontWeight: FontWeight.w900, color: Colors.white, letterSpacing: 3.0);
|
final TextStyle titleStyle = const PestoStyle(fontSize: kTextHeight, fontWeight: FontWeight.w900, color: Colors.white, letterSpacing: 3.0);
|
||||||
final RectTween _textRectTween = RectTween(
|
final RectTween _textRectTween = RectTween(
|
||||||
begin: Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight),
|
begin: Rect.fromLTWH(0.0, kLogoHeight, kLogoWidth, kTextHeight),
|
||||||
end: Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight)
|
end: Rect.fromLTWH(0.0, kImageHeight, kLogoWidth, kTextHeight),
|
||||||
);
|
);
|
||||||
final Curve _textOpacity = const Interval(0.4, 1.0, curve: Curves.easeInOut);
|
final Curve _textOpacity = const Interval(0.4, 1.0, curve: Curves.easeInOut);
|
||||||
final RectTween _imageRectTween = RectTween(
|
final RectTween _imageRectTween = RectTween(
|
||||||
@ -398,7 +398,7 @@ class _RecipePageState extends State<RecipePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -413,7 +413,7 @@ class _RecipePageState extends State<RecipePage> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 24.0),
|
padding: const EdgeInsets.only(right: 24.0),
|
||||||
child: Icon(icon, color: Colors.black54)
|
child: Icon(icon, color: Colors.black54),
|
||||||
),
|
),
|
||||||
Text(label, style: menuItemStyle),
|
Text(label, style: menuItemStyle),
|
||||||
],
|
],
|
||||||
@ -453,7 +453,7 @@ class RecipeSheet extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
|
||||||
child: Table(
|
child: Table(
|
||||||
columnWidths: const <int, TableColumnWidth>{
|
columnWidths: const <int, TableColumnWidth>{
|
||||||
0: FixedColumnWidth(64.0)
|
0: FixedColumnWidth(64.0),
|
||||||
},
|
},
|
||||||
children: <TableRow>[
|
children: <TableRow>[
|
||||||
TableRow(
|
TableRow(
|
||||||
@ -466,12 +466,12 @@ class RecipeSheet extends StatelessWidget {
|
|||||||
width: 32.0,
|
width: 32.0,
|
||||||
height: 32.0,
|
height: 32.0,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
fit: BoxFit.scaleDown
|
fit: BoxFit.scaleDown,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
TableCell(
|
TableCell(
|
||||||
verticalAlignment: TableCellVerticalAlignment.middle,
|
verticalAlignment: TableCellVerticalAlignment.middle,
|
||||||
child: Text(recipe.name, style: titleStyle)
|
child: Text(recipe.name, style: titleStyle),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
@ -480,7 +480,7 @@ class RecipeSheet extends StatelessWidget {
|
|||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
padding: const EdgeInsets.only(top: 8.0, bottom: 4.0),
|
||||||
child: Text(recipe.description, style: descriptionStyle)
|
child: Text(recipe.description, style: descriptionStyle),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
@ -489,7 +489,7 @@ class RecipeSheet extends StatelessWidget {
|
|||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
|
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
|
||||||
child: Text('Ingredients', style: headingStyle)
|
child: Text('Ingredients', style: headingStyle),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
@ -503,7 +503,7 @@ class RecipeSheet extends StatelessWidget {
|
|||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
|
padding: const EdgeInsets.only(top: 24.0, bottom: 4.0),
|
||||||
child: Text('Steps', style: headingStyle)
|
child: Text('Steps', style: headingStyle),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -544,7 +544,7 @@ class Recipe {
|
|||||||
this.ingredientsImagePath,
|
this.ingredientsImagePath,
|
||||||
this.ingredientsImagePackage,
|
this.ingredientsImagePackage,
|
||||||
this.ingredients,
|
this.ingredients,
|
||||||
this.steps
|
this.steps,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String name;
|
final String name;
|
||||||
@ -689,7 +689,7 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
|||||||
steps: <RecipeStep>[
|
steps: <RecipeStep>[
|
||||||
RecipeStep(duration: '10 min', description: 'Prep vegetables'),
|
RecipeStep(duration: '10 min', description: 'Prep vegetables'),
|
||||||
RecipeStep(duration: '5 min', description: 'Stir'),
|
RecipeStep(duration: '5 min', description: 'Stir'),
|
||||||
RecipeStep(duration: '1 hr 10 min', description: 'Cook')
|
RecipeStep(duration: '1 hr 10 min', description: 'Cook'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Recipe(
|
Recipe(
|
||||||
@ -712,7 +712,7 @@ const List<Recipe> kPestoRecipes = <Recipe>[
|
|||||||
RecipeStep(duration: '5 min', description: 'Sauté vegetables'),
|
RecipeStep(duration: '5 min', description: 'Sauté vegetables'),
|
||||||
RecipeStep(duration: '3 min', description: 'Stir vegetables and other filling ingredients'),
|
RecipeStep(duration: '3 min', description: 'Stir vegetables and other filling ingredients'),
|
||||||
RecipeStep(duration: '10 min', description: 'Fill phyllo squares half-full with filling and fold.'),
|
RecipeStep(duration: '10 min', description: 'Fill phyllo squares half-full with filling and fold.'),
|
||||||
RecipeStep(duration: '40 min', description: 'Bake')
|
RecipeStep(duration: '40 min', description: 'Bake'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -103,7 +103,7 @@ class _BackdropTitle extends AnimatedWidget {
|
|||||||
end: const Offset(1.0, 0.0),
|
end: const Offset(1.0, 0.0),
|
||||||
).evaluate(animation),
|
).evaluate(animation),
|
||||||
child: const ImageIcon(AssetImage('packages/shrine_images/diamond.png')),
|
child: const ImageIcon(AssetImage('packages/shrine_images/diamond.png')),
|
||||||
)
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -138,7 +138,7 @@ class _BackdropTitle extends AnimatedWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -609,7 +609,7 @@ class _ListModel {
|
|||||||
_ListModel({
|
_ListModel({
|
||||||
@required this.listKey,
|
@required this.listKey,
|
||||||
@required this.removedItemBuilder,
|
@required this.removedItemBuilder,
|
||||||
Iterable<int> initialItems
|
Iterable<int> initialItems,
|
||||||
}) : assert(listKey != null),
|
}) : assert(listKey != null),
|
||||||
assert(removedItemBuilder != null),
|
assert(removedItemBuilder != null),
|
||||||
_items = List<int>.from(initialItems ?? <int>[]);
|
_items = List<int>.from(initialItems ?? <int>[]);
|
||||||
|
@ -50,7 +50,7 @@ class HomePage extends StatelessWidget {
|
|||||||
return Stack(
|
return Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
backdrop,
|
backdrop,
|
||||||
Align(child: expandingBottomSheet, alignment: Alignment.bottomRight)
|
Align(child: expandingBottomSheet, alignment: Alignment.bottomRight),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
// home screen using onGenerateRoute and so rootNavigator must be
|
// home screen using onGenerateRoute and so rootNavigator must be
|
||||||
// set to true in order to get out of Shrine completely.
|
// set to true in order to get out of Shrine completely.
|
||||||
Navigator.of(context, rootNavigator: true).pop();
|
Navigator.of(context, rootNavigator: true).pop();
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
|
@ -30,13 +30,13 @@ class TextStyleItem extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 72.0,
|
width: 72.0,
|
||||||
child: Text(name, style: nameStyle)
|
child: Text(name, style: nameStyle),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(text, style: style.copyWith(height: 1.0))
|
child: Text(text, style: style.copyWith(height: 1.0)),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ class TypographyDemo extends StatelessWidget {
|
|||||||
styleItems.insert(0, TextStyleItem(
|
styleItems.insert(0, TextStyleItem(
|
||||||
name: 'Display 4',
|
name: 'Display 4',
|
||||||
style: textTheme.display4,
|
style: textTheme.display4,
|
||||||
text: 'Light 112sp'
|
text: 'Light 112sp',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ void showGalleryAboutDialog(BuildContext context) {
|
|||||||
'${defaultTargetPlatform == TargetPlatform.iOS ? 'multiple platforms' : 'iOS and Android'} '
|
'${defaultTargetPlatform == TargetPlatform.iOS ? 'multiple platforms' : 'iOS and Android'} '
|
||||||
'from a single codebase. This design lab is a playground '
|
'from a single codebase. This design lab is a playground '
|
||||||
"and showcase of Flutter's many widgets, behaviors, "
|
"and showcase of Flutter's many widgets, behaviors, "
|
||||||
'animations, layouts, and more. Learn more about Flutter at '
|
'animations, layouts, and more. Learn more about Flutter at ',
|
||||||
),
|
),
|
||||||
_LinkTextSpan(
|
_LinkTextSpan(
|
||||||
style: linkStyle,
|
style: linkStyle,
|
||||||
|
@ -282,7 +282,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
|||||||
child: widget.backLayer,
|
child: widget.backLayer,
|
||||||
visible: _controller.status != AnimationStatus.completed,
|
visible: _controller.status != AnimationStatus.completed,
|
||||||
maintainState: true,
|
maintainState: true,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -91,7 +91,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
|
|||||||
onPressed: () => _showExampleCode(context),
|
onPressed: () => _showExampleCode(context),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
@ -109,10 +109,10 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Text(demo.description,
|
child: Text(demo.description,
|
||||||
style: Theme.of(context).textTheme.subhead
|
style: Theme.of(context).textTheme.subhead,
|
||||||
)
|
|
||||||
),
|
),
|
||||||
Expanded(child: demo.demoWidget)
|
),
|
||||||
|
Expanded(child: demo.demoWidget),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -157,7 +157,7 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
|
|||||||
Widget body;
|
Widget body;
|
||||||
if (_exampleCode == null) {
|
if (_exampleCode == null) {
|
||||||
body = const Center(
|
body = const Center(
|
||||||
child: CircularProgressIndicator()
|
child: CircularProgressIndicator(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
body = SingleChildScrollView(
|
body = SingleChildScrollView(
|
||||||
@ -167,11 +167,11 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
|
|||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),
|
style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),
|
||||||
children: <TextSpan>[
|
children: <TextSpan>[
|
||||||
DartSyntaxHighlighter(style).format(_exampleCode)
|
DartSyntaxHighlighter(style).format(_exampleCode),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,11 +182,11 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
|
|||||||
Icons.clear,
|
Icons.clear,
|
||||||
semanticLabel: 'Close',
|
semanticLabel: 'Close',
|
||||||
),
|
),
|
||||||
onPressed: () { Navigator.pop(context); }
|
onPressed: () { Navigator.pop(context); },
|
||||||
),
|
),
|
||||||
title: const Text('Example code')
|
title: const Text('Example code'),
|
||||||
),
|
),
|
||||||
body: body
|
body: body,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ class MaterialDemoDocumentationButton extends StatelessWidget {
|
|||||||
return IconButton(
|
return IconButton(
|
||||||
icon: const Icon(Icons.library_books),
|
icon: const Icon(Icons.library_books),
|
||||||
tooltip: 'API documentation',
|
tooltip: 'API documentation',
|
||||||
onPressed: () => launch(documentationUrl, forceWebView: true)
|
onPressed: () => launch(documentationUrl, forceWebView: true),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ class CupertinoDemoDocumentationButton extends StatelessWidget {
|
|||||||
label: 'API documentation',
|
label: 'API documentation',
|
||||||
child: const Icon(CupertinoIcons.book),
|
child: const Icon(CupertinoIcons.book),
|
||||||
),
|
),
|
||||||
onPressed: () => launch(documentationUrl, forceWebView: true)
|
onPressed: () => launch(documentationUrl, forceWebView: true),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ RaisedButton(
|
|||||||
child: const Text('BUTTON TITLE'),
|
child: const Text('BUTTON TITLE'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Perform some action
|
// Perform some action
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create a disabled button.
|
// Create a disabled button.
|
||||||
@ -27,7 +27,7 @@ RaisedButton(
|
|||||||
// specified or is null.
|
// specified or is null.
|
||||||
const RaisedButton(
|
const RaisedButton(
|
||||||
child: Text('BUTTON TITLE'),
|
child: Text('BUTTON TITLE'),
|
||||||
onPressed: null
|
onPressed: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create a button with an icon and a
|
// Create a button with an icon and a
|
||||||
@ -47,7 +47,7 @@ OutlineButton(
|
|||||||
child: const Text('BUTTON TITLE'),
|
child: const Text('BUTTON TITLE'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Perform some action
|
// Perform some action
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create a disabled button.
|
// Create a disabled button.
|
||||||
@ -55,7 +55,7 @@ OutlineButton(
|
|||||||
// specified or is null.
|
// specified or is null.
|
||||||
const OutlineButton(
|
const OutlineButton(
|
||||||
child: Text('BUTTON TITLE'),
|
child: Text('BUTTON TITLE'),
|
||||||
onPressed: null
|
onPressed: null,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create a button with an icon and a
|
// Create a button with an icon and a
|
||||||
@ -75,7 +75,7 @@ FlatButton(
|
|||||||
child: const Text('BUTTON TITLE'),
|
child: const Text('BUTTON TITLE'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Perform some action
|
// Perform some action
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create a disabled button.
|
// Create a disabled button.
|
||||||
@ -83,7 +83,7 @@ FlatButton(
|
|||||||
// specified or is null.
|
// specified or is null.
|
||||||
const FlatButton(
|
const FlatButton(
|
||||||
child: Text('BUTTON TITLE'),
|
child: Text('BUTTON TITLE'),
|
||||||
onPressed: null
|
onPressed: null,
|
||||||
);
|
);
|
||||||
// END
|
// END
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ DropdownButton<String>(
|
|||||||
value: value,
|
value: value,
|
||||||
child: Text(value));
|
child: Text(value));
|
||||||
})
|
})
|
||||||
.toList()
|
.toList(),
|
||||||
);
|
);
|
||||||
// END
|
// END
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ IconButton(
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() => value = !value);
|
setState(() => value = !value);
|
||||||
},
|
},
|
||||||
color: value ? Theme.of(context).primaryColor : null
|
color: value ? Theme.of(context).primaryColor : null,
|
||||||
);
|
);
|
||||||
// END
|
// END
|
||||||
|
|
||||||
@ -133,12 +133,12 @@ IconButton(
|
|||||||
// Floating action button in Scaffold.
|
// Floating action button in Scaffold.
|
||||||
Scaffold(
|
Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Demo')
|
title: const Text('Demo'),
|
||||||
),
|
),
|
||||||
floatingActionButton: const FloatingActionButton(
|
floatingActionButton: const FloatingActionButton(
|
||||||
child: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
onPressed: null
|
onPressed: null,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
// END
|
// END
|
||||||
}
|
}
|
||||||
@ -199,26 +199,26 @@ Row(
|
|||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 0,
|
value: 0,
|
||||||
groupValue: radioValue,
|
groupValue: radioValue,
|
||||||
onChanged: handleRadioValueChanged
|
onChanged: handleRadioValueChanged,
|
||||||
),
|
),
|
||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 1,
|
value: 1,
|
||||||
groupValue: radioValue,
|
groupValue: radioValue,
|
||||||
onChanged: handleRadioValueChanged
|
onChanged: handleRadioValueChanged,
|
||||||
),
|
),
|
||||||
Radio<int>(
|
Radio<int>(
|
||||||
value: 2,
|
value: 2,
|
||||||
groupValue: radioValue,
|
groupValue: radioValue,
|
||||||
onChanged: handleRadioValueChanged
|
onChanged: handleRadioValueChanged,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
// Creates a disabled radio button.
|
// Creates a disabled radio button.
|
||||||
const Radio<int>(
|
const Radio<int>(
|
||||||
value: 0,
|
value: 0,
|
||||||
groupValue: 0,
|
groupValue: 0,
|
||||||
onChanged: null
|
onChanged: null,
|
||||||
);
|
);
|
||||||
// END
|
// END
|
||||||
|
|
||||||
@ -262,13 +262,13 @@ GridView.count(
|
|||||||
'https://example.com/image-1.jpg',
|
'https://example.com/image-1.jpg',
|
||||||
'https://example.com/image-2.jpg',
|
'https://example.com/image-2.jpg',
|
||||||
'...',
|
'...',
|
||||||
'https://example.com/image-n.jpg'
|
'https://example.com/image-n.jpg',
|
||||||
].map<Widget>((String url) {
|
].map<Widget>((String url) {
|
||||||
return GridTile(
|
return GridTile(
|
||||||
footer: GridTileBar(
|
footer: GridTileBar(
|
||||||
title: Text(url)
|
title: Text(url),
|
||||||
),
|
),
|
||||||
child: Image.network(url, fit: BoxFit.cover)
|
child: Image.network(url, fit: BoxFit.cover),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
);
|
);
|
||||||
|
@ -400,14 +400,14 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
|
|||||||
child: const Banner(
|
child: const Banner(
|
||||||
message: 'PREVIEW',
|
message: 'PREVIEW',
|
||||||
location: BannerLocation.topEnd,
|
location: BannerLocation.topEnd,
|
||||||
)
|
|
||||||
),
|
),
|
||||||
]
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
home = AnnotatedRegion<SystemUiOverlayStyle>(
|
home = AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
child: home,
|
child: home,
|
||||||
value: SystemUiOverlayStyle.light
|
value: SystemUiOverlayStyle.light,
|
||||||
);
|
);
|
||||||
|
|
||||||
return home;
|
return home;
|
||||||
|
@ -408,7 +408,7 @@ class GalleryOptionsPage extends StatelessWidget {
|
|||||||
options.showOffscreenLayersCheckerboard,
|
options.showOffscreenLayersCheckerboard,
|
||||||
(bool value) {
|
(bool value) {
|
||||||
onOptionsChanged(options.copyWith(showOffscreenLayersCheckerboard: value));
|
onOptionsChanged(options.copyWith(showOffscreenLayersCheckerboard: value));
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ class SyntaxHighlighterStyle {
|
|||||||
this.stringStyle,
|
this.stringStyle,
|
||||||
this.punctuationStyle,
|
this.punctuationStyle,
|
||||||
this.classStyle,
|
this.classStyle,
|
||||||
this.constantStyle
|
this.constantStyle,
|
||||||
});
|
});
|
||||||
|
|
||||||
static SyntaxHighlighterStyle lightThemeStyle() {
|
static SyntaxHighlighterStyle lightThemeStyle() {
|
||||||
@ -26,7 +26,7 @@ class SyntaxHighlighterStyle {
|
|||||||
stringStyle: const TextStyle(color: Color(0xFF43A047)),
|
stringStyle: const TextStyle(color: Color(0xFF43A047)),
|
||||||
punctuationStyle: const TextStyle(color: Color(0xFF000000)),
|
punctuationStyle: const TextStyle(color: Color(0xFF000000)),
|
||||||
classStyle: const TextStyle(color: Color(0xFF512DA8)),
|
classStyle: const TextStyle(color: Color(0xFF512DA8)),
|
||||||
constantStyle: const TextStyle(color: Color(0xFF795548))
|
constantStyle: const TextStyle(color: Color(0xFF795548)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class SyntaxHighlighterStyle {
|
|||||||
stringStyle: const TextStyle(color: Color(0xFF009688)),
|
stringStyle: const TextStyle(color: Color(0xFF009688)),
|
||||||
punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
|
punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
|
||||||
classStyle: const TextStyle(color: Color(0xFF009688)),
|
classStyle: const TextStyle(color: Color(0xFF009688)),
|
||||||
constantStyle: const TextStyle(color: Color(0xFF795548))
|
constantStyle: const TextStyle(color: Color(0xFF795548)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,11 +72,11 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library',
|
'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library',
|
||||||
'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static',
|
'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static',
|
||||||
'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var',
|
'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var',
|
||||||
'void', 'while', 'with', 'yield'
|
'void', 'while', 'with', 'yield',
|
||||||
];
|
];
|
||||||
|
|
||||||
static const List<String> _builtInTypes = <String>[
|
static const List<String> _builtInTypes = <String>[
|
||||||
'int', 'double', 'num', 'bool'
|
'int', 'double', 'num', 'bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
String _src;
|
String _src;
|
||||||
@ -125,7 +125,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.comment,
|
_HighlightType.comment,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.comment,
|
_HighlightType.comment,
|
||||||
startComment,
|
startComment,
|
||||||
endComment
|
endComment,
|
||||||
));
|
));
|
||||||
|
|
||||||
if (eof)
|
if (eof)
|
||||||
@ -160,7 +160,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.string,
|
_HighlightType.string,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.string,
|
_HighlightType.string,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.string,
|
_HighlightType.string,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.string,
|
_HighlightType.string,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.string,
|
_HighlightType.string,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.string,
|
_HighlightType.string,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.number,
|
_HighlightType.number,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.punctuation,
|
_HighlightType.punctuation,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
_HighlightType.keyword,
|
_HighlightType.keyword,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans.add(_HighlightSpan(
|
_spans.add(_HighlightSpan(
|
||||||
type,
|
type,
|
||||||
_scanner.lastMatch.start,
|
_scanner.lastMatch.start,
|
||||||
_scanner.lastMatch.end
|
_scanner.lastMatch.end,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
|||||||
_spans[i] = _HighlightSpan(
|
_spans[i] = _HighlightSpan(
|
||||||
_spans[i].type,
|
_spans[i].type,
|
||||||
_spans[i].start,
|
_spans[i].start,
|
||||||
_spans[i + 1].end
|
_spans[i + 1].end,
|
||||||
);
|
);
|
||||||
_spans.removeAt(i + 1);
|
_spans.removeAt(i + 1);
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ void main() {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 450.0,
|
width: 450.0,
|
||||||
height: 800.0,
|
height: 800.0,
|
||||||
child: GalleryApp(testMode: true)
|
child: GalleryApp(testMode: true),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
||||||
|
@ -20,7 +20,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
const GalleryApp(
|
const GalleryApp(
|
||||||
testMode: true,
|
testMode: true,
|
||||||
updateUrlFetcher: mockUpdateUrlFetcher
|
updateUrlFetcher: mockUpdateUrlFetcher,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
||||||
|
@ -65,7 +65,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
|
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
|
||||||
style: const TextStyle(fontSize: 17.0))
|
style: const TextStyle(fontSize: 17.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
@ -24,7 +24,7 @@ void beginFrame(Duration timeStamp) {
|
|||||||
canvas.scale(devicePixelRatio, devicePixelRatio);
|
canvas.scale(devicePixelRatio, devicePixelRatio);
|
||||||
canvas.drawParagraph(paragraph, ui.Offset(
|
canvas.drawParagraph(paragraph, ui.Offset(
|
||||||
(logicalSize.width - paragraph.maxIntrinsicWidth) / 2.0,
|
(logicalSize.width - paragraph.maxIntrinsicWidth) / 2.0,
|
||||||
(logicalSize.height - paragraph.height) / 2.0
|
(logicalSize.height - paragraph.height) / 2.0,
|
||||||
));
|
));
|
||||||
final ui.Picture picture = recorder.endRecording();
|
final ui.Picture picture = recorder.endRecording();
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ ui.Picture paint(ui.Rect paintBounds) {
|
|||||||
canvas.drawCircle(
|
canvas.drawCircle(
|
||||||
size.center(ui.Offset.zero),
|
size.center(ui.Offset.zero),
|
||||||
size.shortestSide * 0.45,
|
size.shortestSide * 0.45,
|
||||||
ui.Paint()..color = color
|
ui.Paint()..color = color,
|
||||||
);
|
);
|
||||||
|
|
||||||
// When we're done issuing painting commands, we end the recording an receive
|
// When we're done issuing painting commands, we end the recording an receive
|
||||||
|
@ -24,6 +24,6 @@ void main() {
|
|||||||
// particular text direction.
|
// particular text direction.
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ void main() {
|
|||||||
// to have a specific size.
|
// to have a specific size.
|
||||||
final RenderBox square = RenderConstrainedBox(
|
final RenderBox square = RenderConstrainedBox(
|
||||||
additionalConstraints: const BoxConstraints.tightFor(width: 200.0, height: 200.0),
|
additionalConstraints: const BoxConstraints.tightFor(width: 200.0, height: 200.0),
|
||||||
child: green
|
child: green,
|
||||||
);
|
);
|
||||||
// Third, we wrap the sized green square in a render object that applies rotation
|
// Third, we wrap the sized green square in a render object that applies rotation
|
||||||
// transform before painting its child. Each frame of the animation, we'll
|
// transform before painting its child. Each frame of the animation, we'll
|
||||||
@ -35,12 +35,12 @@ void main() {
|
|||||||
final RenderTransform spin = RenderTransform(
|
final RenderTransform spin = RenderTransform(
|
||||||
transform: Matrix4.identity(),
|
transform: Matrix4.identity(),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: square
|
child: square,
|
||||||
);
|
);
|
||||||
// Finally, we center the spinning green square...
|
// Finally, we center the spinning green square...
|
||||||
final RenderBox root = RenderPositionedBox(
|
final RenderBox root = RenderPositionedBox(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: spin
|
child: spin,
|
||||||
);
|
);
|
||||||
// and attach it to the window.
|
// and attach it to the window.
|
||||||
RenderingFlutterBinding(root: root);
|
RenderingFlutterBinding(root: root);
|
||||||
|
@ -14,7 +14,7 @@ class SectorConstraints extends Constraints {
|
|||||||
this.minDeltaRadius = 0.0,
|
this.minDeltaRadius = 0.0,
|
||||||
this.maxDeltaRadius = double.infinity,
|
this.maxDeltaRadius = double.infinity,
|
||||||
this.minDeltaTheta = 0.0,
|
this.minDeltaTheta = 0.0,
|
||||||
this.maxDeltaTheta = kTwoPi
|
this.maxDeltaTheta = kTwoPi,
|
||||||
}) : assert(maxDeltaRadius >= minDeltaRadius),
|
}) : assert(maxDeltaRadius >= minDeltaRadius),
|
||||||
assert(maxDeltaTheta >= minDeltaTheta);
|
assert(maxDeltaTheta >= minDeltaTheta);
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class SectorConstraints extends Constraints {
|
|||||||
@override
|
@override
|
||||||
bool debugAssertIsValid({
|
bool debugAssertIsValid({
|
||||||
bool isAppliedConstraint = false,
|
bool isAppliedConstraint = false,
|
||||||
InformationCollector informationCollector
|
InformationCollector informationCollector,
|
||||||
}) {
|
}) {
|
||||||
assert(isNormalized);
|
assert(isNormalized);
|
||||||
return isNormalized;
|
return isNormalized;
|
||||||
@ -58,11 +58,11 @@ class SectorDimensions {
|
|||||||
|
|
||||||
factory SectorDimensions.withConstraints(
|
factory SectorDimensions.withConstraints(
|
||||||
SectorConstraints constraints,
|
SectorConstraints constraints,
|
||||||
{ double deltaRadius = 0.0, double deltaTheta = 0.0 }
|
{ double deltaRadius = 0.0, double deltaTheta = 0.0, }
|
||||||
) {
|
) {
|
||||||
return SectorDimensions(
|
return SectorDimensions(
|
||||||
deltaRadius: constraints.constrainDeltaRadius(deltaRadius),
|
deltaRadius: constraints.constrainDeltaRadius(deltaRadius),
|
||||||
deltaTheta: constraints.constrainDeltaTheta(deltaTheta)
|
deltaTheta: constraints.constrainDeltaTheta(deltaTheta),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
|||||||
RenderSectorRing({
|
RenderSectorRing({
|
||||||
BoxDecoration decoration,
|
BoxDecoration decoration,
|
||||||
double deltaRadius = double.infinity,
|
double deltaRadius = double.infinity,
|
||||||
double padding = 0.0
|
double padding = 0.0,
|
||||||
}) : _padding = padding,
|
}) : _padding = padding,
|
||||||
assert(deltaRadius >= 0.0),
|
assert(deltaRadius >= 0.0),
|
||||||
_desiredDeltaRadius = deltaRadius,
|
_desiredDeltaRadius = deltaRadius,
|
||||||
@ -263,7 +263,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
|||||||
while (child != null) {
|
while (child != null) {
|
||||||
final SectorConstraints innerConstraints = SectorConstraints(
|
final SectorConstraints innerConstraints = SectorConstraints(
|
||||||
maxDeltaRadius: innerDeltaRadius,
|
maxDeltaRadius: innerDeltaRadius,
|
||||||
maxDeltaTheta: remainingDeltaTheta
|
maxDeltaTheta: remainingDeltaTheta,
|
||||||
);
|
);
|
||||||
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
|
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
|
||||||
innerTheta += childDimensions.deltaTheta;
|
innerTheta += childDimensions.deltaTheta;
|
||||||
@ -294,7 +294,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
|||||||
while (child != null) {
|
while (child != null) {
|
||||||
final SectorConstraints innerConstraints = SectorConstraints(
|
final SectorConstraints innerConstraints = SectorConstraints(
|
||||||
maxDeltaRadius: innerDeltaRadius,
|
maxDeltaRadius: innerDeltaRadius,
|
||||||
maxDeltaTheta: remainingDeltaTheta
|
maxDeltaTheta: remainingDeltaTheta,
|
||||||
);
|
);
|
||||||
assert(child.parentData is SectorParentData);
|
assert(child.parentData is SectorParentData);
|
||||||
child.parentData.theta = innerTheta;
|
child.parentData.theta = innerTheta;
|
||||||
@ -334,7 +334,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
|||||||
RenderSectorSlice({
|
RenderSectorSlice({
|
||||||
BoxDecoration decoration,
|
BoxDecoration decoration,
|
||||||
double deltaTheta = kTwoPi,
|
double deltaTheta = kTwoPi,
|
||||||
double padding = 0.0
|
double padding = 0.0,
|
||||||
}) : _padding = padding, _desiredDeltaTheta = deltaTheta, super(decoration);
|
}) : _padding = padding, _desiredDeltaTheta = deltaTheta, super(decoration);
|
||||||
|
|
||||||
double _desiredDeltaTheta;
|
double _desiredDeltaTheta;
|
||||||
@ -377,7 +377,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
|||||||
while (child != null) {
|
while (child != null) {
|
||||||
final SectorConstraints innerConstraints = SectorConstraints(
|
final SectorConstraints innerConstraints = SectorConstraints(
|
||||||
maxDeltaRadius: remainingDeltaRadius,
|
maxDeltaRadius: remainingDeltaRadius,
|
||||||
maxDeltaTheta: innerDeltaTheta
|
maxDeltaTheta: innerDeltaTheta,
|
||||||
);
|
);
|
||||||
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
|
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
|
||||||
childRadius += childDimensions.deltaRadius;
|
childRadius += childDimensions.deltaRadius;
|
||||||
@ -406,7 +406,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
|||||||
while (child != null) {
|
while (child != null) {
|
||||||
final SectorConstraints innerConstraints = SectorConstraints(
|
final SectorConstraints innerConstraints = SectorConstraints(
|
||||||
maxDeltaRadius: remainingDeltaRadius,
|
maxDeltaRadius: remainingDeltaRadius,
|
||||||
maxDeltaTheta: innerDeltaTheta
|
maxDeltaTheta: innerDeltaTheta,
|
||||||
);
|
);
|
||||||
child.parentData.theta = innerTheta;
|
child.parentData.theta = innerTheta;
|
||||||
child.parentData.radius = childRadius;
|
child.parentData.radius = childRadius;
|
||||||
@ -488,7 +488,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
|
|||||||
|
|
||||||
Size getIntrinsicDimensions({
|
Size getIntrinsicDimensions({
|
||||||
double width = double.infinity,
|
double width = double.infinity,
|
||||||
double height = double.infinity
|
double height = double.infinity,
|
||||||
}) {
|
}) {
|
||||||
assert(child is RenderSector);
|
assert(child is RenderSector);
|
||||||
assert(child.parentData is SectorParentData);
|
assert(child.parentData is SectorParentData);
|
||||||
@ -556,7 +556,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
|
|||||||
class RenderSolidColor extends RenderDecoratedSector {
|
class RenderSolidColor extends RenderDecoratedSector {
|
||||||
RenderSolidColor(this.backgroundColor, {
|
RenderSolidColor(this.backgroundColor, {
|
||||||
this.desiredDeltaRadius = double.infinity,
|
this.desiredDeltaRadius = double.infinity,
|
||||||
this.desiredDeltaTheta = kTwoPi
|
this.desiredDeltaTheta = kTwoPi,
|
||||||
}) : super(BoxDecoration(color: backgroundColor));
|
}) : super(BoxDecoration(color: backgroundColor));
|
||||||
|
|
||||||
double desiredDeltaRadius;
|
double desiredDeltaRadius;
|
||||||
|
@ -183,7 +183,7 @@ class CalculationManager {
|
|||||||
sender.send(<double>[ completed, total ]);
|
sender.send(<double>[ completed, total ]);
|
||||||
},
|
},
|
||||||
onResultListener: sender.send,
|
onResultListener: sender.send,
|
||||||
data: message.data
|
data: message.data,
|
||||||
);
|
);
|
||||||
calculator.run();
|
calculator.run();
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
|||||||
)..repeat();
|
)..repeat();
|
||||||
_calculationManager = CalculationManager(
|
_calculationManager = CalculationManager(
|
||||||
onProgressListener: _handleProgressUpdate,
|
onProgressListener: _handleProgressUpdate,
|
||||||
onResultListener: _handleResult
|
onResultListener: _handleResult,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,24 +243,24 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
|||||||
width: 120.0,
|
width: 120.0,
|
||||||
height: 120.0,
|
height: 120.0,
|
||||||
color: const Color(0xFF882222),
|
color: const Color(0xFF882222),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Opacity(
|
Opacity(
|
||||||
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
|
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
value: _progress
|
value: _progress
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Text(_status),
|
Text(_status),
|
||||||
Center(
|
Center(
|
||||||
child: RaisedButton(
|
child: RaisedButton(
|
||||||
child: Text(_label),
|
child: Text(_label),
|
||||||
onPressed: _handleButtonPressed
|
onPressed: _handleButtonPressed,
|
||||||
)
|
),
|
||||||
|
),
|
||||||
|
Text(_result),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Text(_result)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class _GesturePainter extends CustomPainter {
|
|||||||
this.scaleEnabled,
|
this.scaleEnabled,
|
||||||
this.tapEnabled,
|
this.tapEnabled,
|
||||||
this.doubleTapEnabled,
|
this.doubleTapEnabled,
|
||||||
this.longPressEnabled
|
this.longPressEnabled,
|
||||||
});
|
});
|
||||||
|
|
||||||
final double zoom;
|
final double zoom;
|
||||||
@ -159,9 +159,9 @@ class GestureDemoState extends State<GestureDemo> {
|
|||||||
scaleEnabled: _scaleEnabled,
|
scaleEnabled: _scaleEnabled,
|
||||||
tapEnabled: _tapEnabled,
|
tapEnabled: _tapEnabled,
|
||||||
doubleTapEnabled: _doubleTapEnabled,
|
doubleTapEnabled: _doubleTapEnabled,
|
||||||
longPressEnabled: _longPressEnabled
|
longPressEnabled: _longPressEnabled,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 0.0,
|
bottom: 0.0,
|
||||||
@ -175,45 +175,45 @@ class GestureDemoState extends State<GestureDemo> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: _scaleEnabled,
|
value: _scaleEnabled,
|
||||||
onChanged: (bool value) { setState(() { _scaleEnabled = value; }); }
|
onChanged: (bool value) { setState(() { _scaleEnabled = value; }); },
|
||||||
),
|
),
|
||||||
const Text('Scale'),
|
const Text('Scale'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: _tapEnabled,
|
value: _tapEnabled,
|
||||||
onChanged: (bool value) { setState(() { _tapEnabled = value; }); }
|
onChanged: (bool value) { setState(() { _tapEnabled = value; }); },
|
||||||
),
|
),
|
||||||
const Text('Tap'),
|
const Text('Tap'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: _doubleTapEnabled,
|
value: _doubleTapEnabled,
|
||||||
onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); }
|
onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); },
|
||||||
),
|
),
|
||||||
const Text('Double Tap'),
|
const Text('Double Tap'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Checkbox(
|
Checkbox(
|
||||||
value: _longPressEnabled,
|
value: _longPressEnabled,
|
||||||
onChanged: (bool value) { setState(() { _longPressEnabled = value; }); }
|
onChanged: (bool value) { setState(() { _longPressEnabled = value; }); },
|
||||||
),
|
),
|
||||||
const Text('Long Press'),
|
const Text('Long Press'),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
crossAxisAlignment: CrossAxisAlignment.start
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
]
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ void main() {
|
|||||||
theme: ThemeData.dark(),
|
theme: ThemeData.dark(),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(title: const Text('Gestures Demo')),
|
appBar: AppBar(title: const Text('Gestures Demo')),
|
||||||
body: GestureDemo()
|
body: GestureDemo(),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ class AdaptedListItem extends StatelessWidget {
|
|||||||
margin: const EdgeInsets.all(8.0),
|
margin: const EdgeInsets.all(8.0),
|
||||||
color: Colors.lightBlueAccent.shade100,
|
color: Colors.lightBlueAccent.shade100,
|
||||||
),
|
),
|
||||||
Text(name)
|
Text(name),
|
||||||
]
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,24 +38,24 @@ class AdaptedGridItem extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.lightBlueAccent.shade100,
|
color: Colors.lightBlueAccent.shade100,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 8.0),
|
margin: const EdgeInsets.only(left: 8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(name)
|
child: Text(name),
|
||||||
),
|
),
|
||||||
const IconButton(
|
const IconButton(
|
||||||
icon: Icon(Icons.more_vert),
|
icon: Icon(Icons.more_vert),
|
||||||
onPressed: null
|
onPressed: null,
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,9 +99,9 @@ void main() {
|
|||||||
title: 'Media Query Example',
|
title: 'Media Query Example',
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Media Query Example')
|
title: const Text('Media Query Example'),
|
||||||
|
),
|
||||||
|
body: Material(child: AdaptiveContainer(names: _kNames)),
|
||||||
),
|
),
|
||||||
body: Material(child: AdaptiveContainer(names: _kNames))
|
|
||||||
)
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import '../rendering/src/sector_layout.dart';
|
|||||||
RenderBox initCircle() {
|
RenderBox initCircle() {
|
||||||
return RenderBoxToRenderSectorAdapter(
|
return RenderBoxToRenderSectorAdapter(
|
||||||
innerRadius: 25.0,
|
innerRadius: 25.0,
|
||||||
child: RenderSectorRing(padding: 0.0)
|
child: RenderSectorRing(padding: 0.0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ class SectorAppState extends State<SectorApp> {
|
|||||||
ring.add(RenderSolidColor(color, desiredDeltaTheta: kTwoPi * 0.2));
|
ring.add(RenderSolidColor(color, desiredDeltaTheta: kTwoPi * 0.2));
|
||||||
return RenderBoxToRenderSectorAdapter(
|
return RenderBoxToRenderSectorAdapter(
|
||||||
innerRadius: 5.0,
|
innerRadius: 5.0,
|
||||||
child: ring
|
child: ring,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
RenderBoxToRenderSectorAdapter sectorAddIcon = initSector(const Color(0xFF00DD00));
|
RenderBoxToRenderSectorAdapter sectorAddIcon = initSector(const Color(0xFF00DD00));
|
||||||
@ -104,12 +104,12 @@ class SectorAppState extends State<SectorApp> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
margin: const EdgeInsets.only(right: 10.0),
|
margin: const EdgeInsets.only(right: 10.0),
|
||||||
child: WidgetToRenderBoxAdapter(renderBox: sectorAddIcon)
|
child: WidgetToRenderBoxAdapter(renderBox: sectorAddIcon),
|
||||||
),
|
),
|
||||||
const Text('ADD SECTOR'),
|
const Text('ADD SECTOR'),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
onPressed: _enabledRemove ? removeSector : null,
|
onPressed: _enabledRemove ? removeSector : null,
|
||||||
@ -119,16 +119,16 @@ class SectorAppState extends State<SectorApp> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
margin: const EdgeInsets.only(right: 10.0),
|
margin: const EdgeInsets.only(right: 10.0),
|
||||||
child: WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon)
|
child: WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon),
|
||||||
),
|
),
|
||||||
const Text('REMOVE SECTOR'),
|
const Text('REMOVE SECTOR'),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -139,12 +139,12 @@ class SectorAppState extends State<SectorApp> {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: WidgetToRenderBoxAdapter(
|
child: WidgetToRenderBoxAdapter(
|
||||||
renderBox: sectors,
|
renderBox: sectors,
|
||||||
onBuild: doUpdates
|
onBuild: doUpdates,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,10 +155,10 @@ class SectorAppState extends State<SectorApp> {
|
|||||||
title: 'Sector Layout',
|
title: 'Sector Layout',
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Sector Layout in a Widget Tree')
|
title: const Text('Sector Layout in a Widget Tree'),
|
||||||
|
),
|
||||||
|
body: buildBody(),
|
||||||
),
|
),
|
||||||
body: buildBody()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class Rectangle extends StatelessWidget {
|
|||||||
return Expanded(
|
return Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: color,
|
color: color,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class _SpinningSquareState extends State<SpinningSquare> with SingleTickerProvid
|
|||||||
width: 200.0,
|
width: 200.0,
|
||||||
height: 200.0,
|
height: 200.0,
|
||||||
color: const Color(0xFF00FF00),
|
color: const Color(0xFF00FF00),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ const TextStyle _kBold = TextStyle(fontWeight: FontWeight.bold);
|
|||||||
const TextStyle _kUnderline = TextStyle(
|
const TextStyle _kUnderline = TextStyle(
|
||||||
decoration: TextDecoration.underline,
|
decoration: TextDecoration.underline,
|
||||||
decorationColor: Color(0xFF000000),
|
decorationColor: Color(0xFF000000),
|
||||||
decorationStyle: TextDecorationStyle.wavy
|
decorationStyle: TextDecorationStyle.wavy,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget toStyledText(String name, String text) {
|
Widget toStyledText(String name, String text) {
|
||||||
@ -44,14 +44,14 @@ Widget toStyledText(String name, String text) {
|
|||||||
children: <TextSpan>[
|
children: <TextSpan>[
|
||||||
TextSpan(
|
TextSpan(
|
||||||
style: _kUnderline,
|
style: _kUnderline,
|
||||||
text: name
|
text: name,
|
||||||
),
|
),
|
||||||
const TextSpan(text: ':')
|
const TextSpan(text: ':'),
|
||||||
]
|
],
|
||||||
|
),
|
||||||
|
TextSpan(text: text),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
TextSpan(text: text)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ class SpeakerSeparator extends StatelessWidget {
|
|||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
|
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,9 +112,9 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: children,
|
children: children,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,12 +124,12 @@ void main() {
|
|||||||
theme: ThemeData.light(),
|
theme: ThemeData.light(),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Hal and Dave')
|
title: const Text('Hal and Dave'),
|
||||||
),
|
),
|
||||||
body: Material(
|
body: Material(
|
||||||
color: Colors.grey.shade50,
|
color: Colors.grey.shade50,
|
||||||
child: StyledTextDemo()
|
child: StyledTextDemo(),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
static _notInlinedMessages(_) => <String, Function> {
|
static _notInlinedMessages(_) => <String, Function> {
|
||||||
"market" : MessageLookupByLibrary.simpleMessage("MARKET"),
|
"market" : MessageLookupByLibrary.simpleMessage("MARKET"),
|
||||||
"portfolio" : MessageLookupByLibrary.simpleMessage("PORTFOLIO"),
|
"portfolio" : MessageLookupByLibrary.simpleMessage("PORTFOLIO"),
|
||||||
"title" : MessageLookupByLibrary.simpleMessage("Stocks")
|
"title" : MessageLookupByLibrary.simpleMessage("Stocks"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
static _notInlinedMessages(_) => <String, Function> {
|
static _notInlinedMessages(_) => <String, Function> {
|
||||||
"market" : MessageLookupByLibrary.simpleMessage("MERCADO"),
|
"market" : MessageLookupByLibrary.simpleMessage("MERCADO"),
|
||||||
"portfolio" : MessageLookupByLibrary.simpleMessage("CARTERA"),
|
"portfolio" : MessageLookupByLibrary.simpleMessage("CARTERA"),
|
||||||
"title" : MessageLookupByLibrary.simpleMessage("Acciones")
|
"title" : MessageLookupByLibrary.simpleMessage("Acciones"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user