toggle button and border for recommended privacy setting

This commit is contained in:
ryleedavis 2022-10-11 11:36:07 -06:00
parent 8742496a24
commit 0c9b23d8e5

View file

@ -83,18 +83,6 @@ class _StackPrivacyCalls extends ConsumerState<StackPrivacyCalls> {
), ),
child: PrivacyToggle(), child: PrivacyToggle(),
), ),
// Center(
// child: CustomRadio((bool isEasy) {
// setState(() {
// this.isEasy = isEasy;
//
// DB.instance.put<dynamic>(
// boxName: DB.boxNamePrefs,
// key: "externalCalls",
// value: isEasy);
// });
// }),
// ),
const SizedBox( const SizedBox(
height: 36, height: 36,
), ),
@ -105,7 +93,11 @@ class _StackPrivacyCalls extends ConsumerState<StackPrivacyCalls> {
text: TextSpan( text: TextSpan(
style: style:
STextStyles.label(context).copyWith(fontSize: 12.0), STextStyles.label(context).copyWith(fontSize: 12.0),
children: isEasy children: ref.watch(
prefsChangeNotifierProvider.select(
(value) => value.externalCalls,
),
)
? const [ ? const [
TextSpan( TextSpan(
text: text:
@ -181,6 +173,18 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
child: RawMaterialButton( child: RawMaterialButton(
fillColor: Theme.of(context).extension<StackColors>()!.popupBG, fillColor: Theme.of(context).extension<StackColors>()!.popupBG,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: !ref.watch(
prefsChangeNotifierProvider.select(
(value) => value.externalCalls,
),
)
? BorderSide.none
: BorderSide(
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
width: 2,
),
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius * 2, Constants.size.circularBorderRadius * 2,
), ),
@ -192,23 +196,66 @@ class _PrivacyToggleState extends ConsumerState<PrivacyToggle> {
padding: const EdgeInsets.all( padding: const EdgeInsets.all(
12, 12,
), ),
child: Column( child: Stack(
children: [ children: [
SvgPicture.asset( Column(
Assets.svg.personaEasy, crossAxisAlignment: CrossAxisAlignment.stretch,
// color: Theme.of(context).extension<StackColors>()!.textWhite, children: [
width: 96, SvgPicture.asset(
height: 96, Assets.svg.personaEasy,
width: 96,
height: 96,
),
const Center(
child: Text(
"Easy Crypto",
style: TextStyle(
fontWeight: FontWeight.bold,
),
)),
const Center(
child: Text(
"Recommended",
),
),
],
), ),
const Text( if (ref.watch(
"Easy Crypto", prefsChangeNotifierProvider.select(
style: TextStyle( (value) => value.externalCalls,
fontWeight: FontWeight.bold, ),
))
Positioned(
top: 4,
right: 4,
child: SvgPicture.asset(
Assets.svg.checkCircle,
width: 20,
height: 20,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
if (!ref.watch(
prefsChangeNotifierProvider.select(
(value) => value.externalCalls,
),
))
Positioned(
top: 4,
right: 4,
child: Container(
width: 20,
height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1000),
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
),
),
), ),
),
const Text(
"Recommended",
),
], ],
), ),
), ),