Skip to content

Commit a7dd769

Browse files
authored
Update obsolete button refs in plugin examples (flutter#3395)
1 parent 1b7afc5 commit a7dd769

File tree

72 files changed

+296
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+296
-205
lines changed

packages/android_alarm_manager/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.5+20
2+
3+
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
4+
15
## 0.4.5+19
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/android_alarm_manager/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class _AlarmHomePageState extends State<_AlarmHomePage> {
131131
),
132132
],
133133
),
134-
RaisedButton(
134+
ElevatedButton(
135135
child: Text(
136136
'Schedule OneShot Alarm',
137137
),

packages/android_alarm_manager/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Flutter plugin for accessing the Android AlarmManager service, and
44
# 0.4.y+z is compatible with 1.0.0, if you land a breaking change bump
55
# the version to 2.0.0.
66
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
7-
version: 0.4.5+19
7+
version: 0.4.5+20
88
homepage: https://github.com/flutter/plugins/tree/master/packages/android_alarm_manager
99

1010
dependencies:

packages/android_intent/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.0-nullsafety.2
2+
3+
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
4+
15
## 2.0.0-nullsafety.1
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/android_intent/example/lib/main.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class MyHomePage extends StatelessWidget {
5959
child: Column(
6060
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
6161
children: <Widget>[
62-
RaisedButton(
62+
ElevatedButton(
6363
child: const Text(
6464
'Tap here to set an alarm\non weekdays at 9:30pm.'),
6565
onPressed: _createAlarm,
6666
),
67-
RaisedButton(
67+
ElevatedButton(
6868
child: const Text('Tap here to test explicit intents.'),
6969
onPressed: () => _openExplicitIntentsView(context)),
7070
],
@@ -166,40 +166,40 @@ class ExplicitIntentsWidget extends StatelessWidget {
166166
child: Column(
167167
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
168168
children: <Widget>[
169-
RaisedButton(
169+
ElevatedButton(
170170
child: const Text(
171171
'Tap here to display panorama\nimagery in Google Street View.'),
172172
onPressed: _openGoogleMapsStreetView,
173173
),
174-
RaisedButton(
174+
ElevatedButton(
175175
child: const Text('Tap here to display\na map in Google Maps.'),
176176
onPressed: _displayMapInGoogleMaps,
177177
),
178-
RaisedButton(
178+
ElevatedButton(
179179
child: const Text(
180180
'Tap here to launch turn-by-turn\nnavigation in Google Maps.'),
181181
onPressed: _launchTurnByTurnNavigationInGoogleMaps,
182182
),
183-
RaisedButton(
183+
ElevatedButton(
184184
child: const Text('Tap here to open link in Google Chrome.'),
185185
onPressed: _openLinkInGoogleChrome,
186186
),
187-
RaisedButton(
187+
ElevatedButton(
188188
child: const Text('Tap here to start activity in new task.'),
189189
onPressed: _startActivityInNewTask,
190190
),
191-
RaisedButton(
191+
ElevatedButton(
192192
child: const Text(
193193
'Tap here to test explicit intent fallback to implicit.'),
194194
onPressed: _testExplicitIntentFallback,
195195
),
196-
RaisedButton(
196+
ElevatedButton(
197197
child: const Text(
198198
'Tap here to open Location Settings Configuration',
199199
),
200200
onPressed: _openLocationSettingsConfiguration,
201201
),
202-
RaisedButton(
202+
ElevatedButton(
203203
child: const Text(
204204
'Tap here to open Application Details',
205205
),

packages/android_intent/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: android_intent
22
description: Flutter plugin for launching Android Intents. Not supported on iOS.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/android_intent
4-
version: 2.0.0-nullsafety.1
4+
version: 2.0.0-nullsafety.2
55

66
flutter:
77
plugin:

packages/battery/battery/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.11
2+
3+
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
4+
15
## 1.0.10
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/battery/battery/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class _MyHomePageState extends State<MyHomePage> {
7171
builder: (_) => AlertDialog(
7272
content: Text('Battery: $batteryLevel%'),
7373
actions: <Widget>[
74-
FlatButton(
74+
TextButton(
7575
child: const Text('OK'),
7676
onPressed: () {
7777
Navigator.pop(context);

packages/battery/battery/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: battery
22
description: Flutter plugin for accessing information about the battery state
33
(full, charging, discharging) on Android and iOS.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/battery/battery
5-
version: 1.0.10
5+
version: 1.0.11
66

77
flutter:
88
plugin:

packages/camera/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.4+5
2+
3+
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
4+
15
## 0.6.4+4
26

37
* Set camera auto focus enabled by default.

packages/camera/camera/example/lib/main.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,16 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
313313
}
314314

315315
Widget _exposureModeControlRowWidget() {
316+
final ButtonStyle styleAuto = TextButton.styleFrom(
317+
primary: controller?.value?.exposureMode == ExposureMode.auto
318+
? Colors.orange
319+
: Colors.blue,
320+
);
321+
final ButtonStyle styleLocked = TextButton.styleFrom(
322+
primary: controller?.value?.exposureMode == ExposureMode.locked
323+
? Colors.orange
324+
: Colors.blue,
325+
);
316326
return SizeTransition(
317327
sizeFactor: _exposureModeControlRowAnimation,
318328
child: ClipRect(
@@ -327,12 +337,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
327337
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
328338
mainAxisSize: MainAxisSize.max,
329339
children: [
330-
FlatButton(
340+
TextButton(
331341
child: Text('AUTO'),
332-
textColor:
333-
controller?.value?.exposureMode == ExposureMode.auto
334-
? Colors.orange
335-
: Colors.blue,
342+
style: styleAuto,
336343
onPressed: controller != null
337344
? () =>
338345
onSetExposureModeButtonPressed(ExposureMode.auto)
@@ -342,12 +349,9 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
342349
showInSnackBar('Resetting exposure point');
343350
},
344351
),
345-
FlatButton(
352+
TextButton(
346353
child: Text('LOCKED'),
347-
textColor:
348-
controller?.value?.exposureMode == ExposureMode.locked
349-
? Colors.orange
350-
: Colors.blue,
354+
style: styleLocked,
351355
onPressed: controller != null
352356
? () =>
353357
onSetExposureModeButtonPressed(ExposureMode.locked)

packages/camera/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
44
and streaming image buffers to dart.
5-
version: 0.6.4+4
5+
version: 0.6.4+5
66
homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera
77

88
dependencies:

packages/file_selector/file_selector/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.7.0+2
2+
3+
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
4+
15
## 0.7.0+1
26

37
* Update Flutter SDK constraint.

packages/file_selector/file_selector/example/lib/get_directory_page.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ class GetDirectoryPage extends StatelessWidget {
2424
child: Column(
2525
mainAxisAlignment: MainAxisAlignment.center,
2626
children: <Widget>[
27-
RaisedButton(
28-
color: Colors.blue,
29-
textColor: Colors.white,
27+
ElevatedButton(
28+
style: ElevatedButton.styleFrom(
29+
primary: Colors.blue,
30+
onPrimary: Colors.white,
31+
),
3032
child: Text('Press to ask user to choose a directory'),
3133
onPressed: () => _getDirectoryPath(context),
3234
),
@@ -55,7 +57,7 @@ class TextDisplay extends StatelessWidget {
5557
),
5658
),
5759
actions: [
58-
FlatButton(
60+
TextButton(
5961
child: const Text('Close'),
6062
onPressed: () => Navigator.pop(context),
6163
),

packages/file_selector/file_selector/example/lib/home_page.dart

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import 'package:flutter/material.dart';
44
class HomePage extends StatelessWidget {
55
@override
66
Widget build(BuildContext context) {
7+
final ButtonStyle style = ElevatedButton.styleFrom(
8+
primary: Colors.blue,
9+
onPrimary: Colors.white,
10+
);
711
return Scaffold(
812
appBar: AppBar(
913
title: Text('File Selector Demo Home Page'),
@@ -12,37 +16,32 @@ class HomePage extends StatelessWidget {
1216
child: Column(
1317
mainAxisAlignment: MainAxisAlignment.center,
1418
children: <Widget>[
15-
RaisedButton(
16-
color: Colors.blue,
17-
textColor: Colors.white,
19+
ElevatedButton(
20+
style: style,
1821
child: Text('Open a text file'),
1922
onPressed: () => Navigator.pushNamed(context, '/open/text'),
2023
),
2124
SizedBox(height: 10),
22-
RaisedButton(
23-
color: Colors.blue,
24-
textColor: Colors.white,
25+
ElevatedButton(
26+
style: style,
2527
child: Text('Open an image'),
2628
onPressed: () => Navigator.pushNamed(context, '/open/image'),
2729
),
2830
SizedBox(height: 10),
29-
RaisedButton(
30-
color: Colors.blue,
31-
textColor: Colors.white,
31+
ElevatedButton(
32+
style: style,
3233
child: Text('Open multiple images'),
3334
onPressed: () => Navigator.pushNamed(context, '/open/images'),
3435
),
3536
SizedBox(height: 10),
36-
RaisedButton(
37-
color: Colors.blue,
38-
textColor: Colors.white,
37+
ElevatedButton(
38+
style: style,
3939
child: Text('Save a file'),
4040
onPressed: () => Navigator.pushNamed(context, '/save/text'),
4141
),
4242
SizedBox(height: 10),
43-
RaisedButton(
44-
color: Colors.blue,
45-
textColor: Colors.white,
43+
ElevatedButton(
44+
style: style,
4645
child: Text('Open a get directory dialog'),
4746
onPressed: () => Navigator.pushNamed(context, '/directory'),
4847
),

packages/file_selector/file_selector/example/lib/open_image_page.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ class OpenImagePage extends StatelessWidget {
3131
child: Column(
3232
mainAxisAlignment: MainAxisAlignment.center,
3333
children: <Widget>[
34-
RaisedButton(
35-
color: Colors.blue,
36-
textColor: Colors.white,
34+
ElevatedButton(
35+
style: ElevatedButton.styleFrom(
36+
primary: Colors.blue,
37+
onPrimary: Colors.white,
38+
),
3739
child: Text('Press to open an image file(png, jpg)'),
3840
onPressed: () => _openImageFile(context),
3941
),
@@ -63,7 +65,7 @@ class ImageDisplay extends StatelessWidget {
6365
// while on other platforms it is a system path.
6466
content: kIsWeb ? Image.network(filePath) : Image.file(File(filePath)),
6567
actions: [
66-
FlatButton(
68+
TextButton(
6769
child: const Text('Close'),
6870
onPressed: () {
6971
Navigator.pop(context);

packages/file_selector/file_selector/example/lib/open_multiple_images_page.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ class OpenMultipleImagesPage extends StatelessWidget {
3434
child: Column(
3535
mainAxisAlignment: MainAxisAlignment.center,
3636
children: <Widget>[
37-
RaisedButton(
38-
color: Colors.blue,
39-
textColor: Colors.white,
37+
ElevatedButton(
38+
style: ElevatedButton.styleFrom(
39+
primary: Colors.blue,
40+
onPrimary: Colors.white,
41+
),
4042
child: Text('Press to open multiple images (png, jpg)'),
4143
onPressed: () => _openImageFile(context),
4244
),
@@ -74,7 +76,7 @@ class MultipleImagesDisplay extends StatelessWidget {
7476
),
7577
),
7678
actions: [
77-
FlatButton(
79+
TextButton(
7880
child: const Text('Close'),
7981
onPressed: () {
8082
Navigator.pop(context);

packages/file_selector/file_selector/example/lib/open_text_page.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ class OpenTextPage extends StatelessWidget {
2828
child: Column(
2929
mainAxisAlignment: MainAxisAlignment.center,
3030
children: <Widget>[
31-
RaisedButton(
32-
color: Colors.blue,
33-
textColor: Colors.white,
31+
ElevatedButton(
32+
style: ElevatedButton.styleFrom(
33+
primary: Colors.blue,
34+
onPrimary: Colors.white,
35+
),
3436
child: Text('Press to open a text file (json, txt)'),
3537
onPressed: () => _openTextFile(context),
3638
),
@@ -62,7 +64,7 @@ class TextDisplay extends StatelessWidget {
6264
),
6365
),
6466
actions: [
65-
FlatButton(
67+
TextButton(
6668
child: const Text('Close'),
6769
onPressed: () => Navigator.pop(context),
6870
),

packages/file_selector/file_selector/example/lib/save_text_page.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ class SaveTextPage extends StatelessWidget {
5151
),
5252
),
5353
SizedBox(height: 10),
54-
RaisedButton(
55-
color: Colors.blue,
56-
textColor: Colors.white,
54+
ElevatedButton(
55+
style: ElevatedButton.styleFrom(
56+
primary: Colors.blue,
57+
onPrimary: Colors.white,
58+
),
5759
child: Text('Press to save a text file'),
5860
onPressed: () => _saveFile(),
5961
),

packages/file_selector/file_selector/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: file_selector
22
description: Flutter plugin for opening and saving files.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/file_selector/file_selector
4-
version: 0.7.0+1
4+
version: 0.7.0+2
55

66
dependencies:
77
flutter:

packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.10
2+
3+
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
4+
15
## 1.0.9
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

0 commit comments

Comments
 (0)