@@ -19,10 +19,10 @@ import 'package:kyber_launcher/gen/assets.gen.dart';
1919import 'package:kyber_launcher/gen/fonts.gen.dart' ;
2020import 'package:kyber_launcher/injection_container.dart' ;
2121import 'package:kyber_launcher/main.dart' ;
22+ import 'package:kyber_launcher/shared/ui/buttons/interactive_button.dart' ;
2223import 'package:kyber_launcher/shared/ui/ui.dart' ;
2324import 'package:local_hero/local_hero.dart' ;
2425import 'package:logging/logging.dart' ;
25- import 'package:vector_graphics/vector_graphics.dart' ;
2626
2727const _kCardWidth = 450.0 ;
2828
@@ -913,7 +913,8 @@ class _ServerCardState extends State<_ServerCard> {
913913 Positioned (
914914 left: _kCardWidth / 2 - 104 ,
915915 top: 240 - 45 / 2 ,
916- child: _PlayButton (
916+ child: InteractiveButton (
917+ child: const Text ('PLAY' ),
917918 onPressed: () => widget.onPlay? .call (false ),
918919 ),
919920 ),
@@ -929,9 +930,9 @@ class _ServerCardState extends State<_ServerCard> {
929930 left: _kCardWidth / 2 - 104 ,
930931 top: 146 - 45 / 2 ,
931932 child: FadeIn (
932- child: _PlayButton (
933+ child: InteractiveButton (
933934 onPressed: widget.onBack ?? () {},
934- text : 'BACK' ,
935+ child : const Text ( 'BACK' ) ,
935936 ),
936937 ),
937938 ),
@@ -990,74 +991,6 @@ class _KyberTag extends StatelessWidget {
990991 }
991992}
992993
993- class _PlayButton extends StatefulWidget {
994- const _PlayButton ({required this .onPressed, this .text});
995-
996- final VoidCallback onPressed;
997- final String ? text;
998-
999- @override
1000- State <_PlayButton > createState () => _PlayButtonState ();
1001- }
1002-
1003- class _PlayButtonState extends State <_PlayButton > {
1004- bool hovered = false ;
1005-
1006- @override
1007- Widget build (BuildContext context) {
1008- final target = hovered ? kActiveColor : kWhiteColor;
1009-
1010- return MouseRegion (
1011- onEnter: (_) => setState (() => hovered = true ),
1012- onExit: (_) => setState (() => hovered = false ),
1013- cursor: SystemMouseCursors .click,
1014- child: GestureDetector (
1015- onTap: widget.onPressed,
1016- child: Stack (
1017- children: [
1018- VectorGraphic (
1019- loader: AssetBytesLoader (Assets .icons.kblPlayIcon.path),
1020- height: 47 ,
1021- width: 208 ,
1022- ),
1023- VectorGraphic (
1024- loader: AssetBytesLoader (Assets .icons.kblPlayIconBorder.path),
1025- height: 47 ,
1026- width: 208 ,
1027- colorFilter: ColorFilter .mode (
1028- target,
1029- BlendMode .srcIn,
1030- ),
1031- ),
1032- Positioned (
1033- top: 12 ,
1034- left: 72 ,
1035- child: AnimatedDefaultTextStyle (
1036- duration: const Duration (milliseconds: 150 ),
1037- style: TextStyle (
1038- color: target,
1039- fontSize: 24 ,
1040- fontWeight: FontWeight .bold,
1041- height: 1 ,
1042- shadows: hovered
1043- ? [
1044- Shadow (
1045- color: kActiveColor.withOpacity (.7 ),
1046- blurRadius: 10 ,
1047- ),
1048- ]
1049- : null ,
1050- ),
1051- child: Text (widget.text ?? 'PLAY' ),
1052- ),
1053- ),
1054- ],
1055- ),
1056- ),
1057- );
1058- }
1059- }
1060-
1061994class JoinDialogResult {
1062995 JoinDialogResult ({
1063996 required this .collection,
0 commit comments