Skip to content

Migrate Radio to RadioGroup widget#35

Merged
stopflock merged 5 commits intoFoggedLens:mainfrom
dougborg:pr/03-radiogroup
Feb 9, 2026
Merged

Migrate Radio to RadioGroup widget#35
stopflock merged 5 commits intoFoggedLens:mainfrom
dougborg:pr/03-radiogroup

Conversation

@dougborg
Copy link
Copy Markdown
Collaborator

@dougborg dougborg commented Feb 2, 2026

Stack order: 3/5 — merge after PR2 (lint cleanup)

Summary

  • Migrate Radio with groupValue/onChanged to RadioGroup widget per Flutter deprecation
  • Fix type mismatch in language_section.dart RadioGroup

Test plan

  • Verify radio buttons in settings screens still function correctly
  • Run flutter analyze with zero warnings

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 2, 2026 08:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates RadioListTile widgets to use the new RadioGroup wrapper widget, which is a Flutter 3.27+ Material 3 feature that simplifies radio button group management by eliminating the need to pass groupValue and onChanged to each individual radio button. The PR also includes extensive code modernization updates aligned with Flutter 3.27+ deprecations and best practices.

Changes:

  • Migrated two radio button groups to use RadioGroup wrapper (in refine_tags_sheet.dart and language_section.dart)
  • Updated opacity handling from deprecated withOpacity() to withValues(alpha:) throughout the codebase
  • Replaced deprecated WillPopScope with PopScope API
  • Modernized Material 3 color scheme usage (surfaceVariantsurfaceContainerHighest)
  • Converted print statements to debugPrint for better Flutter integration
  • General code cleanup: removed unused imports, variables, and functions; improved string interpolation; removed unnecessary .toList() calls

Reviewed changes

Copilot reviewed 80 out of 81 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/widgets/refine_tags_sheet.dart Migrated operator profile radio buttons to RadioGroup
lib/screens/settings/sections/language_section.dart Migrated language selection radio buttons to RadioGroup
scripts/validate_localizations.dart Bug: Incorrectly changed print to debugPrint in standalone Dart script
lib/widgets/*.dart (multiple) Updated deprecated withOpacity() calls to withValues(alpha:)
lib/widgets/nuclear_reset_dialog.dart Migrated WillPopScope to PopScope
lib/services/*.dart (multiple) Converted print to debugPrint and code cleanup
lib/screens/*.dart (multiple) Material 3 color updates and code cleanup
test/*.dart Updated test imports and removed unused test file
pubspec.yaml, pubspec.lock Added flutter_lints and collection dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/validate_localizations.dart Outdated
Comment thread lib/services/changelog_service.dart
Comment thread scripts/validate_localizations.dart Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 77 out of 79 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

lib/screens/settings/sections/language_section.dart:51

  • _setLanguage awaits LocalizationService.instance.setLanguage(...) and then calls setState without checking mounted. If the widget is disposed during the await, this will throw. Add a if (!mounted) return; guard before setState.
  Future<void> _setLanguage(String? languageCode) async {
    await LocalizationService.instance.setLanguage(languageCode);
    setState(() {
      _selectedLanguage = languageCode;
    });
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/screens/settings/sections/language_section.dart
Comment thread lib/screens/settings/sections/language_section.dart
@dougborg dougborg force-pushed the pr/03-radiogroup branch 2 times, most recently from f318893 to ef5609f Compare February 8, 2026 21:05
dougborg and others added 5 commits February 8, 2026 14:23
Migrate all withOpacity() calls to withValues(alpha:) and
surfaceVariant to surfaceContainerHighest across the codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes avoid_print lint warnings by using debugPrint which respects
release mode and avoids console overflow on mobile platforms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@stopflock stopflock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@stopflock stopflock merged commit 98b73fe into FoggedLens:main Feb 9, 2026
dougborg pushed a commit to dougborg/deflock-app that referenced this pull request Feb 9, 2026
The RadioGroup widget (used in language_section.dart and
refine_tags_sheet.dart since the PR FoggedLens#35 migration) requires
Flutter 3.35+ / Dart 3.8+. The old constraint (>=3.5.0) allowed
older SDKs that don't have RadioGroup, causing cryptic build errors
instead of a clear version mismatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dougborg pushed a commit to dougborg/deflock-app that referenced this pull request Feb 9, 2026
…ement

The RadioGroup widget (merged via PR FoggedLens#35) requires Flutter 3.35+ /
Dart 3.8+. The old constraint (>=3.5.0) allowed older SDKs that don't
have RadioGroup, causing cryptic build errors instead of a clear
version mismatch from pub get.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dougborg pushed a commit to dougborg/deflock-app that referenced this pull request Feb 9, 2026
…ement

The RadioGroup widget (merged via PR FoggedLens#35) requires Flutter 3.35+ /
Dart 3.8+. The old constraint (>=3.5.0) allowed older SDKs that don't
have RadioGroup, causing cryptic build errors instead of a clear
version mismatch from pub get.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dougborg pushed a commit to dougborg/deflock-app that referenced this pull request Feb 9, 2026
The RadioGroup widget (used in language_section.dart and
refine_tags_sheet.dart since the PR FoggedLens#35 migration) requires
Flutter 3.35+ / Dart 3.8+. The old constraint (>=3.5.0) allowed
older SDKs that don't have RadioGroup, causing cryptic build errors
instead of a clear version mismatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants