Skip to content

Commit 03536e5

Browse files
authored
Merge pull request #297 from bhanuka96/fix/deprecated-withOpacity
Fix: Replace deprecated withOpacity with withValues
2 parents 6876eef + e316348 commit 03536e5

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

example/audio_classification/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class _MyHomePageState extends State<MyHomePage> {
186186
backgroundColor: Colors.white,
187187
appBar: AppBar(
188188
title: Image.asset('assets/images/tfl_logo.png'),
189-
backgroundColor: Colors.black.withOpacity(0.5),
189+
backgroundColor: Colors.black.withValues(alpha: 0.5),
190190
),
191191
body: _buildBody(),
192192
);

example/bertqa/lib/ui/qa_detail.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class _QaDetailState extends State<QaDetail> {
140140
padding: const EdgeInsets.all(16),
141141
decoration: BoxDecoration(color: Colors.white, boxShadow: [
142142
BoxShadow(
143-
color: Colors.grey.withOpacity(0.5),
143+
color: Colors.grey.withValues(alpha: 0.5),
144144
spreadRadius: 2,
145145
blurRadius: 5,
146146
offset: const Offset(0, 3))

example/digit_classification/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class _MyHomePageState extends State<MyHomePage> {
9191
title: Center(
9292
child: Image.asset('assets/images/tfl_logo.png'),
9393
),
94-
backgroundColor: Colors.black.withOpacity(0.5),
94+
backgroundColor: Colors.black.withValues(alpha: 0.5),
9595
),
9696
body: Center(
9797
child: Column(

example/gesture_classification/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
166166
title: Center(
167167
child: Image.asset('assets/images/tfl_logo.png'),
168168
),
169-
backgroundColor: Colors.black.withOpacity(0.5),
169+
backgroundColor: Colors.black.withValues(alpha: 0.5),
170170
),
171171
body: Center(
172172
// Center is a layout widget. It takes a single child and positions it

example/image_classification_mobilenet/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class _BottomNavigationBarExampleState
8888
return Scaffold(
8989
appBar: AppBar(
9090
title: Image.asset('assets/images/tfl_logo.png'),
91-
backgroundColor: Colors.black.withOpacity(0.5),
91+
backgroundColor: Colors.black.withValues(alpha: 0.5),
9292
),
9393
body: Center(
9494
child: _widgetOptions?.elementAt(_selectedIndex),

example/image_segmentation/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
226226
// parse color from label color
227227
color: Color(ImageSegmentationHelper
228228
.labelColors[_labelsIndex![index]])
229-
.withOpacity(0.5),
229+
.withValues(alpha: 0.5),
230230
borderRadius: BorderRadius.circular(8),
231231
),
232232
child: Text(
@@ -251,7 +251,7 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
251251
title: Center(
252252
child: Image.asset('assets/images/tfl_logo.png'),
253253
),
254-
backgroundColor: Colors.black.withOpacity(0.5),
254+
backgroundColor: Colors.black.withValues(alpha: 0.5),
255255
),
256256
body: cameraWidget(context),
257257
);

example/object_detection_ssd_mobilenet/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class _MyHomeState extends State<MyHome> {
6464
return Scaffold(
6565
appBar: AppBar(
6666
title: Image.asset('assets/images/tfl_logo.png'),
67-
backgroundColor: Colors.black.withOpacity(0.5),
67+
backgroundColor: Colors.black.withValues(alpha: 0.5),
6868
),
6969
body: SafeArea(
7070
child: Column(

example/object_detection_ssd_mobilenet_v2/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class _MyHomeState extends State<MyHome> {
4949
return Scaffold(
5050
appBar: AppBar(
5151
title: Image.asset('assets/images/tfl_logo.png'),
52-
backgroundColor: Colors.black.withOpacity(0.5),
52+
backgroundColor: Colors.black.withValues(alpha: 0.5),
5353
),
5454
body: SafeArea(
5555
child: Column(

example/pose_estimation/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
180180
title: Center(
181181
child: Image.asset('assets/images/tfl_logo.png'),
182182
),
183-
backgroundColor: Colors.black.withOpacity(0.5),
183+
backgroundColor: Colors.black.withValues(alpha: 0.5),
184184
),
185185
body: resultWidget(context),
186186
);

example/style_transfer/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class _HomeState extends State<Home> {
291291
return Scaffold(
292292
appBar: AppBar(
293293
title: Image.asset('assets/images/tfl_logo.png'),
294-
backgroundColor: Colors.black.withOpacity(0.5),
294+
backgroundColor: Colors.black.withValues(alpha: 0.5),
295295
),
296296
body: SafeArea(
297297
child: Center(

0 commit comments

Comments
 (0)