mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-29 21:55:58 +00:00
desktop exchange rate toggle style
This commit is contained in:
parent
e665926b1b
commit
9ba83f36eb
3 changed files with 88 additions and 31 deletions
3
assets/svg/lock-open.svg
Normal file
3
assets/svg/lock-open.svg
Normal file
|
@ -0,0 +1,3 @@
|
|||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 1.75C5.79141 1.75 4.8125 2.72945 4.8125 3.9375V5.25H11.375C12.3402 5.25 13.125 6.03477 13.125 7V12.25C13.125 13.2152 12.3402 14 11.375 14H2.625C1.6584 14 0.875 13.2152 0.875 12.25V7C0.875 6.03477 1.6584 5.25 2.625 5.25H3.0625V3.9375C3.0625 1.76285 4.82617 0 7 0C8.57227 0 9.92578 0.921211 10.5574 2.24957C10.7652 2.68598 10.5793 3.20742 10.1199 3.41523C9.68242 3.62305 9.18476 3.43711 8.97695 2.99961C8.62422 2.25941 7.87227 1.75 7 1.75ZM7.875 10.5C8.35898 10.5 8.75 10.109 8.75 9.625C8.75 9.14102 8.35898 8.75 7.875 8.75H6.125C5.64102 8.75 5.25 9.14102 5.25 9.625C5.25 10.109 5.64102 10.5 6.125 10.5H7.875Z" fill="#0056D2"/>
|
||||
</svg>
|
After Width: | Height: | Size: 741 B |
|
@ -7,8 +7,8 @@ import 'package:stackwallet/providers/providers.dart';
|
|||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
|
||||
class RateTypeToggle extends ConsumerWidget {
|
||||
const RateTypeToggle({
|
||||
|
@ -21,12 +21,17 @@ class RateTypeToggle extends ConsumerWidget {
|
|||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
debugPrint("BUILD: $runtimeType");
|
||||
final isDesktop = Util.isDesktop;
|
||||
|
||||
final estimated = ref.watch(prefsChangeNotifierProvider
|
||||
.select((value) => value.exchangeRateType)) ==
|
||||
ExchangeRateType.estimated;
|
||||
|
||||
return RoundedWhiteContainer(
|
||||
return RoundedContainer(
|
||||
padding: const EdgeInsets.all(0),
|
||||
color: isDesktop
|
||||
? Theme.of(context).extension<StackColors>()!.buttonBackSecondary
|
||||
: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
|
@ -39,6 +44,9 @@ class RateTypeToggle extends ConsumerWidget {
|
|||
}
|
||||
},
|
||||
child: RoundedContainer(
|
||||
padding: isDesktop
|
||||
? const EdgeInsets.all(17)
|
||||
: const EdgeInsets.all(0),
|
||||
color: estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
|
@ -48,29 +56,50 @@ class RateTypeToggle extends ConsumerWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
Assets.svg.lock,
|
||||
Assets.svg.lockOpen,
|
||||
width: 12,
|
||||
height: 14,
|
||||
color: estimated
|
||||
? Theme.of(context).extension<StackColors>()!.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
color: isDesktop
|
||||
? estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorBlue
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextSecondary
|
||||
: estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"Estimate rate",
|
||||
style: STextStyles.smallMed12(context).copyWith(
|
||||
color: estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
),
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextExtraExtraSmall(context)
|
||||
.copyWith(
|
||||
color: estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorBlue
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextSecondary,
|
||||
)
|
||||
: STextStyles.smallMed12(context).copyWith(
|
||||
color: estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -87,6 +116,9 @@ class RateTypeToggle extends ConsumerWidget {
|
|||
}
|
||||
},
|
||||
child: RoundedContainer(
|
||||
padding: isDesktop
|
||||
? const EdgeInsets.all(17)
|
||||
: const EdgeInsets.all(0),
|
||||
color: !estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
|
@ -99,26 +131,47 @@ class RateTypeToggle extends ConsumerWidget {
|
|||
Assets.svg.lock,
|
||||
width: 12,
|
||||
height: 14,
|
||||
color: !estimated
|
||||
? Theme.of(context).extension<StackColors>()!.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
color: isDesktop
|
||||
? !estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorBlue
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextSecondary
|
||||
: !estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"Fixed rate",
|
||||
style: STextStyles.smallMed12(context).copyWith(
|
||||
color: !estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
),
|
||||
style: isDesktop
|
||||
? STextStyles.desktopTextExtraExtraSmall(context)
|
||||
.copyWith(
|
||||
color: !estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.accentColorBlue
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.buttonTextSecondary,
|
||||
)
|
||||
: STextStyles.smallMed12(context).copyWith(
|
||||
color: !estimated
|
||||
? Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textDark
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textSubtitle1,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -228,6 +228,7 @@ flutter:
|
|||
- assets/svg/chevron-down.svg
|
||||
- assets/svg/chevron-up.svg
|
||||
- assets/svg/lock-keyhole.svg
|
||||
- assets/svg/lock-open.svg
|
||||
- assets/svg/rotate-exclamation.svg
|
||||
- assets/svg/folder-down.svg
|
||||
- assets/svg/network-wired.svg
|
||||
|
|
Loading…
Reference in a new issue