Skip to content

Commit

Permalink
feat(sdk): update dependency flutter to v3.27.2 (#1449)
Browse files Browse the repository at this point in the history
* feat(sdk): update dependency flutter to v3.27.2

* chore(deps): dependencies maintenance

* style: fix deprecated usages

* fix: package compatibility issues

* fix: update podfile lock and app delegate file

* test: fix color picker tests

* chore(deps): dependencies maintenance

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com>
Co-authored-by: Joshua Tang <[email protected]>
Co-authored-by: zeshuaro <[email protected]>
  • Loading branch information
4 people authored Jan 28, 2025
1 parent 476de18 commit 30e0741
Show file tree
Hide file tree
Showing 49 changed files with 299 additions and 289 deletions.
2 changes: 1 addition & 1 deletion .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.24.5",
"flutterSdkVersion": "3.27.2",
"flavors": {}
}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ doc/api/
.pub-cache/
.pub/
coverage/
lib/generated_plugin_registrant.dart
# For library packages, don’t commit the pubspec.lock file.
# Regenerating the pubspec.lock file lets you test your package against the latest compatible versions of its dependencies.
# See https://dart.dev/guides/libraries/private-files#pubspeclock
Expand Down Expand Up @@ -457,4 +456,4 @@ fabric.properties

# End of https://www.toptal.com/developers/gitignore/api/dart,macos,android,flutter,firebase,androidstudio,visualstudiocode,node

*.g.dart
*.g.dart
8 changes: 4 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using the generated theme

Appainter uses the package [json_theme_plus](https://pub.dev/packages/json_theme_plus) (credits to the original package [json_theme](https://pub.dev/packages/json_theme)) to encode and decode the theme JSON file.
Appainter uses the package [json_theme](https://pub.dev/packages/json_theme) to encode and decode the theme JSON file.

## Theme compatibility

Expand All @@ -14,11 +14,11 @@ If you need to use the theme JSON file in a specific Flutter version, you can fi

To use the theme JSON file in your app, follow the steps below:

1. Add `json_theme_plus` as a dependency in your `pubspec.yaml` file.
1. Add `json_theme` as a dependency in your `pubspec.yaml` file.

```yml
dependencies:
json_theme_plus: ^6.6.1
json_theme: ^7.0.0+3
```
2. Copy the generated `json` file to your app project and place it under the `assets/` folder.
Expand All @@ -35,7 +35,7 @@ To use the theme JSON file in your app, follow the steps below:

```dart
import 'package:flutter/material.dart';
import 'package:json_theme_plus/json_theme_plus.dart';
import 'package:json_theme/json_theme.dart';
import 'package:flutter/services.dart'; // For rootBundle
import 'dart:convert'; // For jsonDecode
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:json_theme_plus/json_theme_plus.dart';
import 'package:json_theme/json_theme.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand Down
54 changes: 27 additions & 27 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -138,6 +138,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.2.0"
json_theme:
dependency: "direct main"
description:
name: json_theme
sha256: "3529d038fec78f745faa80818f797d47a1ba9ef6f7ac99bea9019d66d6ee094c"
url: "https://pub.dev"
source: hosted
version: "7.0.0+3"
json_theme_annotation:
dependency: transitive
description:
Expand All @@ -146,30 +154,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.3+14"
json_theme_plus:
dependency: "direct main"
description:
name: json_theme_plus
sha256: "34824b7d9aa1b30a50be06a3355ff5abf87c29d7e97b872199586e61185d692a"
url: "https://pub.dev"
source: hosted
version: "6.6.4"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -262,7 +262,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_span:
dependency: transitive
description:
Expand All @@ -275,10 +275,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
Expand All @@ -291,10 +291,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
sync_http:
dependency: transitive
description:
Expand All @@ -315,10 +315,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -347,10 +347,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
web:
dependency: transitive
description:
Expand All @@ -363,10 +363,10 @@ packages:
dependency: transitive
description:
name: webdriver
sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e"
sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.4"
sdks:
dart: ">=3.5.4 <4.0.0"
flutter: ">=3.24.4"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
cupertino_icons: 1.0.8
flutter:
sdk: flutter
json_theme_plus: 6.6.4
json_theme: 7.0.0+3

dev_dependencies:
flutter_driver:
Expand Down
1 change: 1 addition & 0 deletions lib/basic_theme/basic_theme_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class BasicThemeService {
}

Color _getColorFromTone(Color color, int tone) {
// ignore: deprecated_member_use
final palette = CorePalette.of(color.value);
return Color(palette.primary.get(tone));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ abstract class AbstractFlatButtonStyleEditor<

@override
Color fallbackForegroundDisabledColor(ColorScheme colorScheme) {
return colorScheme.onSurface.withOpacity(0.38);
return colorScheme.onSurface.withValues(alpha: 0.38);
}

@override
Color fallbackOverlayFocusedColor(ColorScheme colorScheme) {
return colorScheme.primary.withOpacity(0.12);
return colorScheme.primary.withValues(alpha: 0.12);
}

@override
Color fallbackOverlayHoveredColor(ColorScheme colorScheme) {
return colorScheme.primary.withOpacity(0.04);
return colorScheme.primary.withValues(alpha: 0.04);
}

@override
Color fallbackOverlayPressedColor(ColorScheme colorScheme) {
return colorScheme.primary.withOpacity(0.12);
return colorScheme.primary.withValues(alpha: 0.12);
}

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class ElevatedButtonThemeCubit extends AbstractButtonStyleCubit {
return ElevatedButton.styleFrom(
backgroundColor: colorScheme.primary,
foregroundColor: colorScheme.onPrimary,
disabledBackgroundColor: colorScheme.onSurface.withOpacity(0.12),
disabledForegroundColor: colorScheme.onSurface.withOpacity(0.38),
disabledBackgroundColor: colorScheme.onSurface.withValues(alpha: 0.12),
disabledForegroundColor: colorScheme.onSurface.withValues(alpha: 0.38),
shadowColor: colorScheme.shadow,
elevation: 2,
minimumSize: const Size(64, 36),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ class ElevatedButtonThemeEditor

@override
Color fallbackForegroundDisabledColor(ColorScheme colorScheme) {
return colorScheme.onSurface.withOpacity(0.38);
return colorScheme.onSurface.withValues(alpha: 0.38);
}

@override
Color fallbackOverlayFocusedColor(ColorScheme colorScheme) {
return colorScheme.onPrimary.withOpacity(0.24);
return colorScheme.onPrimary.withValues(alpha: 0.24);
}

@override
Color fallbackOverlayHoveredColor(ColorScheme colorScheme) {
return colorScheme.onPrimary.withOpacity(0.08);
return colorScheme.onPrimary.withValues(alpha: 0.08);
}

@override
Color fallbackOverlayPressedColor(ColorScheme colorScheme) {
return colorScheme.onPrimary.withOpacity(0.24);
return colorScheme.onPrimary.withValues(alpha: 0.24);
}

@override
Expand All @@ -59,7 +59,7 @@ class ElevatedButtonThemeEditor
key: const Key('elevatedButtonThemeEditor_backgroundColor_disabled'),
title: 'Disabled',
value: color?.resolve({WidgetState.disabled}) ??
colorScheme.onSurface.withOpacity(0.12),
colorScheme.onSurface.withValues(alpha: 0.12),
onValueChanged: cubit.backgroundDisabledColorChanged,
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class FilledButtonThemeCubit extends AbstractFlatButtonStyleCubit {
return FilledButton.styleFrom(
backgroundColor: colorScheme.secondaryContainer,
foregroundColor: colorScheme.onSecondaryContainer,
disabledBackgroundColor: colorScheme.onSurface.withOpacity(0.12),
disabledForegroundColor: colorScheme.onSurface.withOpacity(0.38),
disabledBackgroundColor: colorScheme.onSurface.withValues(alpha: 0.12),
disabledForegroundColor: colorScheme.onSurface.withValues(alpha: 0.38),
shadowColor: colorScheme.shadow,
elevation: 0,
minimumSize: const Size(64, 40),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class OutlinedButtonThemeCubit extends AbstractFlatButtonStyleCubit {
return OutlinedButton.styleFrom(
foregroundColor: colorScheme.primary,
backgroundColor: Colors.transparent,
disabledForegroundColor: colorScheme.onSurface.withOpacity(0.38),
disabledForegroundColor: colorScheme.onSurface.withValues(alpha: 0.38),
shadowColor: colorScheme.shadow,
elevation: 0,
minimumSize: const Size(64, 36),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TextButtonThemeCubit extends AbstractFlatButtonStyleCubit {
ButtonStyle getDefaultStyle(ColorScheme colorScheme) {
return TextButton.styleFrom(
foregroundColor: colorScheme.primary,
disabledForegroundColor: colorScheme.onSurface.withOpacity(0.38),
disabledForegroundColor: colorScheme.onSurface.withValues(alpha: 0.38),
backgroundColor: Colors.transparent,
shadowColor: colorScheme.shadow,
elevation: 0,
Expand Down
2 changes: 1 addition & 1 deletion lib/home/home_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:dio/dio.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:json_theme_plus/json_theme_plus.dart';
import 'package:json_theme/json_theme.dart';
import 'package:pretty_json/pretty_json.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/home/views/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HomePage extends StatefulWidget {
}

class HomePageState extends State<HomePage> {
static const _sdkVersion = '3.24.0+';
static const _sdkVersion = '3.27.0+';
static final _backgroundColorDark = Colors.grey[900]!;
static final _backgroundColorLight = Colors.grey[200]!;

Expand Down
10 changes: 5 additions & 5 deletions lib/services/util_service.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:appainter/common/consts.dart';
import 'package:enum_to_string/enum_to_string.dart';
import 'package:flutter/material.dart';
import 'package:appainter/common/consts.dart';
import 'package:url_launcher/url_launcher.dart' as url_launcher;

class UtilService {
static Map<int, Color> getColorSwatch(Color color) {
final swatch = <int, Color>{};
final strengths = <double>[.05];
final r = color.red, g = color.green, b = color.blue;
final r = color.r, g = color.g, b = color.b;

for (int i = 1; i < 10; i++) {
strengths.add(0.1 * i);
Expand All @@ -16,9 +16,9 @@ class UtilService {
for (var strength in strengths) {
final double ds = 0.5 - strength;
swatch[(strength * 1000).round()] = Color.fromRGBO(
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
(r + ((ds < 0 ? r : (255 - r)) * ds)).round(),
(g + ((ds < 0 ? g : (255 - g)) * ds)).round(),
(b + ((ds < 0 ? b : (255 - b)) * ds)).round(),
1,
);
}
Expand Down
Loading

0 comments on commit 30e0741

Please sign in to comment.