Skip to content

Commit 196a662

Browse files
authored
Merge pull request #200 from yako-dev/dev
feat: release v3.0.0
2 parents d8d97b2 + 4c8fbe6 commit 196a662

82 files changed

Lines changed: 3419 additions & 913 deletions

File tree

Some content is hidden

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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Connection with issue(s)
2+
3+
Resolve issue #???
4+
5+
<!-- Required: this reference (one or many) will be closed upon merge. Ideally it has the acceptance criteria and designs for features or fixes related to the work in this Pull Request -->
6+
7+
Connected to #???
8+
9+
<!-- Optional: other issues or pull requests related to this, but merging should not close it -->
10+
11+
## Testing and Review Notes
12+
13+
<!-- Required: steps to take to confirm this works as expected or other guidance for code, UX, and any other reviewers -->
14+
15+
## Screenshots or Videos
16+
17+
<!-- Optional: to clearly demonstrate the feature or fix to help with testing and reviews -->
18+
19+
## To Do
20+
21+
<!-- Add “WIP” to the PR title if pushing up but not complete nor ready for review -->
22+
- [ ] double check the original issue to confirm it is fully satisfied
23+
- [ ] add testing notes and screenshots in PR description to help guide reviewers
24+
- [ ] request the "UX" team perform a design review (if/when applicable)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Code Quality
2+
3+
on: [push]
4+
5+
jobs:
6+
format-and-fix:
7+
if: ${{ !github.event.pull_request.draft }}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Setup flutter
14+
uses: subosito/flutter-action@v2
15+
with:
16+
channel: stable
17+
18+
- name: Get packages
19+
run: flutter pub get
20+
21+
- name: Check format errors
22+
run: flutter format --set-exit-if-changed .
23+
24+
- name: Check lint errors
25+
run: flutter analyze .
26+
27+
- name: Run tests
28+
run: flutter test --coverage --test-randomize-ordering-seed random
29+
30+
- name: Very Good Coverage
31+
uses: VeryGoodOpenSource/very_good_coverage@v2.1.0
32+
with:
33+
min_coverage: 60
34+
35+
- name: Flutter Problem Matcher
36+
uses: leancodepl/dart-problem-matcher@main
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check PR title
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
- synchronize
10+
11+
jobs:
12+
main:
13+
name: Validate PR title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: deepakputhraya/action-pr-title@master
17+
with:
18+
max_length: 100
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
- uses: amannn/action-semantic-pull-request@v4
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.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 |

analysis_options.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
analyzer:
2-
enable-experiment:
3-
- extension-methods
1+
include: package:flutter_lints/flutter.yaml

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

0 commit comments

Comments
 (0)