From 4ab05674f20dbba0e5c97a6c47e0fc57b3473ad4 Mon Sep 17 00:00:00 2001 From: Aniket Khote Date: Fri, 13 Dec 2024 16:16:31 +0530 Subject: [PATCH] compatible with flutter 3.27 --- .github/workflows/main.yml | 6 +++--- analysis_options.yaml | 3 +++ .../pages/home/presentation/views/details_view.dart | 6 +++--- .../pages/home/presentation/views/home_view.dart | 13 +++++++------ example_nav2/android/local.properties | 4 ++-- lib/get.dart | 2 +- lib/get_animations/animations.dart | 2 +- .../http/src/response/client_response.dart | 1 - lib/get_core/get_core.dart | 2 +- lib/get_navigation/get_navigation.dart | 2 +- lib/get_navigation/src/extension_navigation.dart | 2 +- .../src/routes/get_router_delegate.dart | 4 ---- lib/get_navigation/src/snackbar/snackbar.dart | 2 +- lib/get_rx/get_rx.dart | 2 +- lib/get_rx/src/rx_stream/rx_stream.dart | 2 +- lib/get_rx/src/rx_types/rx_types.dart | 2 +- lib/get_state_manager/get_state_manager.dart | 2 +- lib/get_utils/src/equality/equality.dart | 2 +- lib/instance_manager.dart | 2 +- lib/route_manager.dart | 2 +- lib/state_manager.dart | 2 +- lib/utils.dart | 2 +- pubspec.yaml | 4 ++-- 23 files changed, 35 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84558809b..f80b83942 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,12 +18,12 @@ jobs: steps: # The branch or tag ref that triggered the workflow will be checked out. # https://github.com/actions/checkout - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Setup a flutter environment. # https://github.com/marketplace/actions/flutter-action - uses: subosito/flutter-action@v2 with: - flutter-version: "3.24.0" + flutter-version: "3.27.0" channel: "stable" - run: flutter pub get #- run: flutter analyze @@ -31,4 +31,4 @@ jobs: - run: flutter test --coverage # Upload coverage reports to Codecov # https://github.com/marketplace/actions/codecov - - uses: codecov/codecov-action@v1.0.7 + - uses: codecov/codecov-action@v4 diff --git a/analysis_options.yaml b/analysis_options.yaml index 546dab0b4..7c2ab02e2 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,7 @@ # Include option is buggy: include: package:flutter_lints/flutter.yaml +analyzer: + errors: + unintended_html_in_doc_comment: ignore # In case the include issue gets fixed, lines below INCLUDE_FIX # can be removed diff --git a/example/lib/pages/home/presentation/views/details_view.dart b/example/lib/pages/home/presentation/views/details_view.dart index a1204775b..e2ff9b959 100644 --- a/example/lib/pages/home/presentation/views/details_view.dart +++ b/example/lib/pages/home/presentation/views/details_view.dart @@ -23,7 +23,7 @@ class DetailsView extends GetView { image: DecorationImage( fit: BoxFit.cover, colorFilter: ColorFilter.mode( - Colors.black.withOpacity(0.2), + Colors.black.withValues(alpha: 0.2), BlendMode.darken, ), image: NetworkImage( @@ -60,8 +60,8 @@ class DetailsView extends GetView { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(25), ), - shadowColor: Colors.blueAccent.withOpacity(0.5), - color: Colors.white.withOpacity(0.85), + shadowColor: Colors.blueAccent.withValues(alpha: 0.5), + color: Colors.white.withValues(alpha: 0.85), child: Padding( padding: const EdgeInsets.all(32.0), child: Column( diff --git a/example/lib/pages/home/presentation/views/home_view.dart b/example/lib/pages/home/presentation/views/home_view.dart index 4e23ae170..c59861c1e 100644 --- a/example/lib/pages/home/presentation/views/home_view.dart +++ b/example/lib/pages/home/presentation/views/home_view.dart @@ -23,7 +23,7 @@ class HomeView extends GetView { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), child: Scaffold( - backgroundColor: Colors.black.withOpacity(0.6), + backgroundColor: Colors.black.withValues(alpha: 0.6), extendBodyBehindAppBar: true, appBar: AppBar( title: Text( @@ -45,14 +45,14 @@ class HomeView extends GetView { 'New Feature', 'Coming soon!', snackPosition: SnackPosition.bottom, - backgroundColor: Colors.white.withOpacity(0.9), + backgroundColor: Colors.white.withValues(alpha: 0.9), colorText: Colors.black, borderRadius: 10, duration: Duration(seconds: 3), animationDuration: Duration(milliseconds: 500), boxShadows: [ BoxShadow( - color: Colors.black.withOpacity(0.2), + color: Colors.black.withValues(alpha: 0.2), spreadRadius: 1, blurRadius: 5, offset: Offset(0, 3), @@ -70,14 +70,15 @@ class HomeView extends GetView { ElevatedButton( style: ElevatedButton.styleFrom( foregroundColor: Colors.white, - backgroundColor: Colors.blueAccent.withOpacity(0.8), + backgroundColor: + Colors.blueAccent.withValues(alpha: 0.8), padding: EdgeInsets.symmetric(horizontal: 24, vertical: 16), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(30), ), elevation: 8, - shadowColor: Colors.blueAccent.withOpacity(0.5), + shadowColor: Colors.blueAccent.withValues(alpha: 0.5), ), onPressed: () { Get.updateLocale(Get.locale?.languageCode == 'en' @@ -108,7 +109,7 @@ class HomeView extends GetView { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), - color: Colors.white.withOpacity(0.9), + color: Colors.white.withValues(alpha: 0.9), child: ListTile( onTap: () async { final data = await Get.toNamed( diff --git a/example_nav2/android/local.properties b/example_nav2/android/local.properties index 79defc581..cebbb54d3 100644 --- a/example_nav2/android/local.properties +++ b/example_nav2/android/local.properties @@ -1,2 +1,2 @@ -sdk.dir=/Users/jonatasborges/Library/Android/sdk -flutter.sdk=/Users/jonatasborges/flutter \ No newline at end of file +sdk.dir=C:\\Users\\anike\\AppData\\Local\\Android\\sdk +flutter.sdk=C:\\flutter \ No newline at end of file diff --git a/lib/get.dart b/lib/get.dart index 115e53c72..50ae18ec4 100644 --- a/lib/get.dart +++ b/lib/get.dart @@ -1,7 +1,7 @@ /// GetX is an extra-light and powerful multi-platform framework. /// It combines high performance state management, intelligent dependency /// injection, and route management in a quick and practical way. -library get; +library; export 'get_animations/index.dart'; export 'get_common/get_reset.dart'; diff --git a/lib/get_animations/animations.dart b/lib/get_animations/animations.dart index e996bddff..bb96b2952 100644 --- a/lib/get_animations/animations.dart +++ b/lib/get_animations/animations.dart @@ -373,7 +373,7 @@ class ColorAnimation extends GetAnimatedBuilder { }) : super( builder: (context, value, child) => ColorFiltered( colorFilter: ColorFilter.mode( - Color.lerp(begin, end, value!.value.toDouble())!, + Color.lerp(begin, end, value!.a.toDouble())!, BlendMode.srcIn, ), child: child, diff --git a/lib/get_connect/http/src/response/client_response.dart b/lib/get_connect/http/src/response/client_response.dart index 2f997f43e..092175788 100644 --- a/lib/get_connect/http/src/response/client_response.dart +++ b/lib/get_connect/http/src/response/client_response.dart @@ -195,7 +195,6 @@ abstract interface class HttpHeaders { static const cookieHeader = "cookie"; static const setCookieHeader = "set-cookie"; - // TODO(39783): Document this. static const generalHeaders = [ cacheControlHeader, connectionHeader, diff --git a/lib/get_core/get_core.dart b/lib/get_core/get_core.dart index a1e59d9cd..bace51f80 100644 --- a/lib/get_core/get_core.dart +++ b/lib/get_core/get_core.dart @@ -1,4 +1,4 @@ -library get_core; +library; export 'src/flutter_engine.dart'; export 'src/get_interface.dart'; diff --git a/lib/get_navigation/get_navigation.dart b/lib/get_navigation/get_navigation.dart index ba7c36954..083c3eb13 100644 --- a/lib/get_navigation/get_navigation.dart +++ b/lib/get_navigation/get_navigation.dart @@ -1,4 +1,4 @@ -library get_navigation; +library; export 'src/bottomsheet/bottomsheet.dart'; export 'src/extension_navigation.dart'; diff --git a/lib/get_navigation/src/extension_navigation.dart b/lib/get_navigation/src/extension_navigation.dart index 13718e4ac..d94a53d51 100644 --- a/lib/get_navigation/src/extension_navigation.dart +++ b/lib/get_navigation/src/extension_navigation.dart @@ -444,7 +444,7 @@ extension ExtensionSnackbar on GetInterface { margin: margin ?? const EdgeInsets.symmetric(horizontal: 10), duration: duration, barBlur: barBlur ?? 7.0, - backgroundColor: backgroundColor ?? Colors.grey.withOpacity(0.2), + backgroundColor: backgroundColor ?? Colors.grey.withValues(alpha: 0.2), icon: icon, shouldIconPulse: shouldIconPulse ?? true, maxWidth: maxWidth, diff --git a/lib/get_navigation/src/routes/get_router_delegate.dart b/lib/get_navigation/src/routes/get_router_delegate.dart index d05023454..f7fe2b736 100644 --- a/lib/get_navigation/src/routes/get_router_delegate.dart +++ b/lib/get_navigation/src/routes/get_router_delegate.dart @@ -255,8 +255,6 @@ class GetDelegate extends RouterDelegate return await _popHistory(result); case PopMode.page: return await _popPage(result); - default: - return null; } } @@ -760,8 +758,6 @@ class GetDelegate extends RouterDelegate case PreventDuplicateHandlingMode.recreate: _activePages.remove(onStackPage); _activePages.add(res); - break; - default: } } if (rebuildStack) { diff --git a/lib/get_navigation/src/snackbar/snackbar.dart b/lib/get_navigation/src/snackbar/snackbar.dart index 9db02265a..104f18d76 100644 --- a/lib/get_navigation/src/snackbar/snackbar.dart +++ b/lib/get_navigation/src/snackbar/snackbar.dart @@ -165,7 +165,7 @@ class GetSnackBar extends StatefulWidget { /// Default is [Colors.transparent]. Only takes effect if [overlayBlur] > 0.0. /// Make sure you use a color with transparency here e.g. - /// Colors.grey[600].withOpacity(0.2). + /// Colors.grey[600].withValues(alpha:0.2). final Color? overlayColor; /// A [TextFormField] in case you want a simple user input. diff --git a/lib/get_rx/get_rx.dart b/lib/get_rx/get_rx.dart index 88565d8b9..cafdb929f 100644 --- a/lib/get_rx/get_rx.dart +++ b/lib/get_rx/get_rx.dart @@ -1,4 +1,4 @@ -library get_rx; +library; export 'src/rx_stream/rx_stream.dart'; export 'src/rx_types/rx_types.dart'; diff --git a/lib/get_rx/src/rx_stream/rx_stream.dart b/lib/get_rx/src/rx_stream/rx_stream.dart index 52c4c0d51..36adc51c7 100644 --- a/lib/get_rx/src/rx_stream/rx_stream.dart +++ b/lib/get_rx/src/rx_stream/rx_stream.dart @@ -1,4 +1,4 @@ -library rx_stream; +library; import 'dart:async'; diff --git a/lib/get_rx/src/rx_types/rx_types.dart b/lib/get_rx/src/rx_types/rx_types.dart index 223d9aad5..c4e701ae8 100644 --- a/lib/get_rx/src/rx_types/rx_types.dart +++ b/lib/get_rx/src/rx_types/rx_types.dart @@ -1,4 +1,4 @@ -library rx_types; +library; import 'dart:async'; import 'dart:collection'; diff --git a/lib/get_state_manager/get_state_manager.dart b/lib/get_state_manager/get_state_manager.dart index 8ccdb23ff..e9419c9a0 100644 --- a/lib/get_state_manager/get_state_manager.dart +++ b/lib/get_state_manager/get_state_manager.dart @@ -1,4 +1,4 @@ -library get_state_manager; +library; export 'src/rx_flutter/rx_getx_widget.dart'; export 'src/rx_flutter/rx_notifier.dart'; diff --git a/lib/get_utils/src/equality/equality.dart b/lib/get_utils/src/equality/equality.dart index be5edfba8..63bb37350 100644 --- a/lib/get_utils/src/equality/equality.dart +++ b/lib/get_utils/src/equality/equality.dart @@ -1,4 +1,4 @@ -library equality; +library; import 'dart:collection'; diff --git a/lib/instance_manager.dart b/lib/instance_manager.dart index e48a062e9..08f7d4ffa 100644 --- a/lib/instance_manager.dart +++ b/lib/instance_manager.dart @@ -1,6 +1,6 @@ /// Get Instance Manager is a modern and intelligent dependency injector /// that injects and removes dependencies seasonally. -library instance_manager; +library; export 'get_core/get_core.dart'; export 'get_instance/get_instance.dart'; diff --git a/lib/route_manager.dart b/lib/route_manager.dart index 02fe6fbea..86ad88124 100644 --- a/lib/route_manager.dart +++ b/lib/route_manager.dart @@ -1,6 +1,6 @@ ///Get Navigator allows you to navigate routes, open snackbars, ///dialogs and bottomsheets easily, and without the need for context. -library route_manager; +library; export 'get_core/get_core.dart'; export 'get_navigation/get_navigation.dart'; diff --git a/lib/state_manager.dart b/lib/state_manager.dart index 5b48bc844..530b017ee 100644 --- a/lib/state_manager.dart +++ b/lib/state_manager.dart @@ -1,5 +1,5 @@ /// Get State Manager is a light, modern and powerful state manager to Flutter -library state_manager; +library; export 'get_core/get_core.dart'; export 'get_rx/get_rx.dart'; diff --git a/lib/utils.dart b/lib/utils.dart index cd447f9ed..49e870701 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -1,6 +1,6 @@ /// Get utils is a set of tools that allows you to access high-level /// APIs and obtain validation tools for Flutter and GetX -library utils; +library; export 'get_core/get_core.dart'; export 'get_utils/get_utils.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 2d12bd35b..bdfa85239 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,10 +12,10 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - web: ">=0.5.0 <2.0.0" + web: ">=1.0.0 <2.0.0" dev_dependencies: - flutter_lints: ^4.0.0 + flutter_lints: ^5.0.0 flutter_test: sdk: flutter