@@ -92,6 +92,7 @@ class _NoCodesScreenState extends State<NoCodesScreen> {
9292 bool _animated = true ;
9393 bool _purchaseDelegateEnabled = false ;
9494 SamplePurchaseDelegate ? _purchaseDelegate;
95+ NoCodesTheme _selectedTheme = NoCodesTheme .auto;
9596
9697 @override
9798 void dispose () {
@@ -131,6 +132,8 @@ class _NoCodesScreenState extends State<NoCodesScreen> {
131132 const SizedBox (height: 16 ),
132133 _buildLocaleSection (),
133134 const SizedBox (height: 16 ),
135+ _buildThemeSection (),
136+ const SizedBox (height: 16 ),
134137 _buildActionsSection (),
135138 const SizedBox (height: 16 ),
136139 _buildEventsSection (appState),
@@ -346,6 +349,36 @@ class _NoCodesScreenState extends State<NoCodesScreen> {
346349 );
347350 }
348351
352+ Widget _buildThemeSection () {
353+ return SectionCard (
354+ title: 'Theme' ,
355+ child: Column (
356+ crossAxisAlignment: CrossAxisAlignment .stretch,
357+ children: [
358+ Text (
359+ 'Select theme mode' ,
360+ style: TextStyle (
361+ fontSize: 13 ,
362+ fontWeight: FontWeight .w500,
363+ color: Colors .grey.shade700,
364+ ),
365+ ),
366+ const SizedBox (height: 8 ),
367+ ...NoCodesTheme .values.map ((theme) => _buildRadioTile (
368+ title: theme.name,
369+ value: theme,
370+ groupValue: _selectedTheme,
371+ onChanged: (value) {
372+ if (value != null ) {
373+ _setTheme (value);
374+ }
375+ },
376+ )),
377+ ],
378+ ),
379+ );
380+ }
381+
349382 Widget _buildActionsSection () {
350383 return SectionCard (
351384 title: 'Actions' ,
@@ -507,6 +540,21 @@ class _NoCodesScreenState extends State<NoCodesScreen> {
507540 }
508541 }
509542
543+ void _setTheme (NoCodesTheme theme) async {
544+ try {
545+ debugPrint ('🔄 [NoCodes] Setting theme: ${theme .name }' );
546+ await NoCodes .getSharedInstance ().setTheme (theme);
547+ setState (() {
548+ _selectedTheme = theme;
549+ });
550+ debugPrint ('✅ [NoCodes] Theme set' );
551+ _showSuccess ('Theme set to: ${theme .name }' );
552+ } catch (e) {
553+ debugPrint ('❌ [NoCodes] Failed to set theme: $e ' );
554+ _showError ('Failed to set theme: $e ' );
555+ }
556+ }
557+
510558 void _showSuccess (String message) {
511559 ScaffoldMessenger .of (context).showSnackBar (
512560 SnackBar (content: Text (message), backgroundColor: AppTheme .successColor),
0 commit comments