8000 [in_app_purchase] Migrate `ThemeData.errorColor` (#6310) · flutter/plugins@0c7b4e7 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 0c7b4e7

Browse files
authored
[in_app_purchase] Migrate ThemeData.errorColor (#6310)
* Migrate ThemeData.errorColor * x
1 parent cedd66c commit 0c7b4e7

File tree

3 files changed

+17
-9
lines changed
  • packages/in_app_purchase

3 files changed

+17
-9
lines changed

packages/in_app_purchase/in_app_purchase/example/lib/main.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
import 'dart:async';
66
import 'dart:io';
7+
78
import 'package:flutter/material.dart';
89
import 'package:in_app_purchase/in_app_purchase.dart';
910
import 'package:in_app_purchase_android/billing_client_wrappers.dart';
1011
import 'package:in_app_purchase_android/in_app_purchase_android.dart';
1112
import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart';
1213
import 'package:in_app_purchase_storekit/store_kit_wrappers.dart';
14+
1315
import 'consumable_store.dart';
1416

1517
void main() {
@@ -194,7 +196,9 @@ class _MyAppState extends State<_MyApp> {
194196
}
195197
final Widget storeHeader = ListTile(
196198
leading: Icon(_isAvailable ? Icons.check : Icons.block,
197-
color: _isAvailable ? Colors.green : ThemeData.light().errorColor),
199+
color: _isAvailable
200+
? Colors.green
201+
: ThemeData.light().colorScheme.error),
198202
title:
199203
Text('The store is ${_isAvailable ? 'available' : 'unavailable'}.'),
200204
);
@@ -205,7 +209,7 @@ class _MyAppState extends State<_MyApp> {
205209
const Divider(),
206210
ListTile(
207211
title: Text('Not connected',
208-
style: TextStyle(color: ThemeData.light().errorColor)),
212+
style: TextStyle(color: ThemeData.light().colorScheme.error)),
209213
subtitle: const Text(
210214
'Unable to connect to the payments processor. Has this app been configured correctly? See the example README for instructions.'),
211215
),
@@ -229,7 +233,7 @@ class _MyAppState extends State<_MyApp> {
229233
if (_notFoundIds.isNotEmpty) {
230234
productList.add(ListTile(
231235
title: Text('[${_notFoundIds.join(", ")}] not found',
232-
style: TextStyle(color: ThemeData.light().errorColor)),
236+
style: TextStyle(color: ThemeData.light().colorScheme.error)),
233237
subtitle: const Text(
234238
'This app needs special configuration to run. Please see example/README.md for instructions.')));
235239
}

packages/in_app_purchase/in_app_purchase_android/example/lib/main.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ class _MyAppState extends State<_MyApp> {
186186
}
187187
final Widget storeHeader = ListTile(
188188
leading: Icon(_isAvailable ? Icons.check : Icons.block,
189-
color: _isAvailable ? Colors.green : ThemeData.light().errorColor),
189+
color: _isAvailable
190+
? Colors.green
191+
: ThemeData.light().colorScheme.error),
190192
title:
191193
Text('The store is ${_isAvailable ? 'available' : 'unavailable'}.'),
192194
);
@@ -197,7 +199,7 @@ class _MyAppState extends State<_MyApp> {
197199
const Divider(),
198200
ListTile(
199201
title: Text('Not connected',
200-
style: TextStyle(color: ThemeData.light().errorColor)),
202+
style: TextStyle(color: ThemeData.light().colorScheme.error)),
201203
subtitle: const Text(
202204
'Unable to connect to the payments processor. Has this app been configured correctly? See the example README for instructions.'),
203205
),
@@ -221,7 +223,7 @@ class _MyAppState extends State<_MyApp> {
221223
if (_notFoundIds.isNotEmpty) {
222224
productList.add(ListTile(
223225
title: Text('[${_notFoundIds.join(", ")}] not found',
224-
style: TextStyle(color: ThemeData.light().errorColor)),
226+
style: TextStyle(color: ThemeData.light().colorScheme.error)),
225227
subtitle: const Text(
226228
'This app needs special configuration to run. Please see example/README.md for instructions.')));
227229
}

packages/in_app_purchase/in_app_purchase_storekit/example/lib/main.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ class _MyAppState extends State<_MyApp> {
188188
}
189189
final Widget storeHeader = ListTile(
190190
leading: Icon(_isAvailable ? Icons.check : Icons.block,
191-
color: _isAvailable ? Colors.green : ThemeData.light().errorColor),
191+
color: _isAvailable
192+
? Colors.green
193+
: ThemeData.light().colorScheme.error),
192194
title:
193195
Text('The store is ${_isAvailable ? 'available' : 'unavailable'}.'),
194196
);
@@ -199,7 +201,7 @@ class _MyAppState extends State<_MyApp> {
199201
const Divider(),
200202
ListTile(
201203
title: Text('Not connected',
202-
style: TextStyle(color: ThemeData.light().errorColor)),
204+
style: TextStyle(color: ThemeData.light().colorScheme.error)),
203205
subtitle: const Text(
204206
'Unable to connect to the payments processor. Has this app been configured correctly? See the example README for instructions.'),
205207
),
@@ -223,7 +225,7 @@ class _MyAppState extends State<_MyApp> {
223225
if (_notFoundIds.isNotEmpty) {
224226
productList.add(ListTile(
225227
title: Text('[${_notFoundIds.join(", ")}] not found',
226-
style: TextStyle(color: ThemeData.light().errorColor)),
228+
style: TextStyle(color: ThemeData.light().colorScheme.error)),
227229
subtitle: const Text(
228230
'This app needs special configuration to run. Please see example/README.md for instructions.')));
229231
}

0 commit comments

Comments
 (0)
0