Migrating styleFrom API to new version. (#4540)

Updates the styleFrom API to use `backgroundColor` and `foregroundColor` instead of deprecated methods (`primary`, `onPrimary`).

Fixes [#105724](https://github.com/flutter/flutter/issues/105724)
This commit is contained in:
Francisco Reis Nogueira
2023-08-08 20:27:18 -03:00
committed by GitHub
parent ac4137624a
commit 34683acc39
53 changed files with 127 additions and 214 deletions

View File

@ -1,3 +1,7 @@
## 0.10.5+3
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.10.5+2
* Fixes unawaited_futures violations.

View File

@ -365,16 +365,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _exposureModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.auto
foregroundColor: controller?.value.exposureMode == ExposureMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.locked
foregroundColor: controller?.value.exposureMode == ExposureMode.locked
? Colors.orange
: Colors.blue,
);
@ -452,16 +448,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _focusModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.auto
foregroundColor: controller?.value.focusMode == FocusMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.locked
foregroundColor: controller?.value.focusMode == FocusMode.locked
? Colors.orange
: Colors.blue,
);

View File

@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing
Dart.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.10.5+2
version: 0.10.5+3
environment:
sdk: ">=2.18.0 <4.0.0"

View File

@ -1,3 +1,7 @@
## 0.10.8+6
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.10.8+5
* Provides a default exposure point if null.

View File

@ -368,16 +368,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _exposureModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.auto
foregroundColor: controller?.value.exposureMode == ExposureMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.locked
foregroundColor: controller?.value.exposureMode == ExposureMode.locked
? Colors.orange
: Colors.blue,
);
@ -456,16 +452,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _focusModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.auto
foregroundColor: controller?.value.focusMode == FocusMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.locked
foregroundColor: controller?.value.focusMode == FocusMode.locked
? Colors.orange
: Colors.blue,
);

View File

@ -3,7 +3,7 @@ description: Android implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.10.8+5
version: 0.10.8+6
environment:
sdk: ">=2.18.0 <4.0.0"

View File

@ -1,3 +1,7 @@
## 0.5.0+13
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.5.0+12
* Wraps classes needed to implement resolution configuration for image capture, image analysis, and preview.

View File

@ -357,16 +357,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _exposureModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.auto
foregroundColor: controller?.value.exposureMode == ExposureMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.locked
foregroundColor: controller?.value.exposureMode == ExposureMode.locked
? Colors.orange
: Colors.blue,
);
@ -439,16 +435,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _focusModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.auto
foregroundColor: controller?.value.focusMode == FocusMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.locked
foregroundColor: controller?.value.focusMode == FocusMode.locked
? Colors.orange
: Colors.blue,
);

View File

@ -2,7 +2,7 @@ name: camera_android_camerax
description: Android implementation of the camera plugin using the CameraX library.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.5.0+12
version: 0.5.0+13
environment:
sdk: ">=2.19.0 <4.0.0"

View File

@ -1,5 +1,6 @@
## NEXT
## 0.9.13+3
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
* Fixes unawaited_futures violations.
## 0.9.13+2

View File

@ -368,16 +368,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _exposureModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.auto
foregroundColor: controller?.value.exposureMode == ExposureMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.exposureMode == ExposureMode.locked
foregroundColor: controller?.value.exposureMode == ExposureMode.locked
? Colors.orange
: Colors.blue,
);
@ -456,16 +452,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
Widget _focusModeControlRowWidget() {
final ButtonStyle styleAuto = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.auto
foregroundColor: controller?.value.focusMode == FocusMode.auto
? Colors.orange
: Colors.blue,
);
final ButtonStyle styleLocked = TextButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: controller?.value.focusMode == FocusMode.locked
foregroundColor: controller?.value.focusMode == FocusMode.locked
? Colors.orange
: Colors.blue,
);

View File

@ -2,7 +2,7 @@ name: camera_avfoundation
description: iOS implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.9.13+2
version: 0.9.13+3
environment:
sdk: ">=2.18.0 <4.0.0"

View File

@ -1,3 +1,7 @@
## NEXT
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 1.0.0
* Removes the deprecated `getSavePath` in favor of `getSaveLocation`.

View File

@ -42,11 +42,8 @@ class GetDirectoryPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
onPressed: _isIOS ? null : () => _getDirectoryPath(context),
child: const Text(

View File

@ -44,11 +44,8 @@ class GetMultipleDirectoriesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text(
'Press to ask user to choose multiple directories'),

View File

@ -15,11 +15,8 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
);
return Scaffold(
appBar: AppBar(

View File

@ -49,11 +49,8 @@ class OpenImagePage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open an image file(png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -52,11 +52,8 @@ class OpenMultipleImagesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open multiple images (png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -53,11 +53,8 @@ class OpenTextPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open a text file (json, txt)'),
onPressed: () => _openTextFile(context),

View File

@ -79,11 +79,8 @@ class SaveTextPage extends StatelessWidget {
const SizedBox(height: 10),
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
onPressed: _isIOS ? null : () => _saveFile(),
child: const Text(

View File

@ -1,3 +1,7 @@
## NEXT
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.5.1+4
* Updates references to the deprecated `macUTIs`.

View File

@ -12,11 +12,8 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
);
return Scaffold(
appBar: AppBar(

View File

@ -49,11 +49,8 @@ class OpenImagePage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open an image file(png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -54,11 +54,8 @@ class OpenMultipleImagesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open multiple images (png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -46,11 +46,8 @@ class OpenTextPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open a text file (json, txt)'),
onPressed: () => _openTextFile(context),

View File

@ -1,3 +1,7 @@
## NEXT
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.9.2
* Adds `getSaveLocation` and deprecates `getSavePath`.

View File

@ -41,11 +41,8 @@ class GetDirectoryPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to ask user to choose a directory'),
onPressed: () => _getDirectoryPath(context),

View File

@ -42,11 +42,8 @@ class GetMultipleDirectoriesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text(
'Press to ask user to choose multiple directories'),

View File

@ -12,11 +12,8 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
);
return Scaffold(
appBar: AppBar(

View File

@ -48,11 +48,8 @@ class OpenImagePage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open an image file(png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -52,11 +52,8 @@ class OpenMultipleImagesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open multiple images (png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -45,11 +45,8 @@ class OpenTextPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open a text file (json, txt)'),
onPressed: () => _openTextFile(context),

View File

@ -68,11 +68,8 @@ class SaveTextPage extends StatelessWidget {
const SizedBox(height: 10),
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
onPressed: _saveFile,
child: const Text('Press to save a text file'),

View File

@ -1,3 +1,7 @@
## NEXT
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.9.3+1
* Updates to the latest version of `pigeon`.

View File

@ -41,11 +41,8 @@ class GetDirectoryPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to ask user to choose a directory'),
onPressed: () => _getDirectoryPath(context),

View File

@ -12,11 +12,8 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
);
return Scaffold(
appBar: AppBar(

View File

@ -48,11 +48,8 @@ class OpenImagePage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open an image file(png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -52,11 +52,8 @@ class OpenMultipleImagesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open multiple images (png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -45,11 +45,8 @@ class OpenTextPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open a text file (json, txt)'),
onPressed: () => _openTextFile(context),

View File

@ -68,11 +68,8 @@ class SaveTextPage extends StatelessWidget {
const SizedBox(height: 10),
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
onPressed: _saveFile,
child: const Text('Press to save a text file'),

View File

@ -1,3 +1,7 @@
## NEXT
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.9.3
* Adds `getSaveLocation` and deprecates `getSavePath`.

View File

@ -41,11 +41,8 @@ class GetDirectoryPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to ask user to choose a directory'),
onPressed: () => _getDirectoryPath(context),

View File

@ -12,11 +12,8 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
);
return Scaffold(
appBar: AppBar(

View File

@ -48,11 +48,8 @@ class OpenImagePage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open an image file(png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -52,11 +52,8 @@ class OpenMultipleImagesPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open multiple images (png, jpg)'),
onPressed: () => _openImageFile(context),

View File

@ -45,11 +45,8 @@ class OpenTextPage extends StatelessWidget {
children: <Widget>[
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
child: const Text('Press to open a text file (json, txt)'),
onPressed: () => _openTextFile(context),

View File

@ -88,11 +88,8 @@ class SaveTextPage extends StatelessWidget {
const SizedBox(height: 10),
ElevatedButton(
style: ElevatedButton.styleFrom(
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.blue,
// ignore: deprecated_member_use
onPrimary: Colors.white,
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
onPressed: _saveFile,
child: const Text('Press to save a text file'),

View File

@ -1,3 +1,7 @@
## 0.3.0+11
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.3.0+10
* Bumps com.android.billingclient:billing from 6.0.0 to 6.0.1.

View File

@ -258,9 +258,7 @@ class _MyAppState extends State<_MyApp> {
: TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.green[800],
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.white,
foregroundColor: Colors.white,
),
onPressed: () {
// NOTE: If you are making a subscription purchase/upgrade/downgrade, we recommend you to

View File

@ -2,7 +2,7 @@ name: in_app_purchase_android
description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.0+10
version: 0.3.0+11
environment:
sdk: ">=2.18.0 <4.0.0"

View File

@ -1,3 +1,7 @@
## 0.3.6+5
* Migrates `styleFrom` usage in examples off of deprecated `primary` and `onPrimary` parameters.
## 0.3.6+4
* Removes obsolete null checks on non-nullable values.

View File

@ -262,9 +262,7 @@ class _MyAppState extends State<_MyApp> {
: TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.green[800],
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.white,
foregroundColor: Colors.white,
),
onPressed: () {
final PurchaseParam purchaseParam = PurchaseParam(
@ -339,9 +337,7 @@ class _MyAppState extends State<_MyApp> {
TextButton(
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.primary,
// TODO(darrenaustin): Migrate to new API once it lands in stable: https://github.com/flutter/flutter/issues/105724
// ignore: deprecated_member_use
primary: Colors.white,
foregroundColor: Colors.white,
),
onPressed: () => _iapStoreKitPlatform.restorePurchases(),
child: const Text('Restore purchases'),

View File

@ -2,7 +2,7 @@ name: in_app_purchase_storekit
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.6+4
version: 0.3.6+5
environment:
sdk: ">=2.18.0 <4.0.0"