diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ed72cfa669..4b7d56f03b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,7 @@ jobs: submodules: recursive - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: - sdk: stable + sdk: beta - name: Fetch Dart dependencies run: dart pub get - name: Check if excerpts are up to date @@ -88,7 +88,7 @@ jobs: run: pnpm install --frozen-lockfile - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: - sdk: stable + sdk: beta - name: Fetch Dart dependencies run: dart pub get - name: Build site @@ -108,7 +108,7 @@ jobs: submodules: recursive - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: - sdk: stable + sdk: beta - name: Fetch Dart dependencies run: dart pub get - name: Validate the firebase.json file diff --git a/examples/_animation/basic_hero_animation/pubspec.yaml b/examples/_animation/basic_hero_animation/pubspec.yaml index 5d1ded3956f..dc6089ff586 100644 --- a/examples/_animation/basic_hero_animation/pubspec.yaml +++ b/examples/_animation/basic_hero_animation/pubspec.yaml @@ -4,7 +4,7 @@ description: >- Shows how to create a simple or Hero animation using the Hero class directly. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/_animation/basic_radial_hero_animation/lib/main.dart b/examples/_animation/basic_radial_hero_animation/lib/main.dart index 312a8aa75b0..cd41fff10ba 100644 --- a/examples/_animation/basic_radial_hero_animation/lib/main.dart +++ b/examples/_animation/basic_radial_hero_animation/lib/main.dart @@ -22,7 +22,7 @@ class Photo extends StatelessWidget { return Material( // Slightly opaque color appears where the image has transparency. // Makes it possible to see the radial transformation's boundary. - color: Theme.of(context).primaryColor.withOpacity(0.25), + color: Theme.of(context).primaryColor.withValues(alpha: 0.25), child: InkWell( onTap: onTap, child: Image.asset( diff --git a/examples/_animation/basic_radial_hero_animation/pubspec.yaml b/examples/_animation/basic_radial_hero_animation/pubspec.yaml index 6ceb5ab4961..ebe775d72d9 100644 --- a/examples/_animation/basic_radial_hero_animation/pubspec.yaml +++ b/examples/_animation/basic_radial_hero_animation/pubspec.yaml @@ -5,7 +5,7 @@ description: >- as it animates to the new route. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/_animation/basic_staggered_animation/lib/main.dart b/examples/_animation/basic_staggered_animation/lib/main.dart index ae26b1970e9..34201ec90a6 100644 --- a/examples/_animation/basic_staggered_animation/lib/main.dart +++ b/examples/_animation/basic_staggered_animation/lib/main.dart @@ -187,9 +187,9 @@ class _StaggerDemoState extends State width: 300, height: 300, decoration: BoxDecoration( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), border: Border.all( - color: Colors.black.withOpacity(0.5), + color: Colors.black.withValues(alpha: 0.5), ), ), child: StaggerAnimation(controller: _controller.view), diff --git a/examples/_animation/basic_staggered_animation/pubspec.yaml b/examples/_animation/basic_staggered_animation/pubspec.yaml index a1b5317acf2..e8a0e0e7eef 100644 --- a/examples/_animation/basic_staggered_animation/pubspec.yaml +++ b/examples/_animation/basic_staggered_animation/pubspec.yaml @@ -3,7 +3,7 @@ publish_to: none description: An introductory example to staggered animations. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/_animation/hero_animation/pubspec.yaml b/examples/_animation/hero_animation/pubspec.yaml index a257a6dffce..35cb549b1b3 100644 --- a/examples/_animation/hero_animation/pubspec.yaml +++ b/examples/_animation/hero_animation/pubspec.yaml @@ -3,7 +3,7 @@ publish_to: none description: Shows how to create a simple Hero transition. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/_animation/radial_hero_animation/lib/main.dart b/examples/_animation/radial_hero_animation/lib/main.dart index d4d9f0f6a82..0519c81f480 100644 --- a/examples/_animation/radial_hero_animation/lib/main.dart +++ b/examples/_animation/radial_hero_animation/lib/main.dart @@ -25,7 +25,7 @@ class Photo extends StatelessWidget { Widget build(BuildContext context) { return Material( // Slightly opaque color appears where the image has transparency. - color: Theme.of(context).primaryColor.withOpacity(0.25), + color: Theme.of(context).primaryColor.withValues(alpha: 0.25), child: InkWell( onTap: onTap, child: LayoutBuilder( diff --git a/examples/_animation/radial_hero_animation/pubspec.yaml b/examples/_animation/radial_hero_animation/pubspec.yaml index e44e5f97e29..da3aa8726f3 100644 --- a/examples/_animation/radial_hero_animation/pubspec.yaml +++ b/examples/_animation/radial_hero_animation/pubspec.yaml @@ -5,7 +5,7 @@ description: >- as it animates to the new route. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/_animation/radial_hero_animation_animate_rectclip/lib/main.dart b/examples/_animation/radial_hero_animation_animate_rectclip/lib/main.dart index ba5d6d9330e..e99b5bdc434 100644 --- a/examples/_animation/radial_hero_animation_animate_rectclip/lib/main.dart +++ b/examples/_animation/radial_hero_animation_animate_rectclip/lib/main.dart @@ -26,7 +26,7 @@ class Photo extends StatelessWidget { Widget build(BuildContext context) { return Material( // Slightly opaque color appears where the image has transparency. - color: Theme.of(context).primaryColor.withOpacity(0.25), + color: Theme.of(context).primaryColor.withValues(alpha: 0.25), child: InkWell( onTap: onTap, child: LayoutBuilder( diff --git a/examples/_animation/radial_hero_animation_animate_rectclip/pubspec.yaml b/examples/_animation/radial_hero_animation_animate_rectclip/pubspec.yaml index 5d164172d1f..59b4ba24c34 100644 --- a/examples/_animation/radial_hero_animation_animate_rectclip/pubspec.yaml +++ b/examples/_animation/radial_hero_animation_animate_rectclip/pubspec.yaml @@ -5,7 +5,7 @@ description: >- as it animates to the new route. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/_animation/staggered_pic_selection/pubspec.yaml b/examples/_animation/staggered_pic_selection/pubspec.yaml index 9646105a922..0666c05313c 100644 --- a/examples/_animation/staggered_pic_selection/pubspec.yaml +++ b/examples/_animation/staggered_pic_selection/pubspec.yaml @@ -3,7 +3,7 @@ publish_to: none description: A more complex staggered animation example. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/accessibility/pubspec.yaml b/examples/accessibility/pubspec.yaml index 14d7e77a2c3..bc3357cb670 100644 --- a/examples/accessibility/pubspec.yaml +++ b/examples/accessibility/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/animate0/pubspec.yaml b/examples/animation/animate0/pubspec.yaml index c8b6bd8f552..35fb57d425e 100644 --- a/examples/animation/animate0/pubspec.yaml +++ b/examples/animation/animate0/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/animate1/pubspec.yaml b/examples/animation/animate1/pubspec.yaml index c8b6bd8f552..35fb57d425e 100644 --- a/examples/animation/animate1/pubspec.yaml +++ b/examples/animation/animate1/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/animate2/pubspec.yaml b/examples/animation/animate2/pubspec.yaml index c8b6bd8f552..35fb57d425e 100644 --- a/examples/animation/animate2/pubspec.yaml +++ b/examples/animation/animate2/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/animate3/pubspec.yaml b/examples/animation/animate3/pubspec.yaml index c8b6bd8f552..35fb57d425e 100644 --- a/examples/animation/animate3/pubspec.yaml +++ b/examples/animation/animate3/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/animate4/pubspec.yaml b/examples/animation/animate4/pubspec.yaml index c8b6bd8f552..35fb57d425e 100644 --- a/examples/animation/animate4/pubspec.yaml +++ b/examples/animation/animate4/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/animate5/pubspec.yaml b/examples/animation/animate5/pubspec.yaml index c8b6bd8f552..35fb57d425e 100644 --- a/examples/animation/animate5/pubspec.yaml +++ b/examples/animation/animate5/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/animation/implicit/pubspec.yaml b/examples/animation/implicit/pubspec.yaml index 5dee182c413..9b428991242 100644 --- a/examples/animation/implicit/pubspec.yaml +++ b/examples/animation/implicit/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/animation/animated_container/pubspec.yaml b/examples/cookbook/animation/animated_container/pubspec.yaml index b15113738e0..8b249a029b3 100644 --- a/examples/cookbook/animation/animated_container/pubspec.yaml +++ b/examples/cookbook/animation/animated_container/pubspec.yaml @@ -2,7 +2,7 @@ name: animated_container description: Sample code for cookbook. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/animation/opacity_animation/pubspec.yaml b/examples/cookbook/animation/opacity_animation/pubspec.yaml index 75c8e94b886..a8e995a2a5e 100644 --- a/examples/cookbook/animation/opacity_animation/pubspec.yaml +++ b/examples/cookbook/animation/opacity_animation/pubspec.yaml @@ -2,7 +2,7 @@ name: opacity_animation description: Sample code for cookbook. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/animation/page_route_animation/pubspec.yaml b/examples/cookbook/animation/page_route_animation/pubspec.yaml index 8240138505e..b18e02876ec 100644 --- a/examples/cookbook/animation/page_route_animation/pubspec.yaml +++ b/examples/cookbook/animation/page_route_animation/pubspec.yaml @@ -2,7 +2,7 @@ name: page_route_animation description: Sample code for cookbook. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/animation/physics_simulation/pubspec.yaml b/examples/cookbook/animation/physics_simulation/pubspec.yaml index 580eed7757f..0a07dc97d46 100644 --- a/examples/cookbook/animation/physics_simulation/pubspec.yaml +++ b/examples/cookbook/animation/physics_simulation/pubspec.yaml @@ -2,7 +2,7 @@ name: physics_simulation description: Sample code for cookbook. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/drawer/pubspec.yaml b/examples/cookbook/design/drawer/pubspec.yaml index e5f0db5b71f..0ef57685bf6 100644 --- a/examples/cookbook/design/drawer/pubspec.yaml +++ b/examples/cookbook/design/drawer/pubspec.yaml @@ -2,7 +2,7 @@ name: drawer description: Sample code for drawer cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/fonts/pubspec.yaml b/examples/cookbook/design/fonts/pubspec.yaml index 3eb000a73fe..69efc92ad3b 100644 --- a/examples/cookbook/design/fonts/pubspec.yaml +++ b/examples/cookbook/design/fonts/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/orientation/pubspec.yaml b/examples/cookbook/design/orientation/pubspec.yaml index 06ef6d29e2f..8622631f1b3 100644 --- a/examples/cookbook/design/orientation/pubspec.yaml +++ b/examples/cookbook/design/orientation/pubspec.yaml @@ -2,7 +2,7 @@ name: orientation description: Sample code for orientation cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/package_fonts/pubspec.yaml b/examples/cookbook/design/package_fonts/pubspec.yaml index 9c0f6f632c1..2220917bfab 100644 --- a/examples/cookbook/design/package_fonts/pubspec.yaml +++ b/examples/cookbook/design/package_fonts/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/snackbars/pubspec.yaml b/examples/cookbook/design/snackbars/pubspec.yaml index c07b82053d9..077ff1cd12b 100644 --- a/examples/cookbook/design/snackbars/pubspec.yaml +++ b/examples/cookbook/design/snackbars/pubspec.yaml @@ -2,7 +2,7 @@ name: snackbars description: Sample code for snackbars cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/tabs/pubspec.yaml b/examples/cookbook/design/tabs/pubspec.yaml index 51ae998e854..f6168e55d2f 100644 --- a/examples/cookbook/design/tabs/pubspec.yaml +++ b/examples/cookbook/design/tabs/pubspec.yaml @@ -2,7 +2,7 @@ name: tabs description: Sample code for tabs cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/design/themes/pubspec.yaml b/examples/cookbook/design/themes/pubspec.yaml index 76b5595e24c..107eab04dfe 100644 --- a/examples/cookbook/design/themes/pubspec.yaml +++ b/examples/cookbook/design/themes/pubspec.yaml @@ -2,7 +2,7 @@ name: themes description: Sample code for themes cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/download_button/lib/button_taps.dart b/examples/cookbook/effects/download_button/lib/button_taps.dart index 3a655c1e3e0..b9b772befcf 100644 --- a/examples/cookbook/effects/download_button/lib/button_taps.dart +++ b/examples/cookbook/effects/download_button/lib/button_taps.dart @@ -20,15 +20,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -81,7 +82,7 @@ class ProgressIndicatorWidget extends StatelessWidget { return CircularProgressIndicator( backgroundColor: isDownloading ? CupertinoColors.lightBackgroundGray - : Colors.white.withOpacity(0), + : Colors.transparent, valueColor: AlwaysStoppedAnimation(isFetching ? CupertinoColors.lightBackgroundGray : CupertinoColors.activeBlue), diff --git a/examples/cookbook/effects/download_button/lib/display.dart b/examples/cookbook/effects/download_button/lib/display.dart index ac03085d1e8..0d83733e40d 100644 --- a/examples/cookbook/effects/download_button/lib/display.dart +++ b/examples/cookbook/effects/download_button/lib/display.dart @@ -56,15 +56,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } diff --git a/examples/cookbook/effects/download_button/lib/display_text.dart b/examples/cookbook/effects/download_button/lib/display_text.dart index 340785fe485..66acb59e723 100644 --- a/examples/cookbook/effects/download_button/lib/display_text.dart +++ b/examples/cookbook/effects/download_button/lib/display_text.dart @@ -19,15 +19,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } diff --git a/examples/cookbook/effects/download_button/lib/main.dart b/examples/cookbook/effects/download_button/lib/main.dart index 8a90903c33b..070e2663a76 100644 --- a/examples/cookbook/effects/download_button/lib/main.dart +++ b/examples/cookbook/effects/download_button/lib/main.dart @@ -328,15 +328,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -389,7 +390,7 @@ class ProgressIndicatorWidget extends StatelessWidget { return CircularProgressIndicator( backgroundColor: isDownloading ? CupertinoColors.lightBackgroundGray - : Colors.white.withOpacity(0), + : Colors.transparent, valueColor: AlwaysStoppedAnimation(isFetching ? CupertinoColors.lightBackgroundGray : CupertinoColors.activeBlue), diff --git a/examples/cookbook/effects/download_button/lib/spinner.dart b/examples/cookbook/effects/download_button/lib/spinner.dart index 3d58d596fbd..85db5e4d898 100644 --- a/examples/cookbook/effects/download_button/lib/spinner.dart +++ b/examples/cookbook/effects/download_button/lib/spinner.dart @@ -18,15 +18,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -79,7 +80,7 @@ class ProgressIndicatorWidget extends StatelessWidget { return CircularProgressIndicator( backgroundColor: isDownloading ? CupertinoColors.lightBackgroundGray - : Colors.white.withOpacity(0), + : Colors.transparent, valueColor: AlwaysStoppedAnimation(isFetching ? CupertinoColors.lightBackgroundGray : CupertinoColors.activeBlue), diff --git a/examples/cookbook/effects/download_button/lib/stop.dart b/examples/cookbook/effects/download_button/lib/stop.dart index 58c945e6ad6..b341172264c 100644 --- a/examples/cookbook/effects/download_button/lib/stop.dart +++ b/examples/cookbook/effects/download_button/lib/stop.dart @@ -18,15 +18,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -79,7 +80,7 @@ class ProgressIndicatorWidget extends StatelessWidget { return CircularProgressIndicator( backgroundColor: isDownloading ? CupertinoColors.lightBackgroundGray - : Colors.white.withOpacity(0), + : Colors.transparent, valueColor: AlwaysStoppedAnimation(isFetching ? CupertinoColors.lightBackgroundGray : CupertinoColors.activeBlue), diff --git a/examples/cookbook/effects/download_button/pubspec.yaml b/examples/cookbook/effects/download_button/pubspec.yaml index 49661891e18..4db49573d9f 100644 --- a/examples/cookbook/effects/download_button/pubspec.yaml +++ b/examples/cookbook/effects/download_button/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/drag_a_widget/pubspec.yaml b/examples/cookbook/effects/drag_a_widget/pubspec.yaml index bbe23e6277e..34a5147025f 100644 --- a/examples/cookbook/effects/drag_a_widget/pubspec.yaml +++ b/examples/cookbook/effects/drag_a_widget/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/expandable_fab/pubspec.yaml b/examples/cookbook/effects/expandable_fab/pubspec.yaml index a8a8cc252a5..c659f6b9180 100644 --- a/examples/cookbook/effects/expandable_fab/pubspec.yaml +++ b/examples/cookbook/effects/expandable_fab/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/gradient_bubbles/pubspec.yaml b/examples/cookbook/effects/gradient_bubbles/pubspec.yaml index 53bfe2fdc2a..127dd349009 100644 --- a/examples/cookbook/effects/gradient_bubbles/pubspec.yaml +++ b/examples/cookbook/effects/gradient_bubbles/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/nested_nav/pubspec.yaml b/examples/cookbook/effects/nested_nav/pubspec.yaml index 0a6a3152de6..1d7cd4e8d5b 100644 --- a/examples/cookbook/effects/nested_nav/pubspec.yaml +++ b/examples/cookbook/effects/nested_nav/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart b/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart index b9d88d95cb8..d53499b4ad8 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart @@ -48,7 +48,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], diff --git a/examples/cookbook/effects/parallax_scrolling/lib/excerpt3.dart b/examples/cookbook/effects/parallax_scrolling/lib/excerpt3.dart index 2ef0f40bebd..d803fb1e807 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/excerpt3.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/excerpt3.dart @@ -45,7 +45,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], diff --git a/examples/cookbook/effects/parallax_scrolling/lib/excerpt4.dart b/examples/cookbook/effects/parallax_scrolling/lib/excerpt4.dart index b65ad62ddf0..b48891d54f4 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/excerpt4.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/excerpt4.dart @@ -52,7 +52,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], diff --git a/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart b/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart index b49d3308da1..6053b87747b 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart @@ -59,7 +59,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], diff --git a/examples/cookbook/effects/parallax_scrolling/lib/main.dart b/examples/cookbook/effects/parallax_scrolling/lib/main.dart index c20cd4aa1bb..c9018b3bf89 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/main.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/main.dart @@ -101,7 +101,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], diff --git a/examples/cookbook/effects/parallax_scrolling/pubspec.yaml b/examples/cookbook/effects/parallax_scrolling/pubspec.yaml index f40f5b1f09d..44ac007835e 100644 --- a/examples/cookbook/effects/parallax_scrolling/pubspec.yaml +++ b/examples/cookbook/effects/parallax_scrolling/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/photo_filter_carousel/analysis_options.yaml b/examples/cookbook/effects/photo_filter_carousel/analysis_options.yaml deleted file mode 100644 index eee60e0f5a2..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/analysis_options.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# Take our settings from the example_utils analysis_options.yaml file. -# If necessary for a particular example, this file can also include -# overrides for individual lints. - -include: package:example_utils/analysis.yaml diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt1.dart b/examples/cookbook/effects/photo_filter_carousel/lib/excerpt1.dart deleted file mode 100644 index f0127eb5a60..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt1.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:flutter/material.dart'; - -// #docregion FilterSelector -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - }); - - @override - State createState() => _FilterSelectorState(); -} - -class _FilterSelectorState extends State { - @override - Widget build(BuildContext context) { - return const SizedBox(); - } -} -// #enddocregion FilterSelector - -@immutable -class ExampleInstagramFilterSelection extends StatefulWidget { - const ExampleInstagramFilterSelection({super.key}); - - @override - State createState() => - _ExampleInstagramFilterSelectionState(); -} - -class _ExampleInstagramFilterSelectionState - extends State { - final _filterColor = ValueNotifier(Colors.white); - - @override - Widget build(BuildContext context) { - return Material( - color: Colors.black, - // #docregion Stack - child: Stack( - children: [ - Positioned.fill( - child: _buildPhotoWithFilter(), - ), - const Positioned( - left: 0.0, - right: 0.0, - bottom: 0.0, - child: FilterSelector(), - ), - ], - ), - // #enddocregion Stack - ); - } - - Widget _buildPhotoWithFilter() { - return ValueListenableBuilder( - valueListenable: _filterColor, - builder: (context, color, child) { - return Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-dude.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.color, - fit: BoxFit.cover, - ); - }, - ); - } -} diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt2.dart b/examples/cookbook/effects/photo_filter_carousel/lib/excerpt2.dart deleted file mode 100644 index de8976159da..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt2.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'package:flutter/material.dart'; - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -// #docregion FilterSelectorState2 -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - @override - Widget build(BuildContext context) { - return LayoutBuilder( - builder: (context, constraints) { - final itemSize = constraints.maxWidth * _viewportFractionPerItem; - - return Stack( - alignment: Alignment.bottomCenter, - children: [ - _buildShadowGradient(itemSize), - _buildSelectionRing(itemSize), - ], - ); - }, - ); - } - - Widget _buildShadowGradient(double itemSize) { - return SizedBox( - height: itemSize * 2 + widget.padding.vertical, - child: const DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.transparent, - Colors.black, - ], - ), - ), - child: SizedBox.expand(), - ), - ); - } - - Widget _buildSelectionRing(double itemSize) { - return IgnorePointer( - child: Padding( - padding: widget.padding, - child: SizedBox( - width: itemSize, - height: itemSize, - child: const DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.fromBorderSide( - BorderSide(width: 6, color: Colors.white), - ), - ), - ), - ), - ), - ); - } -} -// #enddocregion FilterSelectorState2 diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt3.dart b/examples/cookbook/effects/photo_filter_carousel/lib/excerpt3.dart deleted file mode 100644 index 4cd56d03dd2..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt3.dart +++ /dev/null @@ -1,95 +0,0 @@ -import 'package:flutter/material.dart'; - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - Color itemColor(int index) => widget.filters[index % widget.filters.length]; - - Widget _buildShadowGradient(double itemSize) { - return SizedBox( - height: itemSize * 2 + widget.padding.vertical, - child: const DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.transparent, - Colors.black, - ], - ), - ), - child: SizedBox.expand(), - ), - ); - } - - Widget _buildSelectionRing(double itemSize) { - return IgnorePointer( - child: Padding( - padding: widget.padding, - child: SizedBox( - width: itemSize, - height: itemSize, - child: const DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.fromBorderSide( - BorderSide(width: 6, color: Colors.white), - ), - ), - ), - ), - ), - ); - } - - // #docregion page-view - @override - Widget build(BuildContext context) { - return LayoutBuilder(builder: (context, constraints) { - final itemSize = constraints.maxWidth * _viewportFractionPerItem; - - return Stack( - alignment: Alignment.bottomCenter, - children: [ - _buildShadowGradient(itemSize), - _buildCarousel(itemSize), - _buildSelectionRing(itemSize), - ], - ); - }); - } - - Widget _buildCarousel(double itemSize) { - return Container( - height: itemSize, - margin: widget.padding, - child: PageView.builder( - itemCount: widget.filters.length, - itemBuilder: (context, index) { - return const SizedBox(); - }, - ), - ); - } - // #enddocregion page-view -} diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt4.dart b/examples/cookbook/effects/photo_filter_carousel/lib/excerpt4.dart deleted file mode 100644 index 99523cb880d..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt4.dart +++ /dev/null @@ -1,133 +0,0 @@ -import 'package:flutter/material.dart'; - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - // #docregion BuildFilterItem - Color itemColor(int index) => widget.filters[index % widget.filters.length]; - - Widget _buildCarousel(double itemSize) { - return Container( - height: itemSize, - margin: widget.padding, - child: PageView.builder( - itemCount: widget.filters.length, - itemBuilder: (context, index) { - return Center( - child: FilterItem( - color: itemColor(index), - onFilterSelected: () {}, - ), - ); - }, - ), - ); - } - // #enddocregion BuildFilterItem - - Widget _buildShadowGradient(double itemSize) { - return SizedBox( - height: itemSize * 2 + widget.padding.vertical, - child: const DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.transparent, - Colors.black, - ], - ), - ), - child: SizedBox.expand(), - ), - ); - } - - Widget _buildSelectionRing(double itemSize) { - return IgnorePointer( - child: Padding( - padding: widget.padding, - child: SizedBox( - width: itemSize, - height: itemSize, - child: const DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.fromBorderSide( - BorderSide(width: 6, color: Colors.white), - ), - ), - ), - ), - ), - ); - } - - @override - Widget build(BuildContext context) { - return LayoutBuilder(builder: (context, constraints) { - final itemSize = constraints.maxWidth * _viewportFractionPerItem; - - return Stack( - alignment: Alignment.bottomCenter, - children: [ - _buildShadowGradient(itemSize), - _buildCarousel(itemSize), - _buildSelectionRing(itemSize), - ], - ); - }); - } -} - -@immutable -class FilterItem extends StatelessWidget { - const FilterItem({ - super.key, - required this.color, - this.onFilterSelected, - }); - - final Color color; - final VoidCallback? onFilterSelected; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onFilterSelected, - child: AspectRatio( - aspectRatio: 1.0, - child: Padding( - padding: const EdgeInsets.all(8), - child: ClipOval( - child: Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-texture.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.hardLight, - ), - ), - ), - ), - ); - } -} diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt5.dart b/examples/cookbook/effects/photo_filter_carousel/lib/excerpt5.dart deleted file mode 100644 index 8ac7ff78246..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt5.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:flutter/material.dart'; - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -// #docregion page-view-controller -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - late final PageController _controller; - - Color itemColor(int index) => widget.filters[index % widget.filters.length]; - - @override - void initState() { - super.initState(); - _controller = PageController( - viewportFraction: _viewportFractionPerItem, - ); - _controller.addListener(_onPageChanged); - } - - void _onPageChanged() { - final page = (_controller.page ?? 0).round(); - widget.onFilterChanged(widget.filters[page]); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - Widget _buildCarousel(double itemSize) { - return Container( - height: itemSize, - margin: widget.padding, - child: PageView.builder( - controller: _controller, - itemCount: widget.filters.length, - itemBuilder: (context, index) { - return Center( - child: FilterItem( - color: itemColor(index), - onFilterSelected: () {}, - ), - ); - }, - ), - ); - } - // #enddocregion page-view-controller - - @override - Widget build(BuildContext context) { - _buildCarousel(5); // Makes sure _buildCarousel is used - return Container(); - } - // #docregion page-view-controller -} -// #enddocregion page-view-controller - -@immutable -class FilterItem extends StatelessWidget { - const FilterItem({ - super.key, - required this.color, - this.onFilterSelected, - }); - - final Color color; - final VoidCallback? onFilterSelected; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onFilterSelected, - child: AspectRatio( - aspectRatio: 1.0, - child: Padding( - padding: const EdgeInsets.all(8), - child: ClipOval( - child: Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-texture.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.hardLight, - ), - ), - ), - ), - ); - } -} diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt6.dart b/examples/cookbook/effects/photo_filter_carousel/lib/excerpt6.dart deleted file mode 100644 index 5571f9390a2..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/excerpt6.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'package:flutter/material.dart'; - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - late final PageController _controller; - - Color itemColor(int index) => widget.filters[index % widget.filters.length]; - - @override - void initState() { - super.initState(); - _controller = PageController( - viewportFraction: _viewportFractionPerItem, - ); - _controller.addListener(_onPageChanged); - } - - void _onPageChanged() { - final page = (_controller.page ?? 0).round(); - widget.onFilterChanged(widget.filters[page]); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - // #docregion BuildCarousel - Widget _buildCarousel(double itemSize) { - return Container( - height: itemSize, - margin: widget.padding, - child: PageView.builder( - controller: _controller, - itemCount: widget.filters.length, - itemBuilder: (context, index) { - return Center( - child: AnimatedBuilder( - animation: _controller, - builder: (context, child) { - return FilterItem( - color: itemColor(index), - onFilterSelected: () => {}, - ); - }, - ), - ); - }, - ), - ); - } - // #enddocregion BuildCarousel - - @override - Widget build(BuildContext context) { - _buildCarousel(5); // Makes sure _buildCarousel is used - return Container(); - } -} - -@immutable -class FilterItem extends StatelessWidget { - const FilterItem({ - super.key, - required this.color, - this.onFilterSelected, - }); - - final Color color; - final VoidCallback? onFilterSelected; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onFilterSelected, - child: AspectRatio( - aspectRatio: 1.0, - child: Padding( - padding: const EdgeInsets.all(8), - child: ClipOval( - child: Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-texture.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.hardLight, - ), - ), - ), - ), - ); - } -} diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/main.dart b/examples/cookbook/effects/photo_filter_carousel/lib/main.dart deleted file mode 100644 index 3829d0d57ec..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/main.dart +++ /dev/null @@ -1,332 +0,0 @@ -import 'dart:math' as math; - -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart' show ViewportOffset; - -void main() { - runApp( - const MaterialApp( - home: ExampleInstagramFilterSelection(), - debugShowCheckedModeBanner: false, - ), - ); -} - -@immutable -class ExampleInstagramFilterSelection extends StatefulWidget { - const ExampleInstagramFilterSelection({super.key}); - - @override - State createState() => - _ExampleInstagramFilterSelectionState(); -} - -class _ExampleInstagramFilterSelectionState - extends State { - final _filters = [ - Colors.white, - ...List.generate( - Colors.primaries.length, - (index) => Colors.primaries[(index * 4) % Colors.primaries.length], - ) - ]; - - final _filterColor = ValueNotifier(Colors.white); - - void _onFilterChanged(Color value) { - _filterColor.value = value; - } - - @override - Widget build(BuildContext context) { - return Material( - color: Colors.black, - child: Stack( - children: [ - Positioned.fill( - child: _buildPhotoWithFilter(), - ), - Positioned( - left: 0.0, - right: 0.0, - bottom: 0.0, - child: _buildFilterSelector(), - ), - ], - ), - ); - } - - Widget _buildPhotoWithFilter() { - return ValueListenableBuilder( - valueListenable: _filterColor, - builder: (context, color, child) { - return Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-dude.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.color, - fit: BoxFit.cover, - ); - }, - ); - } - - Widget _buildFilterSelector() { - return FilterSelector( - onFilterChanged: _onFilterChanged, - filters: _filters, - ); - } -} - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - late final PageController _controller; - late int _page; - - int get filterCount => widget.filters.length; - - Color itemColor(int index) => widget.filters[index % filterCount]; - - @override - void initState() { - super.initState(); - _page = 0; - _controller = PageController( - initialPage: _page, - viewportFraction: _viewportFractionPerItem, - ); - _controller.addListener(_onPageChanged); - } - - void _onPageChanged() { - final page = (_controller.page ?? 0).round(); - if (page != _page) { - _page = page; - widget.onFilterChanged(widget.filters[page]); - } - } - - void _onFilterTapped(int index) { - _controller.animateToPage( - index, - duration: const Duration(milliseconds: 450), - curve: Curves.ease, - ); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Scrollable( - controller: _controller, - axisDirection: AxisDirection.right, - physics: const PageScrollPhysics(), - viewportBuilder: (context, viewportOffset) { - return LayoutBuilder( - builder: (context, constraints) { - final itemSize = constraints.maxWidth * _viewportFractionPerItem; - viewportOffset - ..applyViewportDimension(constraints.maxWidth) - ..applyContentDimensions(0.0, itemSize * (filterCount - 1)); - - return Stack( - alignment: Alignment.bottomCenter, - children: [ - _buildShadowGradient(itemSize), - _buildCarousel( - viewportOffset: viewportOffset, - itemSize: itemSize, - ), - _buildSelectionRing(itemSize), - ], - ); - }, - ); - }, - ); - } - - Widget _buildShadowGradient(double itemSize) { - return SizedBox( - height: itemSize * 2 + widget.padding.vertical, - child: const DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.transparent, - Colors.black, - ], - ), - ), - child: SizedBox.expand(), - ), - ); - } - - Widget _buildCarousel({ - required ViewportOffset viewportOffset, - required double itemSize, - }) { - return Container( - height: itemSize, - margin: widget.padding, - child: Flow( - delegate: CarouselFlowDelegate( - viewportOffset: viewportOffset, - filtersPerScreen: _filtersPerScreen, - ), - children: [ - for (int i = 0; i < filterCount; i++) - FilterItem( - onFilterSelected: () => _onFilterTapped(i), - color: itemColor(i), - ), - ], - ), - ); - } - - Widget _buildSelectionRing(double itemSize) { - return IgnorePointer( - child: Padding( - padding: widget.padding, - child: SizedBox( - width: itemSize, - height: itemSize, - child: const DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.fromBorderSide( - BorderSide(width: 6, color: Colors.white), - ), - ), - ), - ), - ), - ); - } -} - -class CarouselFlowDelegate extends FlowDelegate { - CarouselFlowDelegate({ - required this.viewportOffset, - required this.filtersPerScreen, - }) : super(repaint: viewportOffset); - - final ViewportOffset viewportOffset; - final int filtersPerScreen; - - @override - void paintChildren(FlowPaintingContext context) { - final count = context.childCount; - - // All available painting width - final size = context.size.width; - - // The distance that a single item "page" takes up from the perspective - // of the scroll paging system. We also use this size for the width and - // height of a single item. - final itemExtent = size / filtersPerScreen; - - // The current scroll position expressed as an item fraction, e.g., 0.0, - // or 1.0, or 1.3, or 2.9, etc. A value of 1.3 indicates that item at - // index 1 is active, and the user has scrolled 30% towards the item at - // index 2. - final active = viewportOffset.pixels / itemExtent; - - // Index of the first item we need to paint at this moment. - // At most, we paint 3 items to the left of the active item. - final min = math.max(0, active.floor() - 3).toInt(); - - // Index of the last item we need to paint at this moment. - // At most, we paint 3 items to the right of the active item. - final max = math.min(count - 1, active.ceil() + 3).toInt(); - - // Generate transforms for the visible items and sort by distance. - for (var index = min; index <= max; index++) { - final itemXFromCenter = itemExtent * index - viewportOffset.pixels; - final percentFromCenter = 1.0 - (itemXFromCenter / (size / 2)).abs(); - final itemScale = 0.5 + (percentFromCenter * 0.5); - final opacity = 0.25 + (percentFromCenter * 0.75); - - final itemTransform = Matrix4.identity() - ..translate((size - itemExtent) / 2) - ..translate(itemXFromCenter) - ..translate(itemExtent / 2, itemExtent / 2) - ..multiply(Matrix4.diagonal3Values(itemScale, itemScale, 1.0)) - ..translate(-itemExtent / 2, -itemExtent / 2); - - context.paintChild( - index, - transform: itemTransform, - opacity: opacity, - ); - } - } - - @override - bool shouldRepaint(covariant CarouselFlowDelegate oldDelegate) { - return oldDelegate.viewportOffset != viewportOffset; - } -} - -@immutable -class FilterItem extends StatelessWidget { - const FilterItem({ - super.key, - required this.color, - this.onFilterSelected, - }); - - final Color color; - final VoidCallback? onFilterSelected; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onFilterSelected, - child: AspectRatio( - aspectRatio: 1.0, - child: Padding( - padding: const EdgeInsets.all(8), - child: ClipOval( - child: Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-texture.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.hardLight, - ), - ), - ), - ), - ); - } -} diff --git a/examples/cookbook/effects/photo_filter_carousel/lib/original_example.dart b/examples/cookbook/effects/photo_filter_carousel/lib/original_example.dart deleted file mode 100644 index 05c9c3feae6..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/lib/original_example.dart +++ /dev/null @@ -1,281 +0,0 @@ -// ignore_for_file: unused_element - -import 'package:flutter/material.dart'; - -@immutable -class ExampleInstagramFilterSelection extends StatefulWidget { - const ExampleInstagramFilterSelection({super.key}); - - @override - State createState() => - _ExampleInstagramFilterSelectionState(); -} - -class _ExampleInstagramFilterSelectionState - extends State { - final _filters = [ - Colors.white, - ...List.generate( - Colors.primaries.length, - (index) => Colors.primaries[(index * 4) % Colors.primaries.length], - ) - ]; - - final _filterColor = ValueNotifier(Colors.white); - - void _onFilterChanged(Color value) { - _filterColor.value = value; - } - - @override - Widget build(BuildContext context) { - return Material( - color: Colors.black, - child: Stack( - children: [ - Positioned.fill( - child: _buildPhotoWithFilter(), - ), - Positioned( - left: 0.0, - right: 0.0, - bottom: 0.0, - child: FilterSelector( - onFilterChanged: _onFilterChanged, - filters: _filters, - ), - ), - ], - ), - ); - } - - Widget _buildPhotoWithFilter() { - return ValueListenableBuilder( - valueListenable: _filterColor, - builder: (context, color, child) { - return Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-dude.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.color, - fit: BoxFit.cover, - ); - }, - ); - } -} - -@immutable -class FilterSelector extends StatefulWidget { - const FilterSelector({ - super.key, - required this.filters, - required this.onFilterChanged, - this.padding = const EdgeInsets.symmetric(vertical: 24), - }); - - final List filters; - final void Function(Color selectedColor) onFilterChanged; - final EdgeInsets padding; - - @override - State createState() => _FilterSelectorState(); -} - -class _FilterSelectorState extends State { - static const _filtersPerScreen = 5; - static const _viewportFractionPerItem = 1.0 / _filtersPerScreen; - - late final PageController _controller; - - Color itemColor(int index) => widget.filters[index % widget.filters.length]; - - @override - void initState() { - super.initState(); - _controller = PageController( - viewportFraction: _viewportFractionPerItem, - ); - _controller.addListener(_onPageChanged); - } - - void _onPageChanged() { - final page = (_controller.page ?? 0).round(); - widget.onFilterChanged(widget.filters[page]); - } - - // #docregion FilterTapped - void _onFilterTapped(int index) { - _controller.animateToPage( - index, - duration: const Duration(milliseconds: 450), - curve: Curves.ease, - ); - } - // #enddocregion FilterTapped - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return LayoutBuilder(builder: (context, constraints) { - final itemSize = constraints.maxWidth * _viewportFractionPerItem; - - return Stack( - alignment: Alignment.bottomCenter, - children: [ - _buildShadowGradient(itemSize), - _buildCarousel(itemSize), - _buildSelectionRing(itemSize), - ], - ); - }); - } - - Widget _buildShadowGradient(double itemSize) { - return SizedBox( - height: itemSize * 2 + widget.padding.vertical, - child: const DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.transparent, - Colors.black, - ], - ), - ), - child: SizedBox.expand(), - ), - ); - } - - // #docregion final-build-carousel - Widget _buildCarousel(double itemSize) { - return Container( - height: itemSize, - margin: widget.padding, - child: PageView.builder( - controller: _controller, - itemCount: widget.filters.length, - itemBuilder: (context, index) { - return Center( - child: AnimatedBuilder( - animation: _controller, - builder: (context, child) { - if (!_controller.hasClients || - !_controller.position.hasContentDimensions) { - // The PageViewController isn't connected to the - // PageView widget yet. Return an empty box. - return const SizedBox(); - } - - // The integer index of the current page, - // 0, 1, 2, 3, and so on - final selectedIndex = _controller.page!.roundToDouble(); - - // The fractional amount that the current filter - // is dragged to the left or right, for example, 0.25 when - // the current filter is dragged 25% to the left. - final pageScrollAmount = _controller.page! - selectedIndex; - - // The page-distance of a filter just before it - // moves off-screen. - const maxScrollDistance = _filtersPerScreen / 2; - - // The page-distance of this filter item from the - // currently selected filter item. - final pageDistanceFromSelected = - (selectedIndex - index + pageScrollAmount).abs(); - - // The distance of this filter item from the - // center of the carousel as a percentage, that is, where the selector - // ring sits. - final percentFromCenter = - 1.0 - pageDistanceFromSelected / maxScrollDistance; - - final itemScale = 0.5 + (percentFromCenter * 0.5); - final opacity = 0.25 + (percentFromCenter * 0.75); - - return Transform.scale( - scale: itemScale, - child: Opacity( - opacity: opacity, - // #docregion OnFilterTapped - child: FilterItem( - color: itemColor(index), - onFilterSelected: () => () {}, - ), - // #enddocregion OnFilterTapped - ), - ); - }, - ), - ); - }, - ), - ); - } - // #enddocregion final-build-carousel - - Widget _buildSelectionRing(double itemSize) { - return IgnorePointer( - child: Padding( - padding: widget.padding, - child: SizedBox( - width: itemSize, - height: itemSize, - child: const DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.fromBorderSide( - BorderSide(width: 6, color: Colors.white), - ), - ), - ), - ), - ), - ); - } -} - -// #docregion filter-item -@immutable -class FilterItem extends StatelessWidget { - const FilterItem({ - super.key, - required this.color, - this.onFilterSelected, - }); - - final Color color; - final VoidCallback? onFilterSelected; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onFilterSelected, - child: AspectRatio( - aspectRatio: 1.0, - child: Padding( - padding: const EdgeInsets.all(8), - child: ClipOval( - child: Image.network( - 'https://docs.flutter.dev/cookbook/img-files' - '/effects/instagram-buttons/millennial-texture.jpg', - color: color.withOpacity(0.5), - colorBlendMode: BlendMode.hardLight, - ), - ), - ), - ), - ); - } -} -// #enddocregion filter-item diff --git a/examples/cookbook/effects/photo_filter_carousel/pubspec.yaml b/examples/cookbook/effects/photo_filter_carousel/pubspec.yaml deleted file mode 100644 index a807b1bfedd..00000000000 --- a/examples/cookbook/effects/photo_filter_carousel/pubspec.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: photo_filter_carousel -description: A new Flutter project. - -publish_to: none - -version: 1.0.0+1 - -environment: - sdk: ^3.5.0 - -dependencies: - flutter: - sdk: flutter - cupertino_icons: ^1.0.8 - -dev_dependencies: - example_utils: - path: ../../../example_utils - flutter_test: - sdk: flutter - -flutter: - uses-material-design: true diff --git a/examples/cookbook/effects/shimmer_loading/pubspec.yaml b/examples/cookbook/effects/shimmer_loading/pubspec.yaml index 8619a88c5cf..7733834d145 100644 --- a/examples/cookbook/effects/shimmer_loading/pubspec.yaml +++ b/examples/cookbook/effects/shimmer_loading/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml b/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml index c3acb3716ee..723117688e0 100644 --- a/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml +++ b/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/effects/typing_indicator/pubspec.yaml b/examples/cookbook/effects/typing_indicator/pubspec.yaml index 83e1bed5b1f..fdd5577f42c 100644 --- a/examples/cookbook/effects/typing_indicator/pubspec.yaml +++ b/examples/cookbook/effects/typing_indicator/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/forms/focus/pubspec.yaml b/examples/cookbook/forms/focus/pubspec.yaml index 4d8a7ac1f81..89357e7d3a2 100644 --- a/examples/cookbook/forms/focus/pubspec.yaml +++ b/examples/cookbook/forms/focus/pubspec.yaml @@ -2,7 +2,7 @@ name: focus description: Sample code for focus cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/forms/retrieve_input/pubspec.yaml b/examples/cookbook/forms/retrieve_input/pubspec.yaml index 368e402e172..78eaaef5a73 100644 --- a/examples/cookbook/forms/retrieve_input/pubspec.yaml +++ b/examples/cookbook/forms/retrieve_input/pubspec.yaml @@ -2,7 +2,7 @@ name: retrieve_input description: Sample code for retrieve_input cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/forms/text_field_changes/pubspec.yaml b/examples/cookbook/forms/text_field_changes/pubspec.yaml index 95fbd683b02..309e81c9b14 100644 --- a/examples/cookbook/forms/text_field_changes/pubspec.yaml +++ b/examples/cookbook/forms/text_field_changes/pubspec.yaml @@ -2,7 +2,7 @@ name: text_field_changes description: Sample code for text_field_changes environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/forms/text_input/pubspec.yaml b/examples/cookbook/forms/text_input/pubspec.yaml index 610b95650f2..d2f5120a448 100644 --- a/examples/cookbook/forms/text_input/pubspec.yaml +++ b/examples/cookbook/forms/text_input/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/forms/validation/pubspec.yaml b/examples/cookbook/forms/validation/pubspec.yaml index 89a82c37457..4ff8d0c5793 100644 --- a/examples/cookbook/forms/validation/pubspec.yaml +++ b/examples/cookbook/forms/validation/pubspec.yaml @@ -2,7 +2,7 @@ name: form description: Use Form widget to perform form validation. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/games/achievements_leaderboards/pubspec.yaml b/examples/cookbook/games/achievements_leaderboards/pubspec.yaml index e8a16045df7..32ccce52e8d 100644 --- a/examples/cookbook/games/achievements_leaderboards/pubspec.yaml +++ b/examples/cookbook/games/achievements_leaderboards/pubspec.yaml @@ -2,7 +2,7 @@ name: games_services_example description: Games services environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/games/firestore_multiplayer/pubspec.yaml b/examples/cookbook/games/firestore_multiplayer/pubspec.yaml index e4216746282..20695927882 100644 --- a/examples/cookbook/games/firestore_multiplayer/pubspec.yaml +++ b/examples/cookbook/games/firestore_multiplayer/pubspec.yaml @@ -2,7 +2,7 @@ name: firestore_multiplayer description: Firestore multiplayer environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/gestures/dismissible/pubspec.yaml b/examples/cookbook/gestures/dismissible/pubspec.yaml index 0b91766d528..501a73e8e69 100644 --- a/examples/cookbook/gestures/dismissible/pubspec.yaml +++ b/examples/cookbook/gestures/dismissible/pubspec.yaml @@ -2,7 +2,7 @@ name: dismissible description: Sample code for dismissible cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/gestures/handling_taps/pubspec.yaml b/examples/cookbook/gestures/handling_taps/pubspec.yaml index 67b4017f95a..0eea1d206cb 100644 --- a/examples/cookbook/gestures/handling_taps/pubspec.yaml +++ b/examples/cookbook/gestures/handling_taps/pubspec.yaml @@ -2,7 +2,7 @@ name: handling_taps description: Example on handling_taps cookbook recipe. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/gestures/ripples/pubspec.yaml b/examples/cookbook/gestures/ripples/pubspec.yaml index 5d4b8dca5e1..7fc150f6a69 100644 --- a/examples/cookbook/gestures/ripples/pubspec.yaml +++ b/examples/cookbook/gestures/ripples/pubspec.yaml @@ -2,7 +2,7 @@ name: ripples description: Example for ripples cookbook recipe environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/images/cached_images/pubspec.yaml b/examples/cookbook/images/cached_images/pubspec.yaml index 700a8740ce9..a0ff355e0c6 100644 --- a/examples/cookbook/images/cached_images/pubspec.yaml +++ b/examples/cookbook/images/cached_images/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/images/fading_in_images/pubspec.yaml b/examples/cookbook/images/fading_in_images/pubspec.yaml index cfb0fe4b3ed..aa0c7c592f7 100644 --- a/examples/cookbook/images/fading_in_images/pubspec.yaml +++ b/examples/cookbook/images/fading_in_images/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/images/network_image/pubspec.yaml b/examples/cookbook/images/network_image/pubspec.yaml index db1b745873d..2d427b4b556 100644 --- a/examples/cookbook/images/network_image/pubspec.yaml +++ b/examples/cookbook/images/network_image/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/basic_list/pubspec.yaml b/examples/cookbook/lists/basic_list/pubspec.yaml index 7ef09c54cd6..1525f012260 100644 --- a/examples/cookbook/lists/basic_list/pubspec.yaml +++ b/examples/cookbook/lists/basic_list/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/floating_app_bar/pubspec.yaml b/examples/cookbook/lists/floating_app_bar/pubspec.yaml index 67eaedef943..bc1a765bf7c 100644 --- a/examples/cookbook/lists/floating_app_bar/pubspec.yaml +++ b/examples/cookbook/lists/floating_app_bar/pubspec.yaml @@ -2,7 +2,7 @@ name: floating_app_bar description: Example for floating_app_bar cookbook recipe environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/grid_lists/pubspec.yaml b/examples/cookbook/lists/grid_lists/pubspec.yaml index 4db22fdc7d3..e5b1f584cf3 100644 --- a/examples/cookbook/lists/grid_lists/pubspec.yaml +++ b/examples/cookbook/lists/grid_lists/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/horizontal_list/pubspec.yaml b/examples/cookbook/lists/horizontal_list/pubspec.yaml index 78c9577cdbf..1186b522e62 100644 --- a/examples/cookbook/lists/horizontal_list/pubspec.yaml +++ b/examples/cookbook/lists/horizontal_list/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/long_lists/pubspec.yaml b/examples/cookbook/lists/long_lists/pubspec.yaml index a735b72525d..3f3405a2567 100644 --- a/examples/cookbook/lists/long_lists/pubspec.yaml +++ b/examples/cookbook/lists/long_lists/pubspec.yaml @@ -2,7 +2,7 @@ name: long_lists description: Example for long_lists cookbook recipe environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/mixed_list/pubspec.yaml b/examples/cookbook/lists/mixed_list/pubspec.yaml index b5754e8878e..8ff0eac88f5 100644 --- a/examples/cookbook/lists/mixed_list/pubspec.yaml +++ b/examples/cookbook/lists/mixed_list/pubspec.yaml @@ -2,7 +2,7 @@ name: mixed_lists description: Example for mixed_lists cookbook recipe environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/lists/spaced_items/pubspec.yaml b/examples/cookbook/lists/spaced_items/pubspec.yaml index 4e411fe8791..815ce04e268 100644 --- a/examples/cookbook/lists/spaced_items/pubspec.yaml +++ b/examples/cookbook/lists/spaced_items/pubspec.yaml @@ -2,7 +2,7 @@ name: spaced_items description: Example for spaced_items cookbook recipe environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/maintenance/error_reporting/pubspec.yaml b/examples/cookbook/maintenance/error_reporting/pubspec.yaml index 2ac8c6476c7..4e66da6d843 100644 --- a/examples/cookbook/maintenance/error_reporting/pubspec.yaml +++ b/examples/cookbook/maintenance/error_reporting/pubspec.yaml @@ -3,7 +3,7 @@ description: Error reporting example using sentry. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/navigation/hero_animations/pubspec.yaml b/examples/cookbook/navigation/hero_animations/pubspec.yaml index fafc9a8dd41..f8f5332378d 100644 --- a/examples/cookbook/navigation/hero_animations/pubspec.yaml +++ b/examples/cookbook/navigation/hero_animations/pubspec.yaml @@ -2,7 +2,7 @@ name: hero_animations description: Hero animations environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/navigation/named_routes/pubspec.yaml b/examples/cookbook/navigation/named_routes/pubspec.yaml index 8c580808649..902eb370512 100644 --- a/examples/cookbook/navigation/named_routes/pubspec.yaml +++ b/examples/cookbook/navigation/named_routes/pubspec.yaml @@ -2,7 +2,7 @@ name: navigate_with_arguments description: Use Form widget to perform form validation. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/navigation/navigate_with_arguments/pubspec.yaml b/examples/cookbook/navigation/navigate_with_arguments/pubspec.yaml index 8c580808649..902eb370512 100644 --- a/examples/cookbook/navigation/navigate_with_arguments/pubspec.yaml +++ b/examples/cookbook/navigation/navigate_with_arguments/pubspec.yaml @@ -2,7 +2,7 @@ name: navigate_with_arguments description: Use Form widget to perform form validation. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/navigation/navigation_basics/pubspec.yaml b/examples/cookbook/navigation/navigation_basics/pubspec.yaml index 5bbe670ec04..18366138f24 100644 --- a/examples/cookbook/navigation/navigation_basics/pubspec.yaml +++ b/examples/cookbook/navigation/navigation_basics/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/navigation/passing_data/pubspec.yaml b/examples/cookbook/navigation/passing_data/pubspec.yaml index 68574767ee7..728d76cc9f4 100644 --- a/examples/cookbook/navigation/passing_data/pubspec.yaml +++ b/examples/cookbook/navigation/passing_data/pubspec.yaml @@ -2,7 +2,7 @@ name: passing_data description: Passing data environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/navigation/returning_data/pubspec.yaml b/examples/cookbook/navigation/returning_data/pubspec.yaml index 2c0757d9bae..5ec1b9cf556 100644 --- a/examples/cookbook/navigation/returning_data/pubspec.yaml +++ b/examples/cookbook/navigation/returning_data/pubspec.yaml @@ -2,7 +2,7 @@ name: returning_data description: Returning data environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/authenticated_requests/pubspec.yaml b/examples/cookbook/networking/authenticated_requests/pubspec.yaml index 3ad43876429..d66bb7f541e 100644 --- a/examples/cookbook/networking/authenticated_requests/pubspec.yaml +++ b/examples/cookbook/networking/authenticated_requests/pubspec.yaml @@ -2,7 +2,7 @@ name: hero_animations description: Hero animations environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/background_parsing/pubspec.yaml b/examples/cookbook/networking/background_parsing/pubspec.yaml index 44468996392..712a5b1ca09 100644 --- a/examples/cookbook/networking/background_parsing/pubspec.yaml +++ b/examples/cookbook/networking/background_parsing/pubspec.yaml @@ -2,7 +2,7 @@ name: background_parsing description: Background parsing environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/delete_data/pubspec.yaml b/examples/cookbook/networking/delete_data/pubspec.yaml index 80cd687a698..5d458e2d84d 100644 --- a/examples/cookbook/networking/delete_data/pubspec.yaml +++ b/examples/cookbook/networking/delete_data/pubspec.yaml @@ -2,7 +2,7 @@ name: delete_data description: Delete Data environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/fetch_data/pubspec.yaml b/examples/cookbook/networking/fetch_data/pubspec.yaml index 640e267a99a..38ae0112165 100644 --- a/examples/cookbook/networking/fetch_data/pubspec.yaml +++ b/examples/cookbook/networking/fetch_data/pubspec.yaml @@ -2,7 +2,7 @@ name: fetch_data description: Fetch Data environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/send_data/pubspec.yaml b/examples/cookbook/networking/send_data/pubspec.yaml index d9ebb9a185d..f68ac557daa 100644 --- a/examples/cookbook/networking/send_data/pubspec.yaml +++ b/examples/cookbook/networking/send_data/pubspec.yaml @@ -2,7 +2,7 @@ name: send_data description: Send data environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/update_data/pubspec.yaml b/examples/cookbook/networking/update_data/pubspec.yaml index 64fccb0222a..a786018026e 100644 --- a/examples/cookbook/networking/update_data/pubspec.yaml +++ b/examples/cookbook/networking/update_data/pubspec.yaml @@ -2,7 +2,7 @@ name: update_data description: Update Data environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/networking/web_sockets/pubspec.yaml b/examples/cookbook/networking/web_sockets/pubspec.yaml index e6bfb09ae78..53843ac9492 100644 --- a/examples/cookbook/networking/web_sockets/pubspec.yaml +++ b/examples/cookbook/networking/web_sockets/pubspec.yaml @@ -2,7 +2,7 @@ name: web_sockets description: Web Sockets environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/persistence/key_value/pubspec.yaml b/examples/cookbook/persistence/key_value/pubspec.yaml index fb8cf39de7d..f3d2717231a 100644 --- a/examples/cookbook/persistence/key_value/pubspec.yaml +++ b/examples/cookbook/persistence/key_value/pubspec.yaml @@ -5,7 +5,7 @@ description: >- shows how to use the shared_preferences package. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/persistence/reading_writing_files/pubspec.yaml b/examples/cookbook/persistence/reading_writing_files/pubspec.yaml index 9aafa40a8ea..78cfc27d13b 100644 --- a/examples/cookbook/persistence/reading_writing_files/pubspec.yaml +++ b/examples/cookbook/persistence/reading_writing_files/pubspec.yaml @@ -2,7 +2,7 @@ name: reading_writing_files description: Reading and Writing Files environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/persistence/sqlite/pubspec.yaml b/examples/cookbook/persistence/sqlite/pubspec.yaml index 7baa9bb6a68..df019115c6e 100644 --- a/examples/cookbook/persistence/sqlite/pubspec.yaml +++ b/examples/cookbook/persistence/sqlite/pubspec.yaml @@ -2,7 +2,7 @@ name: sqlite description: Example of using sqflite plugin to access SQLite database. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/plugins/google_mobile_ads/pubspec.yaml b/examples/cookbook/plugins/google_mobile_ads/pubspec.yaml index 09f8a80d5ff..6a573e36fbf 100644 --- a/examples/cookbook/plugins/google_mobile_ads/pubspec.yaml +++ b/examples/cookbook/plugins/google_mobile_ads/pubspec.yaml @@ -2,7 +2,7 @@ name: google_mobile_ads_example description: Google mobile ads environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/plugins/picture_using_camera/pubspec.yaml b/examples/cookbook/plugins/picture_using_camera/pubspec.yaml index d63a1b27c9a..8ef419c05b0 100644 --- a/examples/cookbook/plugins/picture_using_camera/pubspec.yaml +++ b/examples/cookbook/plugins/picture_using_camera/pubspec.yaml @@ -2,7 +2,7 @@ name: picture_using_camera description: A new Flutter project. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/plugins/play_video/pubspec.yaml b/examples/cookbook/plugins/play_video/pubspec.yaml index 7a0a0725c52..701054aaa16 100644 --- a/examples/cookbook/plugins/play_video/pubspec.yaml +++ b/examples/cookbook/plugins/play_video/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/integration/introduction/pubspec.yaml b/examples/cookbook/testing/integration/introduction/pubspec.yaml index 9b5cb80affd..8fdbb5d815f 100644 --- a/examples/cookbook/testing/integration/introduction/pubspec.yaml +++ b/examples/cookbook/testing/integration/introduction/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/integration/profiling/pubspec.yaml b/examples/cookbook/testing/integration/profiling/pubspec.yaml index c105c889d7c..c042679bc5d 100644 --- a/examples/cookbook/testing/integration/profiling/pubspec.yaml +++ b/examples/cookbook/testing/integration/profiling/pubspec.yaml @@ -2,7 +2,7 @@ name: scrolling description: A new Flutter project. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/unit/counter_app/pubspec.yaml b/examples/cookbook/testing/unit/counter_app/pubspec.yaml index 04a2aacb031..5e8f7705796 100644 --- a/examples/cookbook/testing/unit/counter_app/pubspec.yaml +++ b/examples/cookbook/testing/unit/counter_app/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/unit/mocking/pubspec.yaml b/examples/cookbook/testing/unit/mocking/pubspec.yaml index 29ab8f5fe52..12f9343a65a 100644 --- a/examples/cookbook/testing/unit/mocking/pubspec.yaml +++ b/examples/cookbook/testing/unit/mocking/pubspec.yaml @@ -2,7 +2,7 @@ name: mocking description: Use the Mockito package to mimic the behavior of services for testing. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/widget/finders/pubspec.yaml b/examples/cookbook/testing/widget/finders/pubspec.yaml index 9fecdd82b6a..63a6a54b555 100644 --- a/examples/cookbook/testing/widget/finders/pubspec.yaml +++ b/examples/cookbook/testing/widget/finders/pubspec.yaml @@ -2,7 +2,7 @@ name: finders description: A new Flutter project. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/widget/introduction/pubspec.yaml b/examples/cookbook/testing/widget/introduction/pubspec.yaml index c1f3a72f370..ace70a866c8 100644 --- a/examples/cookbook/testing/widget/introduction/pubspec.yaml +++ b/examples/cookbook/testing/widget/introduction/pubspec.yaml @@ -2,7 +2,7 @@ name: introduction description: A new Flutter project. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/widget/scrolling/pubspec.yaml b/examples/cookbook/testing/widget/scrolling/pubspec.yaml index 9af9e153f16..42861e8fcfb 100644 --- a/examples/cookbook/testing/widget/scrolling/pubspec.yaml +++ b/examples/cookbook/testing/widget/scrolling/pubspec.yaml @@ -2,7 +2,7 @@ name: scrolling description: A new Flutter project. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/cookbook/testing/widget/tap_drag/pubspec.yaml b/examples/cookbook/testing/widget/tap_drag/pubspec.yaml index 9fecdd82b6a..63a6a54b555 100644 --- a/examples/cookbook/testing/widget/tap_drag/pubspec.yaml +++ b/examples/cookbook/testing/widget/tap_drag/pubspec.yaml @@ -2,7 +2,7 @@ name: finders description: A new Flutter project. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/data-and-backend/json/pubspec.yaml b/examples/data-and-backend/json/pubspec.yaml index 137b1bf5feb..f73336397d0 100644 --- a/examples/data-and-backend/json/pubspec.yaml +++ b/examples/data-and-backend/json/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: json_annotation: ^4.8.1 diff --git a/examples/deployment/obfuscate/pubspec.yaml b/examples/deployment/obfuscate/pubspec.yaml index d9663369467..1c75769ac42 100644 --- a/examples/deployment/obfuscate/pubspec.yaml +++ b/examples/deployment/obfuscate/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/example_utils/pubspec.yaml b/examples/example_utils/pubspec.yaml index 3805c27e6bd..2369c497bca 100644 --- a/examples/example_utils/pubspec.yaml +++ b/examples/example_utils/pubspec.yaml @@ -3,7 +3,7 @@ description: Utils for examples and code snippets on docs.flutter.dev. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter_lints: ^5.0.0 diff --git a/examples/get-started/codelab_web/lib/main.dart b/examples/get-started/codelab_web/lib/main.dart index 4a75c605c55..f934316d65a 100644 --- a/examples/get-started/codelab_web/lib/main.dart +++ b/examples/get-started/codelab_web/lib/main.dart @@ -200,7 +200,7 @@ class _AnimatedProgressIndicatorState extends State builder: (context, child) => LinearProgressIndicator( value: _curveAnimation.value, valueColor: _colorAnimation, - backgroundColor: _colorAnimation.value?.withOpacity(0.4), + backgroundColor: _colorAnimation.value?.withValues(alpha: 0.4), ), ); } diff --git a/examples/get-started/codelab_web/lib/step3.dart b/examples/get-started/codelab_web/lib/step3.dart index d22358040fc..e940291fb3c 100644 --- a/examples/get-started/codelab_web/lib/step3.dart +++ b/examples/get-started/codelab_web/lib/step3.dart @@ -204,7 +204,7 @@ class _AnimatedProgressIndicatorState extends State builder: (context, child) => LinearProgressIndicator( value: _curveAnimation.value, valueColor: _colorAnimation, - backgroundColor: _colorAnimation.value?.withOpacity(0.4), + backgroundColor: _colorAnimation.value?.withValues(alpha: 0.4), ), ); } diff --git a/examples/get-started/codelab_web/pubspec.yaml b/examples/get-started/codelab_web/pubspec.yaml index 541f54c34ae..7646fb3d788 100644 --- a/examples/get-started/codelab_web/pubspec.yaml +++ b/examples/get-started/codelab_web/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/get-started/flutter-for/android_devs/pubspec.yaml b/examples/get-started/flutter-for/android_devs/pubspec.yaml index bc6299829b5..5bc67268852 100644 --- a/examples/get-started/flutter-for/android_devs/pubspec.yaml +++ b/examples/get-started/flutter-for/android_devs/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/get-started/flutter-for/declarative/pubspec.yaml b/examples/get-started/flutter-for/declarative/pubspec.yaml index 229fa45e678..cbec3c200bf 100644 --- a/examples/get-started/flutter-for/declarative/pubspec.yaml +++ b/examples/get-started/flutter-for/declarative/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/get-started/flutter-for/ios_devs/pubspec.yaml b/examples/get-started/flutter-for/ios_devs/pubspec.yaml index aabca4a8e74..58e72b49d09 100644 --- a/examples/get-started/flutter-for/ios_devs/pubspec.yaml +++ b/examples/get-started/flutter-for/ios_devs/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/get-started/flutter-for/react_native_devs/my_widgets/pubspec.yaml b/examples/get-started/flutter-for/react_native_devs/my_widgets/pubspec.yaml index 255f7a24ce0..7946b75216a 100644 --- a/examples/get-started/flutter-for/react_native_devs/my_widgets/pubspec.yaml +++ b/examples/get-started/flutter-for/react_native_devs/my_widgets/pubspec.yaml @@ -3,7 +3,7 @@ description: A library for `react_native_devs` to import. version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dev_dependencies: example_utils: diff --git a/examples/get-started/flutter-for/react_native_devs/pubspec.yaml b/examples/get-started/flutter-for/react_native_devs/pubspec.yaml index e13cd3eb2c7..5fe234ba980 100644 --- a/examples/get-started/flutter-for/react_native_devs/pubspec.yaml +++ b/examples/get-started/flutter-for/react_native_devs/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/get-started/flutter-for/web_devs/pubspec.yaml b/examples/get-started/flutter-for/web_devs/pubspec.yaml index ea4a2fc03c4..028ca38ed25 100644 --- a/examples/get-started/flutter-for/web_devs/pubspec.yaml +++ b/examples/get-started/flutter-for/web_devs/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/get-started/flutter-for/xamarin_devs/pubspec.yaml b/examples/get-started/flutter-for/xamarin_devs/pubspec.yaml index 2cfdde95a26..be6f7d12be1 100644 --- a/examples/get-started/flutter-for/xamarin_devs/pubspec.yaml +++ b/examples/get-started/flutter-for/xamarin_devs/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/googleapis/pubspec.yaml b/examples/googleapis/pubspec.yaml index 9aa4907b5b7..8a7db4f5beb 100644 --- a/examples/googleapis/pubspec.yaml +++ b/examples/googleapis/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in_example publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: collection: any # Pull the version of collection from Flutter. diff --git a/examples/integration_test/pubspec.yaml b/examples/integration_test/pubspec.yaml index cbeb9bb0761..11b5e96a818 100644 --- a/examples/integration_test/pubspec.yaml +++ b/examples/integration_test/pubspec.yaml @@ -3,7 +3,7 @@ publish_to: none version: 0.0.1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/integration_test_migration/pubspec.yaml b/examples/integration_test_migration/pubspec.yaml index 19ad4dc5e77..eb94adbe085 100644 --- a/examples/integration_test_migration/pubspec.yaml +++ b/examples/integration_test_migration/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/internationalization/add_language/pubspec.yaml b/examples/internationalization/add_language/pubspec.yaml index fab91909269..c14bb9f42ea 100644 --- a/examples/internationalization/add_language/pubspec.yaml +++ b/examples/internationalization/add_language/pubspec.yaml @@ -2,7 +2,7 @@ name: add_language description: An i18n app example that adds a supported language environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/internationalization/gen_l10n_example/pubspec.yaml b/examples/internationalization/gen_l10n_example/pubspec.yaml index b12d258fd77..637d5de74aa 100644 --- a/examples/internationalization/gen_l10n_example/pubspec.yaml +++ b/examples/internationalization/gen_l10n_example/pubspec.yaml @@ -4,7 +4,7 @@ description: >- Example of an internationalized Flutter app that uses `flutter gen-l10n`. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 # #docregion flutter-localizations dependencies: diff --git a/examples/internationalization/intl_example/pubspec.yaml b/examples/internationalization/intl_example/pubspec.yaml index 5d3ef732b14..3d98729cc66 100644 --- a/examples/internationalization/intl_example/pubspec.yaml +++ b/examples/internationalization/intl_example/pubspec.yaml @@ -2,7 +2,7 @@ name: intl_example description: Example of a Flutter app using the intl library services. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/internationalization/minimal/pubspec.yaml b/examples/internationalization/minimal/pubspec.yaml index d718cc2566b..8c03586e486 100644 --- a/examples/internationalization/minimal/pubspec.yaml +++ b/examples/internationalization/minimal/pubspec.yaml @@ -2,7 +2,7 @@ name: l10n_example description: A minimal example of a localized Flutter app environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/base/pubspec.yaml b/examples/layout/base/pubspec.yaml index 2169f959bb5..4d3d0f452bb 100644 --- a/examples/layout/base/pubspec.yaml +++ b/examples/layout/base/pubspec.yaml @@ -4,7 +4,7 @@ description: > version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/card_and_stack/pubspec.yaml b/examples/layout/card_and_stack/pubspec.yaml index be031f6b0bc..8235c6e6bb2 100644 --- a/examples/layout/card_and_stack/pubspec.yaml +++ b/examples/layout/card_and_stack/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/constraints/pubspec.yaml b/examples/layout/constraints/pubspec.yaml index 9437877dccc..d8bda512398 100644 --- a/examples/layout/constraints/pubspec.yaml +++ b/examples/layout/constraints/pubspec.yaml @@ -3,7 +3,7 @@ description: example for ui/layout/constraints version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/container/pubspec.yaml b/examples/layout/container/pubspec.yaml index a00ee385b4a..726a22bb475 100644 --- a/examples/layout/container/pubspec.yaml +++ b/examples/layout/container/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/gallery/lib/bottom_navigation_demo.dart b/examples/layout/gallery/lib/bottom_navigation_demo.dart index 15c3146cb23..23e9626e743 100644 --- a/examples/layout/gallery/lib/bottom_navigation_demo.dart +++ b/examples/layout/gallery/lib/bottom_navigation_demo.dart @@ -114,7 +114,7 @@ class _BottomNavigationDemoState extends State }); }, selectedItemColor: colorScheme.onPrimary, - unselectedItemColor: colorScheme.onPrimary.withOpacity(0.38), + unselectedItemColor: colorScheme.onPrimary.withValues(alpha: 0.38), backgroundColor: colorScheme.primary, ), ), diff --git a/examples/layout/gallery/lib/cards_demo.dart b/examples/layout/gallery/lib/cards_demo.dart index 848b9446102..d0662bcf1ee 100644 --- a/examples/layout/gallery/lib/cards_demo.dart +++ b/examples/layout/gallery/lib/cards_demo.dart @@ -128,8 +128,10 @@ class TappableTravelDestinationItem extends StatelessWidget { shape: shape, child: InkWell( onTap: () {}, - splashColor: - Theme.of(context).colorScheme.onSurface.withOpacity(0.12), + splashColor: Theme.of(context) + .colorScheme + .onSurface + .withValues(alpha: 0.12), highlightColor: Colors.transparent, child: Semantics( label: destination.title, @@ -187,13 +189,13 @@ class SelectableTravelDestinationItem extends StatelessWidget { onLongPress: () { onSelected(); }, - splashColor: colorScheme.onSurface.withOpacity(0.12), + splashColor: colorScheme.onSurface.withValues(alpha: 0.12), highlightColor: Colors.transparent, child: Stack( children: [ Container( color: isSelected - ? colorScheme.primary.withOpacity(0.08) + ? colorScheme.primary.withValues(alpha: 0.08) : Colors.transparent, ), Semantics( diff --git a/examples/layout/gallery/lib/colors_demo.dart b/examples/layout/gallery/lib/colors_demo.dart index a10cce7626a..50f8e9bc7d5 100644 --- a/examples/layout/gallery/lib/colors_demo.dart +++ b/examples/layout/gallery/lib/colors_demo.dart @@ -145,9 +145,6 @@ class _ColorItem extends StatelessWidget { final Color color; final String prefix; - String get _colorString => - "#${color.value.toRadixString(16).padLeft(8, '0').toUpperCase()}"; - @override Widget build(BuildContext context) { return Semantics( @@ -161,19 +158,33 @@ class _ColorItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text('$prefix$index'), - Flexible(child: Text(_colorString)), + Flexible(child: Text(_argbColorString)), ], ), ), ); } + + static String _srgbComponentToHexString(double x) { + final value = (x * 255.0).round() & 0xff; + return value.toRadixString(16).toUpperCase(); + } + + String get _argbColorString { + final a = _srgbComponentToHexString(color.a); + final r = _srgbComponentToHexString(color.r); + final g = _srgbComponentToHexString(color.g); + final b = _srgbComponentToHexString(color.b); + return '#$a$r$g$b'; + } } class _PaletteTabView extends StatelessWidget { const _PaletteTabView({required this.colors}); final _Palette colors; - static const primaryKeys = [ + + static const List primaryKeys = [ 50, 100, 200, @@ -185,7 +196,7 @@ class _PaletteTabView extends StatelessWidget { 800, 900 ]; - static const accentKeys = [100, 200, 400, 700]; + static const List accentKeys = [100, 200, 400, 700]; @override Widget build(BuildContext context) { diff --git a/examples/layout/grid_and_list/pubspec.yaml b/examples/layout/grid_and_list/pubspec.yaml index be031f6b0bc..8235c6e6bb2 100644 --- a/examples/layout/grid_and_list/pubspec.yaml +++ b/examples/layout/grid_and_list/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/lakes/interactive/pubspec.yaml b/examples/layout/lakes/interactive/pubspec.yaml index 7ffeabac7b8..cc33f9535b8 100644 --- a/examples/layout/lakes/interactive/pubspec.yaml +++ b/examples/layout/lakes/interactive/pubspec.yaml @@ -5,7 +5,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/lakes/step2/pubspec.yaml b/examples/layout/lakes/step2/pubspec.yaml index df64fc0872e..b7862500870 100644 --- a/examples/layout/lakes/step2/pubspec.yaml +++ b/examples/layout/lakes/step2/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/lakes/step3/pubspec.yaml b/examples/layout/lakes/step3/pubspec.yaml index df64fc0872e..b7862500870 100644 --- a/examples/layout/lakes/step3/pubspec.yaml +++ b/examples/layout/lakes/step3/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/lakes/step4/pubspec.yaml b/examples/layout/lakes/step4/pubspec.yaml index df64fc0872e..b7862500870 100644 --- a/examples/layout/lakes/step4/pubspec.yaml +++ b/examples/layout/lakes/step4/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/lakes/step5/pubspec.yaml b/examples/layout/lakes/step5/pubspec.yaml index 2a93b995133..a1696b6b8e9 100644 --- a/examples/layout/lakes/step5/pubspec.yaml +++ b/examples/layout/lakes/step5/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/lakes/step6/pubspec.yaml b/examples/layout/lakes/step6/pubspec.yaml index 2a93b995133..a1696b6b8e9 100644 --- a/examples/layout/lakes/step6/pubspec.yaml +++ b/examples/layout/lakes/step6/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/non_material/pubspec.yaml b/examples/layout/non_material/pubspec.yaml index 5ff2332fdf7..f40e96728ab 100644 --- a/examples/layout/non_material/pubspec.yaml +++ b/examples/layout/non_material/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/pavlova/pubspec.yaml b/examples/layout/pavlova/pubspec.yaml index 06c650c46d2..d3030b29213 100644 --- a/examples/layout/pavlova/pubspec.yaml +++ b/examples/layout/pavlova/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/row_column/pubspec.yaml b/examples/layout/row_column/pubspec.yaml index d79d5673997..b5ec7409be8 100644 --- a/examples/layout/row_column/pubspec.yaml +++ b/examples/layout/row_column/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/layout/sizing/pubspec.yaml b/examples/layout/sizing/pubspec.yaml index d79d5673997..b5ec7409be8 100644 --- a/examples/layout/sizing/pubspec.yaml +++ b/examples/layout/sizing/pubspec.yaml @@ -4,7 +4,7 @@ description: >- version: 1.0.0 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/perf/concurrency/isolates/pubspec.yaml b/examples/perf/concurrency/isolates/pubspec.yaml index d1d19e20f15..bba956fa424 100644 --- a/examples/perf/concurrency/isolates/pubspec.yaml +++ b/examples/perf/concurrency/isolates/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/perf/deferred_components/pubspec.yaml b/examples/perf/deferred_components/pubspec.yaml index 0c0a92c3e0a..b13b4f09b89 100644 --- a/examples/perf/deferred_components/pubspec.yaml +++ b/examples/perf/deferred_components/pubspec.yaml @@ -3,7 +3,7 @@ description: Samples to showcase deferred component imports/loading. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/platform_integration/compose_activities/pubspec.yaml b/examples/platform_integration/compose_activities/pubspec.yaml index a764cee8e4e..3fdc6475711 100644 --- a/examples/platform_integration/compose_activities/pubspec.yaml +++ b/examples/platform_integration/compose_activities/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/platform_integration/pigeon/pubspec.yaml b/examples/platform_integration/pigeon/pubspec.yaml index 901a088b44c..304230d714f 100644 --- a/examples/platform_integration/pigeon/pubspec.yaml +++ b/examples/platform_integration/pigeon/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/platform_integration/platform_channels/pubspec.yaml b/examples/platform_integration/platform_channels/pubspec.yaml index 39bc9bf11aa..c90319caa2b 100644 --- a/examples/platform_integration/platform_channels/pubspec.yaml +++ b/examples/platform_integration/platform_channels/pubspec.yaml @@ -8,7 +8,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/platform_integration/platform_views/pubspec.yaml b/examples/platform_integration/platform_views/pubspec.yaml index 7be53eee38a..19de5b188b4 100644 --- a/examples/platform_integration/platform_views/pubspec.yaml +++ b/examples/platform_integration/platform_views/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/platform_integration/plugin_api_migration/pubspec.yaml b/examples/platform_integration/plugin_api_migration/pubspec.yaml index 55bb46592cd..3cedf44118c 100644 --- a/examples/platform_integration/plugin_api_migration/pubspec.yaml +++ b/examples/platform_integration/plugin_api_migration/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/resources/architectural_overview/pubspec.yaml b/examples/resources/architectural_overview/pubspec.yaml index ccd0f14e907..b0fabe870e6 100644 --- a/examples/resources/architectural_overview/pubspec.yaml +++ b/examples/resources/architectural_overview/pubspec.yaml @@ -3,7 +3,7 @@ description: Samples for the Flutter architectural overview. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/resources/dart_swift_concurrency/pubspec.yaml b/examples/resources/dart_swift_concurrency/pubspec.yaml index c9e17aa21e1..952c4894d6f 100644 --- a/examples/resources/dart_swift_concurrency/pubspec.yaml +++ b/examples/resources/dart_swift_concurrency/pubspec.yaml @@ -3,7 +3,7 @@ description: Examples for the Flutter concurrency for Swift developers article. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/state_mgmt/simple/pubspec.yaml b/examples/state_mgmt/simple/pubspec.yaml index 9600c56be71..3031be468f9 100644 --- a/examples/state_mgmt/simple/pubspec.yaml +++ b/examples/state_mgmt/simple/pubspec.yaml @@ -3,7 +3,7 @@ description: Sample state management code. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/testing/code_debugging/pubspec.yaml b/examples/testing/code_debugging/pubspec.yaml index 9b2c8ebabfe..fcf802cf65f 100644 --- a/examples/testing/code_debugging/pubspec.yaml +++ b/examples/testing/code_debugging/pubspec.yaml @@ -3,7 +3,7 @@ description: Examples to illustrate debugging your Flutter code. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/testing/common_errors/pubspec.yaml b/examples/testing/common_errors/pubspec.yaml index 1bd7a8ec89f..ab53ce38222 100644 --- a/examples/testing/common_errors/pubspec.yaml +++ b/examples/testing/common_errors/pubspec.yaml @@ -3,7 +3,7 @@ description: Excerpts for common Flutter errors. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/testing/errors/pubspec.yaml b/examples/testing/errors/pubspec.yaml index 8561d8d3a85..e8d0bdb860a 100644 --- a/examples/testing/errors/pubspec.yaml +++ b/examples/testing/errors/pubspec.yaml @@ -3,7 +3,7 @@ description: An error handling example. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/testing/integration_tests/how_to/pubspec.yaml b/examples/testing/integration_tests/how_to/pubspec.yaml index f5ff8e9ed7f..82bee526e88 100644 --- a/examples/testing/integration_tests/how_to/pubspec.yaml +++ b/examples/testing/integration_tests/how_to/pubspec.yaml @@ -3,7 +3,7 @@ description: An example of setting up an integration test. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/testing/native_debugging/pubspec.yaml b/examples/testing/native_debugging/pubspec.yaml index f7d992137ae..73fbd0890b4 100644 --- a/examples/testing/native_debugging/pubspec.yaml +++ b/examples/testing/native_debugging/pubspec.yaml @@ -1,11 +1,11 @@ name: native_debugging description: Demonstration of native code debugging -sdk: ^3.5.0 +sdk: ^3.6.0 version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/tools/pubspec.yaml b/examples/tools/pubspec.yaml index c45d9376e71..eeacac8beef 100644 --- a/examples/tools/pubspec.yaml +++ b/examples/tools/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/ui/adaptive_app_demos/lib/pages/adaptive_grid_page.dart b/examples/ui/adaptive_app_demos/lib/pages/adaptive_grid_page.dart index 3a66d465067..2f0b77464e7 100644 --- a/examples/ui/adaptive_app_demos/lib/pages/adaptive_grid_page.dart +++ b/examples/ui/adaptive_app_demos/lib/pages/adaptive_grid_page.dart @@ -107,7 +107,7 @@ class _GridItem extends StatelessWidget { onPressed: () => onPressed.call(index), child: Stack(children: [ const Center(child: FlutterLogo(size: 64)), - Container(color: Colors.grey.withOpacity(isSelected ? .5 : .7)), + Container(color: Colors.grey.withValues(alpha: isSelected ? .5 : .7)), Align( alignment: Alignment.bottomCenter, child: Container( diff --git a/examples/ui/adaptive_app_demos/pubspec.yaml b/examples/ui/adaptive_app_demos/pubspec.yaml index 69e8cdd7d1c..329f1bc73b0 100644 --- a/examples/ui/adaptive_app_demos/pubspec.yaml +++ b/examples/ui/adaptive_app_demos/pubspec.yaml @@ -3,7 +3,7 @@ description: Demo code for adaptive app development techniques. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/ui/advanced/actions_and_shortcuts/pubspec.yaml b/examples/ui/advanced/actions_and_shortcuts/pubspec.yaml index 93bdc07c3a5..b58d5dbe70a 100644 --- a/examples/ui/advanced/actions_and_shortcuts/pubspec.yaml +++ b/examples/ui/advanced/actions_and_shortcuts/pubspec.yaml @@ -3,7 +3,7 @@ description: Sample actions and shortcuts code. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/ui/advanced/focus/pubspec.yaml b/examples/ui/advanced/focus/pubspec.yaml index c607bb553c7..3ec40d5db05 100644 --- a/examples/ui/advanced/focus/pubspec.yaml +++ b/examples/ui/advanced/focus/pubspec.yaml @@ -3,7 +3,7 @@ description: Sample focus system code. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/ui/assets_and_images/pubspec.yaml b/examples/ui/assets_and_images/pubspec.yaml index 57e234ede07..f920b64f080 100644 --- a/examples/ui/assets_and_images/pubspec.yaml +++ b/examples/ui/assets_and_images/pubspec.yaml @@ -3,7 +3,7 @@ description: An example project showing how to declare and load assets. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/ui/interactive/pubspec.yaml b/examples/ui/interactive/pubspec.yaml index 83c79b60f12..b5a3e38332d 100644 --- a/examples/ui/interactive/pubspec.yaml +++ b/examples/ui/interactive/pubspec.yaml @@ -2,7 +2,7 @@ name: interactive description: Sample code for interactive.md environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/ui/widgets_intro/pubspec.yaml b/examples/ui/widgets_intro/pubspec.yaml index afc3b40e76c..a5ac3726bb9 100644 --- a/examples/ui/widgets_intro/pubspec.yaml +++ b/examples/ui/widgets_intro/pubspec.yaml @@ -3,7 +3,7 @@ description: Sample state management code. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/examples/visual_debugging/pubspec.yaml b/examples/visual_debugging/pubspec.yaml index 15b8196f2bf..55c2eaec2ce 100644 --- a/examples/visual_debugging/pubspec.yaml +++ b/examples/visual_debugging/pubspec.yaml @@ -3,7 +3,7 @@ publish_to: none description: Examples of visual debugging. environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: flutter: diff --git a/pubspec.yaml b/pubspec.yaml index cd386b0758d..5ab1ae96f92 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: docs_flutter_dev publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dev_dependencies: flutter_site: diff --git a/src/_data/site.yml b/src/_data/site.yml index 64dcfb84722..d6278332e74 100644 --- a/src/_data/site.yml +++ b/src/_data/site.yml @@ -91,7 +91,7 @@ targetmin: ## Software current versions appnow: - flutter: '3.24.5' + flutter: '3.27.0' vscode: '1.95' android_studio: '2024.2' android_sdk: '35.0.1' diff --git a/src/content/cookbook/effects/download-button.md b/src/content/cookbook/effects/download-button.md index 6c09199359c..18c1bdc5de5 100644 --- a/src/content/cookbook/effects/download-button.md +++ b/src/content/cookbook/effects/download-button.md @@ -176,15 +176,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -242,15 +243,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -803,15 +805,16 @@ class ButtonShapeWidget extends StatelessWidget { @override Widget build(BuildContext context) { - var shape = const ShapeDecoration( - shape: StadiumBorder(), - color: CupertinoColors.lightBackgroundGray, - ); - + final ShapeDecoration shape; if (isDownloading || isFetching) { - shape = ShapeDecoration( - shape: const CircleBorder(), - color: Colors.white.withOpacity(0), + shape = const ShapeDecoration( + shape: CircleBorder(), + color: Colors.transparent, + ); + } else { + shape = const ShapeDecoration( + shape: StadiumBorder(), + color: CupertinoColors.lightBackgroundGray, ); } @@ -864,7 +867,7 @@ class ProgressIndicatorWidget extends StatelessWidget { return CircularProgressIndicator( backgroundColor: isDownloading ? CupertinoColors.lightBackgroundGray - : Colors.white.withOpacity(0), + : Colors.transparent, valueColor: AlwaysStoppedAnimation(isFetching ? CupertinoColors.lightBackgroundGray : CupertinoColors.activeBlue), diff --git a/src/content/cookbook/effects/parallax-scrolling.md b/src/content/cookbook/effects/parallax-scrolling.md index 6ed1f424646..1a024947293 100644 --- a/src/content/cookbook/effects/parallax-scrolling.md +++ b/src/content/cookbook/effects/parallax-scrolling.md @@ -117,7 +117,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], @@ -673,7 +673,7 @@ class LocationListItem extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - colors: [Colors.transparent, Colors.black.withOpacity(0.7)], + colors: [Colors.transparent, Colors.black.withValues(alpha: 0.7)], begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: const [0.6, 0.95], diff --git a/src/content/get-started/codelab-web.md b/src/content/get-started/codelab-web.md index b29adcdbe93..21fbc8c487c 100644 --- a/src/content/get-started/codelab-web.md +++ b/src/content/get-started/codelab-web.md @@ -830,7 +830,7 @@ class _AnimatedProgressIndicatorState extends State builder: (context, child) => LinearProgressIndicator( value: _curveAnimation.value, valueColor: _colorAnimation, - backgroundColor: _colorAnimation.value?.withOpacity(0.4), + backgroundColor: _colorAnimation.value?.withValues(alpha: 0.4), ), ); } @@ -1080,7 +1080,7 @@ class _AnimatedProgressIndicatorState extends State builder: (context, child) => LinearProgressIndicator( value: _curveAnimation.value, valueColor: _colorAnimation, - backgroundColor: _colorAnimation.value?.withOpacity(0.4), + backgroundColor: _colorAnimation.value?.withValues(alpha: 0.4), ), ); } diff --git a/src/content/release/breaking-changes/buttons.md b/src/content/release/breaking-changes/buttons.md index 56be77110be..18d47ced35c 100644 --- a/src/content/release/breaking-changes/buttons.md +++ b/src/content/release/breaking-changes/buttons.md @@ -103,10 +103,10 @@ TextButton( overlayColor: MaterialStateProperty.resolveWith( (Set states) { if (states.contains(MaterialState.hovered)) - return Colors.blue.withOpacity(0.04); + return Colors.blue.withValues(alpha: 0.04); if (states.contains(MaterialState.focused) || states.contains(MaterialState.pressed)) - return Colors.blue.withOpacity(0.12); + return Colors.blue.withValues(alpha: 0.12); return null; // Defer to the widget's default. }, ), @@ -455,8 +455,8 @@ can just use the `styleFrom` method to override the disabled colors: ```dart RaisedButton( - disabledColor: Colors.red.withOpacity(0.12), - disabledTextColor: Colors.red.withOpacity(0.38), + disabledColor: Colors.red.withValues(alpha: 0.12), + disabledTextColor: Colors.red.withValues(alpha: 0.38), onPressed: null, child: Text('RaisedButton with custom disabled colors'), ), diff --git a/src/content/tools/pubspec.md b/src/content/tools/pubspec.md index fba92b946b8..70c1e99323a 100644 --- a/src/content/tools/pubspec.md +++ b/src/content/tools/pubspec.md @@ -64,7 +64,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: [!flutter:!] # Required for every Flutter project diff --git a/src/content/ui/animations/hero-animations.md b/src/content/ui/animations/hero-animations.md index 7420da9c05b..3b146b5d7fc 100644 --- a/src/content/ui/animations/hero-animations.md +++ b/src/content/ui/animations/hero-animations.md @@ -514,7 +514,7 @@ class Photo extends StatelessWidget { Widget build(BuildContext context) { return [!Material(!] // Slightly opaque color appears where the image has transparency. - [!color: Theme.of(context).primaryColor.withOpacity(0.25),!] + [!color: Theme.of(context).primaryColor.withValues(alpha: 0.25),!] child: [!InkWell(!] onTap: [!onTap,!] child: [!Image.asset(!] diff --git a/src/content/ui/animations/staggered-animations.md b/src/content/ui/animations/staggered-animations.md index c66e7e7da22..07afb0b8ec4 100644 --- a/src/content/ui/animations/staggered-animations.md +++ b/src/content/ui/animations/staggered-animations.md @@ -325,9 +325,9 @@ class _StaggerDemoState extends State width: 300, height: 300, decoration: BoxDecoration( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), border: Border.all( - color: Colors.black.withOpacity(0.5), + color: Colors.black.withValues(alpha: 0.5), ), ), child: StaggerAnimation(controller:_controller.view), diff --git a/tool/flutter_site/pubspec.yaml b/tool/flutter_site/pubspec.yaml index be85d9e1d3a..7486fd16fc0 100644 --- a/tool/flutter_site/pubspec.yaml +++ b/tool/flutter_site/pubspec.yaml @@ -3,7 +3,7 @@ description: Dart-based tools for building docs.flutter.dev. publish_to: none environment: - sdk: ^3.5.0 + sdk: ^3.6.0 dependencies: args: ^2.4.2