add useImage feild for change image in every newyear and increase quality
This commit is contained in:
@@ -25,6 +25,7 @@ class ConnectionButton extends HookConsumerWidget {
|
||||
final connectionStatus = ref.watch(connectionNotifierProvider);
|
||||
final requiresReconnect =
|
||||
ref.watch(configOptionNotifierProvider).valueOrNull;
|
||||
final today = DateTime.now();
|
||||
|
||||
ref.listen(
|
||||
connectionNotifierProvider,
|
||||
@@ -102,7 +103,9 @@ class ConnectionButton extends HookConsumerWidget {
|
||||
AsyncData(value: Disconnected()) || AsyncError() => Assets.images.disconnectNorouz,
|
||||
AsyncData(value: Connected()) => Assets.images.connectNorouz,
|
||||
_ =>Assets.images.disconnectNorouz,
|
||||
}
|
||||
},
|
||||
useImage:today.day>=19 && today.day<=23 && today.month==3 ,
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -114,6 +117,7 @@ class _ConnectionButton extends StatelessWidget {
|
||||
required this.label,
|
||||
required this.buttonColor,
|
||||
required this.image,
|
||||
required this.useImage,
|
||||
});
|
||||
|
||||
final VoidCallback onTap;
|
||||
@@ -121,6 +125,7 @@ class _ConnectionButton extends StatelessWidget {
|
||||
final String label;
|
||||
final Color buttonColor;
|
||||
final AssetGenImage image;
|
||||
final bool useImage;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -156,7 +161,19 @@ class _ConnectionButton extends StatelessWidget {
|
||||
tween: ColorTween(end: buttonColor),
|
||||
duration: const Duration(milliseconds: 250),
|
||||
builder: (context, value, child) {
|
||||
return image.image();
|
||||
if(useImage) {
|
||||
return image.image(
|
||||
filterQuality: FilterQuality.medium
|
||||
);
|
||||
}
|
||||
else{
|
||||
return Assets.images.logo.svg(
|
||||
colorFilter: ColorFilter.mode(
|
||||
value!,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user