Skip to content

Commit

Permalink
Flutter 3.22 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ferraridamiano committed May 17, 2024
1 parent 9b01f4a commit 87c448d
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 177 deletions.
2 changes: 1 addition & 1 deletion lib/pages/error_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ErrorPage extends StatelessWidget {
),
onPressed: () => context.go('/'),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(
backgroundColor: WidgetStateProperty.all<Color>(
Theme.of(context).primaryColor),
),
)
Expand Down
15 changes: 7 additions & 8 deletions packages/calculator_widget/lib/animated_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class _AnimatedButtonState extends State<AnimatedButton>
with SingleTickerProviderStateMixin {
late Animation<double> _animation;
late AnimationController _animationController;
late final MaterialStatesController _materialStatesController =
MaterialStatesController();
late final _materialStatesController = WidgetStatesController();

late Color backgroundColor;
late Color foregroundColor;
Expand All @@ -44,7 +43,7 @@ class _AnimatedButtonState extends State<AnimatedButton>
if (!kIsWeb &&
(Platform.isAndroid || Platform.isIOS || Platform.isFuchsia)) {
_materialStatesController.addListener(() {
if (_materialStatesController.value.contains(MaterialState.pressed)) {
if (_materialStatesController.value.contains(WidgetState.pressed)) {
_animationController.forward();
} else {
_animationController.reverse();
Expand Down Expand Up @@ -100,7 +99,7 @@ class _ElevatedButtonTransition extends AnimatedWidget {
final void Function()? onPressed;
final void Function()? onLongPress;
final void Function(bool)? onHover;
final MaterialStatesController? materialStatesController;
final WidgetStatesController? materialStatesController;
final Widget child;
final Color foregroundColor;
final Color backgroundColor;
Expand All @@ -127,11 +126,11 @@ class _ElevatedButtonTransition extends AnimatedWidget {
borderRadius: BorderRadius.circular(radius.value),
),
).copyWith(
overlayColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) => Colors.transparent,
overlayColor: WidgetStateProperty.resolveWith<Color?>(
(Set<WidgetState> states) => Colors.transparent,
),
backgroundColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) => states.contains(MaterialState.pressed)
backgroundColor: WidgetStateProperty.resolveWith<Color?>(
(Set<WidgetState> states) => states.contains(WidgetState.pressed)
? Color.alphaBlend(
Theme.of(context).brightness == Brightness.light
? Colors.black.withOpacity(0.18)
Expand Down
8 changes: 4 additions & 4 deletions packages/calculator_widget/lib/calculator_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _CalculatorWidget extends ConsumerWidget {
flex: 2,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
borderRadius: const BorderRadius.all(Radius.circular(30)),
),
child: Column(
Expand Down Expand Up @@ -109,7 +109,7 @@ class CalculatorHeader extends ConsumerWidget {
style: TextStyle(
fontSize: 45.0,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
),
maxLines: 1,
textScaler: TextScaler.noScaling,
Expand All @@ -125,7 +125,7 @@ class CalculatorHeader extends ConsumerWidget {
tooltip: AppLocalizations.of(context)?.copy,
icon: Icon(
Icons.content_copy,
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
),
onPressed: () {
Clipboard.setData(ClipboardData(text: text));
Expand All @@ -137,7 +137,7 @@ class CalculatorHeader extends ConsumerWidget {
style: TextStyle(
fontSize: 45.0,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
),
textScaler: TextScaler.noScaling,
maxLines: 1,
Expand Down
40 changes: 20 additions & 20 deletions packages/calculator_widget/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ packages:
dependency: "direct main"
description:
name: flutter_riverpod
sha256: "4bce556b7ecbfea26109638d5237684538d4abc509d253e6c5c4c5733b360098"
sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d"
url: "https://pub.dev"
source: hosted
version: "2.4.10"
version: "2.5.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -92,34 +92,34 @@ packages:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -148,10 +148,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
path:
dependency: transitive
description:
Expand All @@ -172,10 +172,10 @@ packages:
dependency: transitive
description:
name: riverpod
sha256: "548e2192eb7aeb826eb89387f814edb76594f3363e2c0bb99dd733d795ba3589"
sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d
url: "https://pub.dev"
source: hosted
version: "2.5.0"
version: "2.5.1"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -233,10 +233,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
translations:
dependency: "direct main"
description:
Expand All @@ -256,10 +256,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
sdks:
dart: ">=3.2.0-0 <4.0.0"
flutter: ">=3.0.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 1 addition & 1 deletion packages/calculator_widget/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
#Needed for calculator computation
decimal: ^2.3.3
#Needed for the state management
flutter_riverpod: ^2.4.10
flutter_riverpod: ^2.5.1
#Needed for app translation
translations:
path: ../translations
Expand Down
31 changes: 16 additions & 15 deletions packages/translations/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,34 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
matcher:
dependency: transitive
description:
Expand All @@ -116,10 +116,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -177,10 +177,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
vector_math:
dependency: transitive
description:
Expand All @@ -193,9 +193,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
sdks:
dart: ">=3.2.0-0 <4.0.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 1 addition & 1 deletion packages/translations/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
flutter_localizations:
sdk: flutter

intl: ^0.18.1
intl: ^0.19.0

dev_dependencies:
flutter_test:
Expand Down
Loading

0 comments on commit 87c448d

Please sign in to comment.