backup: before proxies page modernization
This commit is contained in:
@@ -95,6 +95,10 @@ class ConnectionButton extends HookConsumerWidget {
|
||||
_ => Assets.images.disconnectNorouz,
|
||||
},
|
||||
useImage: today.day >= 19 && today.day <= 23 && today.month == 3,
|
||||
isConnected: switch (connectionStatus) {
|
||||
AsyncData(value: Connected()) => true,
|
||||
_ => false,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -107,6 +111,7 @@ class _ConnectionButton extends StatelessWidget {
|
||||
required this.buttonColor,
|
||||
required this.image,
|
||||
required this.useImage,
|
||||
required this.isConnected,
|
||||
});
|
||||
|
||||
final VoidCallback onTap;
|
||||
@@ -115,6 +120,7 @@ class _ConnectionButton extends StatelessWidget {
|
||||
final Color buttonColor;
|
||||
final AssetGenImage image;
|
||||
final bool useImage;
|
||||
final bool isConnected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -136,8 +142,8 @@ class _ConnectionButton extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
width: 148,
|
||||
height: 148,
|
||||
width: 120,
|
||||
height: 120,
|
||||
child: Material(
|
||||
key: const ValueKey("home_connection_button"),
|
||||
shape: const CircleBorder(),
|
||||
@@ -145,7 +151,7 @@ class _ConnectionButton extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(36),
|
||||
padding: const EdgeInsets.all(30),
|
||||
child: TweenAnimationBuilder(
|
||||
tween: ColorTween(end: buttonColor),
|
||||
duration: const Duration(milliseconds: 250),
|
||||
@@ -153,11 +159,11 @@ class _ConnectionButton extends StatelessWidget {
|
||||
if (useImage) {
|
||||
return image.image(filterQuality: FilterQuality.medium);
|
||||
} else {
|
||||
return Assets.images.logo.svg(
|
||||
colorFilter: ColorFilter.mode(
|
||||
value!,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
// Определяем какую иконку показывать: play для отключенного, stop для подключенного
|
||||
return Icon(
|
||||
isConnected ? Icons.stop_rounded : Icons.play_arrow_rounded,
|
||||
color: value,
|
||||
size: 60,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user