Skip to content

Commit d93cf2b

Browse files
withOpacity => withAlpha (#2239)
## Pre-launch Checklist - [x] I read the [Effective Dart: Style] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Effective Dart: Style]: https://dart.dev/guides/language/effective-dart/style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent 67b0007 commit d93cf2b

File tree

225 files changed

+1300
-1080
lines changed

Some content is hidden

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

225 files changed

+1300
-1080
lines changed

animated-responsive-layout/codelab_rebuild.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ steps:
377377
class _EmailWidgetState extends State<EmailWidget> {
378378
late final ColorScheme _colorScheme = Theme.of(context).colorScheme;
379379
late Color unselectedColor = Color.alphaBlend(
380-
_colorScheme.primary.withOpacity(0.08),
380+
_colorScheme.primary.withAlpha(20),
381381
_colorScheme.surface,
382382
);
383383
@@ -587,7 +587,7 @@ steps:
587587
return Container(
588588
height: 84,
589589
color: Color.alphaBlend(
590-
_colorScheme.primary.withOpacity(0.05),
590+
_colorScheme.primary.withAlpha(12),
591591
_colorScheme.surface,
592592
),
593593
child: Padding(
@@ -858,7 +858,7 @@ steps:
858858
class _FeedState extends State<Feed> {
859859
late final _colorScheme = Theme.of(context).colorScheme;
860860
late final _backgroundColor = Color.alphaBlend(
861-
_colorScheme.primary.withOpacity(0.14), _colorScheme.surface);
861+
_colorScheme.primary.withAlpha(36), _colorScheme.surface);
862862
863863
@override
864864
Widget build(BuildContext context) {
@@ -925,7 +925,7 @@ steps:
925925
import 'widgets/email_list_view.dart';
926926
@@ -41,12 +42,20 @@ class _FeedState extends State<Feed> {
927927
late final _backgroundColor = Color.alphaBlend(
928-
_colorScheme.primary.withOpacity(0.14), _colorScheme.surface);
928+
_colorScheme.primary.withAlpha(36), _colorScheme.surface);
929929
930930
+ int selectedIndex = 0;
931931
+
@@ -1093,7 +1093,7 @@ steps:
10931093
10941094
void main() {
10951095
@@ -43,44 +44,65 @@ class _FeedState extends State<Feed> {
1096-
_colorScheme.primary.withOpacity(0.14), _colorScheme.surface);
1096+
_colorScheme.primary.withAlpha(36), _colorScheme.surface);
10971097
10981098
int selectedIndex = 0;
10991099
+ bool wideScreen = false;
@@ -1641,7 +1641,7 @@ steps:
16411641
+class _FeedState extends State<Feed> with SingleTickerProviderStateMixin {
16421642
late final _colorScheme = Theme.of(context).colorScheme;
16431643
late final _backgroundColor = Color.alphaBlend(
1644-
_colorScheme.primary.withOpacity(0.14), _colorScheme.surface);
1644+
_colorScheme.primary.withAlpha(36), _colorScheme.surface);
16451645
+ late final _controller = AnimationController(
16461646
+ duration: const Duration(milliseconds: 1000),
16471647
+ reverseDuration: const Duration(milliseconds: 1250),

animated-responsive-layout/step_03/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

animated-responsive-layout/step_03/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

animated-responsive-layout/step_03/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "7.3.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
2323
}
2424

2525
include ":app"

animated-responsive-layout/step_03/macos/Runner/AppDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true
88
}
9+
10+
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11+
return true
12+
}
913
}

animated-responsive-layout/step_04/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

animated-responsive-layout/step_04/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

animated-responsive-layout/step_04/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "7.3.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
2323
}
2424

2525
include ":app"

animated-responsive-layout/step_04/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Feed extends StatefulWidget {
3939
class _FeedState extends State<Feed> {
4040
late final _colorScheme = Theme.of(context).colorScheme;
4141
late final _backgroundColor = Color.alphaBlend(
42-
_colorScheme.primary.withOpacity(0.14), _colorScheme.surface);
42+
_colorScheme.primary.withAlpha(36), _colorScheme.surface);
4343

4444
@override
4545
Widget build(BuildContext context) {

animated-responsive-layout/step_04/lib/widgets/email_widget.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class EmailWidget extends StatefulWidget {
3737
class _EmailWidgetState extends State<EmailWidget> {
3838
late final ColorScheme _colorScheme = Theme.of(context).colorScheme;
3939
late Color unselectedColor = Color.alphaBlend(
40-
_colorScheme.primary.withOpacity(0.08),
40+
_colorScheme.primary.withAlpha(20),
4141
_colorScheme.surface,
4242
);
4343

@@ -247,7 +247,7 @@ class _EmailHeadlineState extends State<EmailHeadline> {
247247
return Container(
248248
height: 84,
249249
color: Color.alphaBlend(
250-
_colorScheme.primary.withOpacity(0.05),
250+
_colorScheme.primary.withAlpha(12),
251251
_colorScheme.surface,
252252
),
253253
child: Padding(

0 commit comments

Comments
 (0)