From e06910a34a68451d00cb337dcf7d194eb19d34cd Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Fri, 4 Nov 2022 17:50:51 -0600 Subject: [PATCH] WIP: theme change --- .../settings_menu/appearance_settings.dart | 216 ++++++++++-------- 1 file changed, 125 insertions(+), 91 deletions(-) diff --git a/lib/pages_desktop_specific/home/settings_menu/appearance_settings.dart b/lib/pages_desktop_specific/home/settings_menu/appearance_settings.dart index d524453e2..b5f239ab1 100644 --- a/lib/pages_desktop_specific/home/settings_menu/appearance_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/appearance_settings.dart @@ -23,6 +23,19 @@ class AppearanceOptionSettings extends ConsumerStatefulWidget { class _AppearanceOptionSettings extends ConsumerState { + // late bool isLight; + + // @override + // void initState() { + // + // super.initState(); + // } + // + // @override + // void dispose() { + // super.dispose(); + // } + @override Widget build(BuildContext context) { debugPrint("BUILD: $runtimeType"); @@ -127,13 +140,7 @@ class _AppearanceOptionSettings ], ), ), - const Padding( - padding: EdgeInsets.only( - left: 10, - right: 10, - ), - child: ThemeToggle(), - ), + ThemeToggle(), ], ), ), @@ -169,95 +176,38 @@ class _ThemeToggle extends State { elevation: 0, hoverColor: Colors.transparent, shape: RoundedRectangleBorder( + side: BorderSide( + color: + Theme.of(context).extension()!.infoItemIcons, + width: 2, + ), + // side: !externalCallsEnabled + // ? BorderSide.none + // : BorderSide( + // color: Theme.of(context) + // .extension()! + // .infoItemIcons, + // width: 2, + // ), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius * 2, ), ), onPressed: () {}, //onPressed - child: Stack( - children: [ - 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()! - .textDark, - ), - ), - ) - ], - ), - // if (externalCallsEnabled) - Positioned( - bottom: 0, - left: 6, - child: SvgPicture.asset( - Assets.svg.checkCircle, - width: 20, - height: 20, - color: Theme.of(context) - .extension()! - .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()! - // .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: 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: 24, + ), + child: SvgPicture.asset( + Assets.svg.themeLight, + ), ), Padding( padding: const EdgeInsets.only( @@ -265,7 +215,7 @@ class _ThemeToggle extends State { top: 12, ), child: Text( - "Dark", + "Light", style: STextStyles.desktopTextExtraSmall(context) .copyWith( color: Theme.of(context) @@ -273,13 +223,13 @@ class _ThemeToggle extends State { .textDark, ), ), - ), + ) ], ), // if (externalCallsEnabled) Positioned( bottom: 0, - left: 0, + left: 6, child: SvgPicture.asset( Assets.svg.checkCircle, width: 20, @@ -291,8 +241,8 @@ class _ThemeToggle extends State { ), // if (!externalCallsEnabled) // Positioned( - // top: 4, - // right: 4, + // bottom: 0, + // left: 6, // child: Container( // width: 20, // height: 20, @@ -309,6 +259,90 @@ class _ThemeToggle extends State { ), ), ), + 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()! + // .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()! + .textDark, + ), + ), + ), + ], + ), + // if (externalCallsEnabled) + // Positioned( + // bottom: 0, + // left: 0, + // child: SvgPicture.asset( + // Assets.svg.checkCircle, + // width: 20, + // height: 20, + // color: Theme.of(context) + // .extension()! + // .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()! + .textFieldDefaultBG, + ), + ), + ), + ], + ), + ), + ), + ), + ), ], ); }