From 6ff0b7c9021ab606d6d6d720914c9ce765a862dd Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sun, 7 Jul 2024 17:16:47 +0800 Subject: [PATCH] merge: Deprecated --- lib/main.dart | 2 +- lib/ui/home/home_ui.dart | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 30f81d2..7420cae 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -68,7 +68,7 @@ class App extends HookConsumerWidget { micaBackgroundColor: appState.themeConf.micaColor, buttonTheme: ButtonThemeData( defaultButtonStyle: ButtonStyle( - shape: ButtonState.all(RoundedRectangleBorder( + shape: WidgetStateProperty.all(RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), side: BorderSide(color: Colors.white.withOpacity(.01)))), ))), diff --git a/lib/ui/home/home_ui.dart b/lib/ui/home/home_ui.dart index eb2c4bf..eb185b4 100644 --- a/lib/ui/home/home_ui.dart +++ b/lib/ui/home/home_ui.dart @@ -153,7 +153,7 @@ class HomeUI extends HookConsumerWidget { ? null : ButtonStyle( backgroundColor: - ButtonState.resolveWith(_getRunButtonColor), + WidgetStateProperty.resolveWith(_getRunButtonColor), ), child: Padding( padding: const EdgeInsets.all(6), @@ -476,13 +476,13 @@ class HomeUI extends HookConsumerWidget { final item = items.elementAt(index); return HoverButton( onPressed: () => _onMenuTap(context, item.key, homeState, ref), - builder: (BuildContext context, Set states) { + builder: (BuildContext context, Set states) { return Container( width: 300, height: 120, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: states.isHovering + color: states.isHovered ? FluentTheme.of(context).cardColor.withOpacity(.1) : FluentTheme.of(context).cardColor, ), @@ -818,11 +818,11 @@ class HomeUI extends HookConsumerWidget { } } - Color? _getRunButtonColor(Set states) { - if (states.isPressing) { + Color? _getRunButtonColor(Set states) { + if (states.isPressed) { return const Color.fromRGBO(49, 227, 88, .5); } - if (states.isHovering) { + if (states.isPressed) { return const Color.fromRGBO(47, 213, 84, 1.0); } return const Color.fromRGBO(49, 227, 88, .8);