Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 2.0.0
> **Note**: This release contains breaking changes.

**New Features:**
- **System Theme Mode Integration**: `PlayxTheme` now fully supports and tracks device theme modes natively across the app (`ThemeMode.system`, `ThemeMode.light`, `ThemeMode.dark`).
- **Reactive UI**: Added `PlayxTheme.themeModeNotifier` (`ValueNotifier<ThemeMode>`) allowing dynamic UI rebuilds anytime the app's internal theme mode state shifts.
- **Improved Platform Synchronization**: Instantiated a `WidgetsBindingObserver` in the controller to passively catch system brightness updates and apply changes dynamically when `ThemeMode.system` is activated.

**Enhancements:**
- **Config Customization**: Added `lightThemeIndex` and `darkThemeIndex` in `PlayxThemeConfig` to explicitly point out light and dark configuration targets when toggling between themes automatically via system modes.
- **Robust Initial Booting**: Added `initialThemeMode` to flexibly specify initial defaults without forcing numeric indices. `initialThemeIndex` is now nullable to create a clean fallback hierarchy.
- **API Expansion**: Introduced the `updateMode` flag inside update mechanics (`updateTo`, `updateById`, `updateByIndex`, `next`). This gives exact control to avoid overriding mode state during temporary localized theme shifts.
- **SDK Update**: Enforced new SDK constraints: `sdk: '>=3.10.0 <4.0.0'` and `flutter: '>=3.38.0'`.
- Updated all underlying package dependencies to latest.

## 1.1.1
- Bump `playx_core` dependency to `^0.7.4`.
- Wrap `PlayxThemeBuilder`'s child in a `Theme` widget to ensure correct theme data is applied down the widget tree.
Expand Down
11 changes: 6 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
PODS:
- Flutter (1.0.0)
- flutter_secure_storage (6.0.0):
- flutter_secure_storage_darwin (10.0.0):
- Flutter
- FlutterMacOS
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -11,23 +12,23 @@ PODS:

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- flutter_secure_storage_darwin (from `.symlinks/plugins/flutter_secure_storage_darwin/darwin`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
flutter_secure_storage_darwin:
:path: ".symlinks/plugins/flutter_secure_storage_darwin/darwin"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"

SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
flutter_secure_storage_darwin: acdb3f316ed05a3e68f856e0353b133eec373a23
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7

Expand Down
79 changes: 78 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,42 @@ class HomeScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 20),
const Text('Playx Theme Switcher'),
const Text('Playx Theme Mode'),
const SizedBox(height: 8),
ValueListenableBuilder<ThemeMode>(
valueListenable: PlayxTheme.themeModeNotifier,
builder: (context, mode, child) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildThemeModeCard(
context,
title: 'Light',
icon: Icons.light_mode,
isSelected: mode == ThemeMode.light,
onTap: () => PlayxTheme.updateToLightMode(),
),
_buildThemeModeCard(
context,
title: 'Dark',
icon: Icons.dark_mode,
isSelected: mode == ThemeMode.dark,
onTap: () => PlayxTheme.updateToDarkMode(),
),
_buildThemeModeCard(
context,
title: 'System',
icon: Icons.settings_system_daydream,
isSelected: mode == ThemeMode.system,
onTap: () => PlayxTheme.updateToDeviceMode(),
),
],
);
},
),
const SizedBox(height: 20),
const Text('Playx Theme Switcher'),
const SizedBox(height: 8),
SizedBox(
width: 200,
child: Card(
Expand Down Expand Up @@ -168,4 +202,47 @@ class HomeScreen extends StatelessWidget {
),
);
}

Widget _buildThemeModeCard(
BuildContext context, {
required String title,
required IconData icon,
required bool isSelected,
required VoidCallback onTap,
}) {
return GestureDetector(
onTap: onTap,
child: Card(
color: isSelected
? context.playxColors.primary
: context.playxColors.surfaceContainerHigh,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: isSelected
? BorderSide(color: context.playxColors.onPrimary, width: 2)
: BorderSide.none,
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0),
child: Column(
children: [
Icon(icon,
color: isSelected
? context.playxColors.onPrimary
: context.playxColors.onSurface),
const SizedBox(height: 8),
Text(
title,
style: TextStyle(
color: isSelected
? context.playxColors.onPrimary
: context.playxColors.onSurface,
),
),
],
),
),
),
);
}
}
4 changes: 2 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import FlutterMacOS
import Foundation

import flutter_secure_storage_macos
import flutter_secure_storage_darwin
import path_provider_foundation
import shared_preferences_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
}
78 changes: 35 additions & 43 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: equatable
sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7"
sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b"
url: "https://pub.dev"
source: hosted
version: "2.0.7"
version: "2.0.8"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -93,10 +93,10 @@ packages:
dependency: transitive
description:
name: flex_seed_scheme
sha256: b06d8b367b84cbf7ca5c5603c858fa5edae88486c4e4da79ac1044d73b6c62ec
sha256: a3183753bbcfc3af106224bff3ab3e1844b73f58062136b7499919f49f3667e7
url: "https://pub.dev"
source: hosted
version: "3.5.1"
version: "4.0.1"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -122,50 +122,50 @@ packages:
dependency: transitive
description:
name: flutter_secure_storage
sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea"
sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40
url: "https://pub.dev"
source: hosted
version: "9.2.4"
flutter_secure_storage_linux:
version: "10.0.0"
flutter_secure_storage_darwin:
dependency: transitive
description:
name: flutter_secure_storage_linux
sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688
name: flutter_secure_storage_darwin
sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3"
url: "https://pub.dev"
source: hosted
version: "1.2.3"
flutter_secure_storage_macos:
version: "0.2.0"
flutter_secure_storage_linux:
dependency: transitive
description:
name: flutter_secure_storage_macos
sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247"
name: flutter_secure_storage_linux
sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda"
url: "https://pub.dev"
source: hosted
version: "3.1.3"
version: "3.0.0"
flutter_secure_storage_platform_interface:
dependency: transitive
description:
name: flutter_secure_storage_platform_interface
sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8
sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "2.0.1"
flutter_secure_storage_web:
dependency: transitive
description:
name: flutter_secure_storage_web
sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9
sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "2.1.0"
flutter_secure_storage_windows:
dependency: transitive
description:
name: flutter_secure_storage_windows
sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709
sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
version: "4.1.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -180,18 +180,10 @@ packages:
dependency: transitive
description:
name: get_it
sha256: "84792561b731b6463d053e9761a5236da967c369da10b134b8585a5e18429956"
sha256: "568d62f0e68666fb5d95519743b3c24a34c7f19d834b0658c46e26d778461f66"
url: "https://pub.dev"
source: hosted
version: "9.0.5"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "9.2.1"
leak_tracker:
dependency: transitive
description:
Expand Down Expand Up @@ -244,10 +236,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -316,17 +308,17 @@ packages:
dependency: transitive
description:
name: playx_core
sha256: b49e07caeda91353f04f68d52c751fdec0513faf46646c74ef785ca258fd1683
sha256: "1d92e7d33d1132b2fabd779149b9a95b2dbf4b8b0f8f6ea28cad76950ef12f94"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "1.0.0"
playx_theme:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.1.1"
version: "1.2.0"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -339,10 +331,10 @@ packages:
dependency: transitive
description:
name: shared_preferences
sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5"
sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf
url: "https://pub.dev"
source: hosted
version: "2.5.3"
version: "2.5.5"
shared_preferences_android:
dependency: transitive
description:
Expand Down Expand Up @@ -440,10 +432,10 @@ packages:
dependency: transitive
description:
name: talker_logger
sha256: "8218836d871ea5ab1ec616cffe3cdae84e8fb44022d5cc04c95d7b220572b8fb"
sha256: cea1b8283a28c2118a0b197057fc5beb5b0672c75e40a48725e5e452c0278ff3
url: "https://pub.dev"
source: hosted
version: "5.0.2"
version: "5.1.16"
term_glyph:
dependency: transitive
description:
Expand All @@ -456,10 +448,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.7"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -509,5 +501,5 @@ packages:
source: hosted
version: "1.1.0"
sdks:
dart: ">=3.8.0 <4.0.0"
flutter: ">=3.27.0"
dart: ">=3.10.0 <4.0.0"
flutter: ">=3.38.0"
Loading
Loading