Skip to content

Commit 4c8fbe6

Browse files
yadaniyilclaude
andcommitted
feat: release v3.0.0
- Require Flutter >=3.16.0 / Dart >=3.5.0 - Material 3: Android + Web themes derive from ColorScheme - Fix iOS value text overflow (#186) - Fix RTL chevron direction (#170) - Fix platform override ignored on macOS host (#139) - Fix Web switch ignoring switchTheme (#188) - Add compact: bool parameter to SettingsTile (#178) - Add crossAxisAlignment to SettingsList (#189) - Add titleTextStyle/tileTextStyle/tileDescriptionTextStyle to SettingsThemeData (#185) - Add inactiveSwitchColor to SettingsThemeData (#194) - Migrate all constructors to super-parameters - Replace deprecated textScaleFactor, activeColor APIs - Update Android Gradle to 8.7 / AGP 8.3.2 / Kotlin 1.9.24 - Add Material 3 demo screen to example app - 108 unit tests (92% coverage) + 17 integration tests passing - CI: checkout@v4, coverage gate raised to 60% Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e93eee8 commit 4c8fbe6

45 files changed

Lines changed: 1454 additions & 448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/code-quality-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v4
1212

1313
- name: Setup flutter
1414
uses: subosito/flutter-action@v2
@@ -30,7 +30,7 @@ jobs:
3030
- name: Very Good Coverage
3131
uses: VeryGoodOpenSource/very_good_coverage@v2.1.0
3232
with:
33-
min_coverage: 35
33+
min_coverage: 60
3434

3535
- name: Flutter Problem Matcher
3636
uses: leancodepl/dart-problem-matcher@main

.pubignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# IDE project files — not needed by package consumers
2+
*.iml
3+
4+
# Internal planning docs
5+
V3_PLAN.md
6+
CLAUDE.md
7+
8+
# Coverage output
9+
coverage/

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## [3.0.0] - [April 10, 2026]
2+
3+
### Breaking changes
4+
* Requires Flutter >=3.16.0 and Dart SDK >=3.5.0
5+
* Android and Web themes now derive colors from `Theme.of(context).colorScheme` (Material 3). Custom color overrides via `SettingsThemeData` still work.
6+
7+
### New features
8+
* `compact: bool` parameter on `SettingsTile` — use smaller vertical padding for dense layouts
9+
* `crossAxisAlignment` parameter on `SettingsList`
10+
* `titleTextStyle`, `tileTextStyle`, `tileDescriptionTextStyle`, `inactiveSwitchColor` fields on `SettingsThemeData`
11+
12+
### Bug fixes
13+
* Fixed iOS value text overflow in narrow tiles (#186)
14+
* Fixed RTL chevron direction — now shows back-arrow in right-to-left layouts
15+
* Fixed platform override being ignored on macOS host when `platform: android/web` was set (#139)
16+
* Fixed web switch ignoring `SwitchTheme` due to hardcoded fallback color (#188)
17+
* Fixed disabled switch using wrong inactive color on all platforms
18+
19+
### Maintenance
20+
* Migrated all constructors to super-parameters (`super.key`, `super.child`)
21+
* Replaced deprecated `textScaleFactor` with `MediaQuery.textScalerOf`
22+
* Replaced deprecated `Switch.activeColor` with `Switch.activeThumbColor`
23+
* Replaced deprecated `CupertinoSwitch.activeColor` with `CupertinoSwitch.activeTrackColor`
24+
* Updated CI to `actions/checkout@v4`, coverage gate raised from 35% → 60%
25+
* Updated example app with Material 3 demo screen
26+
127
## [2.0.3] - [June 13, 2022]
228
* Updated documentation
329
* Fixed display of web support on pub.dev

CLAUDE.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## About this project
6+
7+
`settings_ui` is a published Flutter package (pub.dev: `settings_ui`, current version: `2.0.3`) that renders native-looking settings screens for Android, iOS, macOS, Windows, Linux, Fuchsia, and Web — all from a single API. It is used in production by thousands of apps.
8+
9+
## Commands
10+
11+
```bash
12+
# Get dependencies
13+
flutter pub get
14+
15+
# Run all tests
16+
flutter test
17+
18+
# Run a single test file
19+
flutter test test/widget_test.dart
20+
21+
# Run tests with coverage
22+
flutter test --coverage --test-randomize-ordering-seed random
23+
24+
# Analyze for lint errors
25+
flutter analyze .
26+
27+
# Fix formatting
28+
flutter format .
29+
30+
# Check formatting without changing files (CI-style)
31+
flutter format --set-exit-if-changed .
32+
33+
# Run the example app
34+
cd example && flutter run
35+
```
36+
37+
## Architecture
38+
39+
### Rendering strategy: platform dispatch
40+
41+
Every public widget (`SettingsList`, `SettingsSection`, `SettingsTile`) is a thin dispatcher. At build time each checks `SettingsTheme.of(context).platform` and returns one of three concrete platform implementations:
42+
43+
- `Android/Fuchsia/Linux` → Material widgets
44+
- `iOS/macOS/Windows` → Cupertino widgets
45+
- `Web` → Web-specific widgets (rounded cards, adjusted padding)
46+
47+
Platform implementations live alongside their dispatcher:
48+
49+
```
50+
lib/src/tiles/
51+
settings_tile.dart ← dispatcher
52+
platforms/
53+
android_settings_tile.dart
54+
ios_settings_tile.dart
55+
web_settings_tile.dart
56+
```
57+
58+
Same pattern for `sections/` and `list/`.
59+
60+
### Theme propagation via `InheritedWidget`
61+
62+
`SettingsList` resolves platform and brightness, calls `ThemeProvider.getTheme()` to get hardcoded platform defaults, merges in any user-supplied `lightTheme`/`darkTheme` (`SettingsThemeData`), then pushes the result down the tree via `SettingsTheme` (an `InheritedWidget`).
63+
64+
All platform tile/section widgets read theme from `SettingsTheme.of(context).themeData`. Never pass theme as a constructor argument.
65+
66+
`ThemeProvider` (`lib/src/utils/theme_provider.dart`) contains all hardcoded color values for each platform/brightness combination. This is the main place to touch when fixing theme issues.
67+
68+
### `DevicePlatform.device` is a sentinel
69+
70+
`DevicePlatform.device` means "auto-detect at runtime" and is valid only as input to `SettingsList`. It must never reach the platform switch statements inside tiles/sections — doing so throws. `PlatformUtils.detectPlatform()` resolves it to a real platform.
71+
72+
### `IOSSettingsTileAdditionalInfo`
73+
74+
An extra `InheritedWidget` injected by `IOSSettingsSection` to tell each `IOSSettingsTile` whether to draw top/bottom border radius and whether to show the inter-tile divider. This is iOS/macOS/Windows only.
75+
76+
### Public API surface (the only exports)
77+
78+
`lib/settings_ui.dart` re-exports exactly:
79+
- `SettingsList` (+ `ApplicationType` enum)
80+
- `SettingsSection`, `AbstractSettingsSection`, `CustomSettingsSection`
81+
- `SettingsTile` (+ `SettingsTileType` enum), `AbstractSettingsTile`, `CustomSettingsTile`
82+
- `DevicePlatform`, `PlatformUtils`
83+
- `SettingsTheme`, `SettingsThemeData`
84+
85+
Platform-specific implementations are internal and should not be part of the public API.
86+
87+
## Testing conventions
88+
89+
- Tests live in `test/` with a flat `widget_test.dart` entry point that calls helper functions grouped by concern (`settingsListTests`, `settingsSectionsTests`, `settingsTileTests`, etc.).
90+
- Helper test functions are parameterised over `DevicePlatform` and called for every platform value.
91+
- The `_wrapWithMaterialApp` / `TestWidgetScreen` helper wraps a tile or section in a `SettingsList` inside a `MaterialApp` and passes the desired platform explicitly so tests are platform-deterministic.
92+
- CI requires ≥ 35% line coverage (`very_good_coverage`).
93+
94+
## CI / Release
95+
96+
- **CI** runs on every push: format check → `flutter analyze``flutter test --coverage` → coverage gate (35%).
97+
- **PR titles** must follow Conventional Commits (enforced by `action-semantic-pull-request`).
98+
- There is currently no automated publish workflow; a new version requires bumping `version` in `pubspec.yaml`, updating `CHANGELOG.md`, tagging, then running `flutter pub publish`.

V3_PLAN.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# settings_ui v3.0.0 — Release Plan
2+
3+
Target: `3.0.0` on pub.dev
4+
Flutter: 3.41.x stable / Dart 3.x
5+
Status: **READY TO PUBLISH**
6+
7+
This file tracks every task needed before and after the release.
8+
Check off items (`- [x]`) as they are completed.
9+
10+
---
11+
12+
## Phase 1 — Codebase Health & Deprecation Fixes ✅
13+
14+
- [x] **1.1** Bump `pubspec.yaml` SDK constraint to `>=3.5.0 <4.0.0` and Flutter to `>=3.16.0`
15+
- [x] **1.2** Replace `MediaQuery.of(context).textScaleFactor` with `MediaQuery.textScalerOf(context).scale(value)`
16+
- [x] **1.3** Replace `Key? key` super-constructor patterns with `super.key`
17+
- [x] **1.4** Update `dev_dependencies`: `flutter_lints: ^5.0.0`
18+
- [x] **1.5** `flutter analyze` — zero issues
19+
20+
---
21+
22+
## Phase 2 — Bug Fixes ✅
23+
24+
- [x] **2.1** iOS value text overflow — `Flexible` in inner Row of `buildTileContent` *(Issue #186)*
25+
- [x] **2.2** RTL chevron — `chevron_back` in RTL locales *(Issue #170)*
26+
- [x] **2.3** Web platform tag — `platforms:` block in `pubspec.yaml` *(Issue #179)*
27+
- [x] **2.4** `enabled` ignored on Web tile — `inactiveTitleColor` applied *(Issue #174)*
28+
- [x] **2.5** Web switch `activeColor` — hardcoded fallback removed *(Issue #188)*
29+
- [x] **2.6** `switchTheme` ignored on Web — no more hardcoded blue override *(Issue #188)*
30+
- [x] **2.7** `trailing` missing on Web switch tile — fixed
31+
- [x] **2.9** Platform override ignored on macOS host — `theme.platform` used instead of re-detecting *(Issue #139)*
32+
- [x] Replace deprecated `Switch.activeColor``Switch.activeThumbColor`
33+
- [x] Replace deprecated `CupertinoSwitch.activeColor``CupertinoSwitch.activeTrackColor`
34+
35+
---
36+
37+
## Phase 3 — Material 3 Theme Overhaul ✅
38+
39+
- [x] **3.1/3.2** Android light + dark — derived from `ColorScheme`
40+
- [x] **3.3** iOS themes — Cupertino hardcoded values retained
41+
- [x] **3.4** Web theme — derived from `ColorScheme`
42+
- [x] **3.5** `ThemeProvider.getTheme` reads `Theme.of(context).colorScheme`
43+
- [x] **3.6** `inactiveSwitchColor` added to `SettingsThemeData`
44+
45+
---
46+
47+
## Phase 4 — New Features ✅
48+
49+
- [x] **4.1** `compact: bool` on `SettingsTile` *(PR #178)*
50+
- [x] **4.2** `crossAxisAlignment` on `SettingsList` *(Issue #189)*
51+
- [x] **4.3** `titleTextStyle`, `tileTextStyle`, `tileDescriptionTextStyle` in `SettingsThemeData` *(Issue #185)*
52+
53+
---
54+
55+
## Phase 5 — Example App ✅
56+
57+
- [x] **5.1** Bump example SDK + Flutter constraints
58+
- [x] **5.2** Removed `device_preview` (incompatible with Dart 3.x); cleaned up `main.dart`
59+
- [x] **5.3** `cupertino_icons: ^1.0.8`
60+
- [x] **5.4** Android Gradle updated (Gradle 8.7, AGP 8.3.2, Kotlin 1.9.24, Java 17) — builds and runs
61+
- [x] **5.5** `Material3DemoScreen` added to gallery
62+
- [x] **5.6** All deprecated API usage fixed; `flutter analyze` zero issues
63+
64+
---
65+
66+
## Phase 6 — Tests ✅
67+
68+
- [x] **6.1** Test color assertions updated to use `colorScheme`
69+
- [x] **6.2** iOS value overflow test
70+
- [x] **6.3** RTL chevron tests (LTR + RTL)
71+
- [x] **6.4** Web enabled/switch color tests
72+
- [x] **6.5** Compact tile tests (Android, iOS, Web)
73+
- [x] **6.6** Coverage gate raised 35% → 60%; actual coverage: **92%**
74+
- [x] **6.7** 108 unit tests passing; 17 integration tests passing on Android emulator
75+
76+
---
77+
78+
## Phase 7 — CI & Release Prep ✅
79+
80+
- [x] **7.1** `actions/checkout@v4` in CI; coverage gate 60%
81+
- [x] **7.3** `version: 3.0.0` in `pubspec.yaml`
82+
- [x] **7.4** `CHANGELOG.md` entry for `3.0.0`
83+
- [x] **7.5** `flutter pub publish --dry-run` — passes (2 soft warnings: uncommitted files + .iml git state)
84+
- [ ] **7.6** Commit → merge `dev``master` → tag `v3.0.0`
85+
- [ ] **7.7** `flutter pub publish`
86+
87+
---
88+
89+
## Phase 8 — Post-Release: Issues & PRs
90+
91+
Do this **after** `3.0.0` is live on pub.dev.
92+
93+
### PRs to merge / close
94+
| PR | Title | Action |
95+
|----|-------|--------|
96+
| #193 | fix long IOSSettingsTile value text | Close — fixed in 2.1 |
97+
| #192 | flip RTL arrow | Close — fixed in 2.2 |
98+
| #191 | web platform pub.dev tag | Close — fixed in 2.3 |
99+
| #178 | compact SettingsTile | Close — implemented in 4.1 |
100+
101+
### Issues to close
102+
| Issue | Title | Response |
103+
|-------|-------|----------|
104+
| #199 | Future Updates | Announce v3.0.0 |
105+
| #198 | White screen in release APK | Likely unrelated to package; ask for minimal repro, link v3 |
106+
| #197 | Make a new release | Announce v3.0.0 |
107+
| #196 | Chevron missing | Fixed in v3 (RTL fix) |
108+
| #194 | inactiveColour for switchTile | Fixed in 3.6 |
109+
| #189 | SettingsList alignment override | Fixed in 4.2 |
110+
| #188 | Switch ignores switchTheme | Fixed in 2.6 |
111+
| #186 | Title/value wrapping | Fixed in 2.1 |
112+
| #185 | Custom font support | Fixed in 4.3 |
113+
| #184 | iOS dirty dependencies | Verify in v3 |
114+
| #180 | trailing missing on Web switch | Fixed in 2.7 |
115+
| #179 | Chrome/web support | Fixed in 2.3 |
116+
| #176 | Scrollbar on wide screens | Verify fix still works; close |
117+
| #174 | enabled ignored on Web | Fixed in 2.4 |
118+
| #173 | Switch color on Web | Fixed in 2.5 |
119+
| #170 | RTL navigation arrow | Fixed in 2.2 |
120+
| #168 | Alternative for background/subtitle | Document in v3 release notes |
121+
| #160 | Windows layout | Improved |
122+
| #148 | macOS layout | Improved |
123+
| #139 | platform override ignored on macOS | Fixed in 2.9 |
124+
| #110 | Switch not toggling | Ask if still present in v3 |
125+
126+
---
127+
128+
## Session Log
129+
130+
| Date | Session | What was done |
131+
|------|---------|---------------|
132+
| 2026-04-10 | 1 | Repo audit, CLAUDE.md written, V3_PLAN.md created |
133+
| 2026-04-10 | 2 | Phases 1–7 completed; all tests passing; ready to publish |

example/analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
analyzer:
2+
exclude:
3+
- lib/generated_plugin_registrant.dart

example/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "com.android.application"
3-
id "kotlin-android"
3+
id "org.jetbrains.kotlin.android"
44
id "dev.flutter.flutter-gradle-plugin"
55
}
66

@@ -28,12 +28,12 @@ android {
2828
ndkVersion flutter.ndkVersion
2929

3030
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_1_8
32-
targetCompatibility JavaVersion.VERSION_1_8
31+
sourceCompatibility JavaVersion.VERSION_17
32+
targetCompatibility JavaVersion.VERSION_17
3333
}
3434

3535
kotlinOptions {
36-
jvmTarget = '1.8'
36+
jvmTarget = '17'
3737
}
3838

3939
sourceSets {

example/android/build.gradle

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10-
}
11-
}
12-
131
allprojects {
142
repositories {
153
google()

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

example/android/settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ pluginManagement {
2323

2424
plugins {
2525
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26-
id "com.android.application" version "7.3.0" apply false
26+
id "com.android.application" version "8.3.2" apply false
27+
id "org.jetbrains.kotlin.android" version "1.9.24" apply false
2728
}
2829

2930
include ":app"

0 commit comments

Comments
 (0)