WIP: theme change

This commit is contained in:
ryleedavis 2022-11-04 17:50:51 -06:00
parent a5d7723dee
commit e06910a34a

View file

@ -23,6 +23,19 @@ class AppearanceOptionSettings extends ConsumerStatefulWidget {
class _AppearanceOptionSettings class _AppearanceOptionSettings
extends ConsumerState<AppearanceOptionSettings> { extends ConsumerState<AppearanceOptionSettings> {
// late bool isLight;
// @override
// void initState() {
//
// super.initState();
// }
//
// @override
// void dispose() {
// super.dispose();
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType"); debugPrint("BUILD: $runtimeType");
@ -127,13 +140,7 @@ class _AppearanceOptionSettings
], ],
), ),
), ),
const Padding( ThemeToggle(),
padding: EdgeInsets.only(
left: 10,
right: 10,
),
child: ThemeToggle(),
),
], ],
), ),
), ),
@ -169,95 +176,38 @@ class _ThemeToggle extends State<ThemeToggle> {
elevation: 0, elevation: 0,
hoverColor: Colors.transparent, hoverColor: Colors.transparent,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide(
color:
Theme.of(context).extension<StackColors>()!.infoItemIcons,
width: 2,
),
// side: !externalCallsEnabled
// ? 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,
), ),
), ),
onPressed: () {}, //onPressed onPressed: () {}, //onPressed
child: Stack( child: Padding(
children: [ padding: const EdgeInsets.all(8.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(
left: 24,
),
child: SvgPicture.asset(
Assets.svg.themeLight,
),
),
Padding(
padding: const EdgeInsets.only(
left: 50,
top: 12,
),
child: Text(
"Light",
style:
STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
)
],
),
// if (externalCallsEnabled)
Positioned(
bottom: 0,
left: 6,
child: SvgPicture.asset(
Assets.svg.checkCircle,
width: 20,
height: 20,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemIcons,
),
),
// if (!externalCallsEnabled)
// 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 SizedBox(
width: 1,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: RawMaterialButton(
elevation: 0,
hoverColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius * 2,
),
),
onPressed: () {}, //onPressed
child: Stack( child: Stack(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SvgPicture.asset( Padding(
Assets.svg.themeDark, padding: const EdgeInsets.only(
left: 24,
),
child: SvgPicture.asset(
Assets.svg.themeLight,
),
), ),
Padding( Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
@ -265,7 +215,7 @@ class _ThemeToggle extends State<ThemeToggle> {
top: 12, top: 12,
), ),
child: Text( child: Text(
"Dark", "Light",
style: STextStyles.desktopTextExtraSmall(context) style: STextStyles.desktopTextExtraSmall(context)
.copyWith( .copyWith(
color: Theme.of(context) color: Theme.of(context)
@ -273,13 +223,13 @@ class _ThemeToggle extends State<ThemeToggle> {
.textDark, .textDark,
), ),
), ),
), )
], ],
), ),
// if (externalCallsEnabled) // if (externalCallsEnabled)
Positioned( Positioned(
bottom: 0, bottom: 0,
left: 0, left: 6,
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.svg.checkCircle, Assets.svg.checkCircle,
width: 20, width: 20,
@ -291,8 +241,8 @@ class _ThemeToggle extends State<ThemeToggle> {
), ),
// if (!externalCallsEnabled) // if (!externalCallsEnabled)
// Positioned( // Positioned(
// top: 4, // bottom: 0,
// right: 4, // left: 6,
// child: Container( // child: Container(
// width: 20, // width: 20,
// height: 20, // height: 20,
@ -309,6 +259,90 @@ class _ThemeToggle extends State<ThemeToggle> {
), ),
), ),
), ),
const SizedBox(
width: 1,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: RawMaterialButton(
elevation: 0,
hoverColor: Colors.transparent,
shape: RoundedRectangleBorder(
// side: !externalCallsEnabled
// ? BorderSide.none
// : BorderSide(
// color: Theme.of(context)
// .extension<StackColors>()!
// .infoItemIcons,
// width: 2,
// ),
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius * 2,
),
),
onPressed: () {}, //onPressed
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(
Assets.svg.themeDark,
),
Padding(
padding: const EdgeInsets.only(
left: 45,
top: 12,
),
child: Text(
"Dark",
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
),
],
),
// if (externalCallsEnabled)
// Positioned(
// bottom: 0,
// left: 0,
// child: SvgPicture.asset(
// Assets.svg.checkCircle,
// width: 20,
// height: 20,
// color: Theme.of(context)
// .extension<StackColors>()!
// .infoItemIcons,
// ),
// ),
// if (!externalCallsEnabled)
Positioned(
bottom: 0,
left: 0,
child: Container(
width: 20,
height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1000),
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
),
),
),
],
),
),
),
),
),
], ],
); );
} }