mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
@@ -1,3 +1,11 @@
|
||||
## 1.0.3
|
||||
|
||||
* Added the ability to switch back to the normal environment from the debug environment in ArcaneEnvironment
|
||||
* (breaking) Made the optional `onLoggedOut` callback a Future instead of a void function in ArcaneAuthenticationService
|
||||
* Added additional error handling to the login method in ArcaneAuthenticationService
|
||||
* Added support for following the system's theme in ArcaneTheme
|
||||
* Removed the BuildContext parameter from the `switchTheme` method in ArcaneTheme
|
||||
|
||||
## 1.0.2
|
||||
|
||||
* Migrated ArcaneAuthenticationService's isSignedIn to a ValueListenable
|
||||
|
||||
@@ -452,7 +452,7 @@ await Arcane.auth.setDebug();
|
||||
|
||||
The Arcane Framework provides a simple interface for managing themes in your application, with dynamic switching between dark and light themes based on the user's system settings, or manually switching between themes.
|
||||
|
||||
To get started, first register your `ThemeData` objects with the Arcane theme module, then reference the theme in your `MaterialApp` or `CupertinoApp`:
|
||||
To get started, first register your `ThemeData` objects with the Arcane theme module:
|
||||
|
||||
```dart
|
||||
void main() {
|
||||
@@ -463,21 +463,66 @@ void main() {
|
||||
|
||||
runApp(
|
||||
ArcaneApp(
|
||||
child: MaterialApp(
|
||||
theme: Arcane.theme.light,
|
||||
darkTheme: Arcane.theme.dark,
|
||||
themeMode: context.isDarkMode ? ThemeMode.dark : ThemeMode.light,
|
||||
),
|
||||
child: MainApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Once configured, you'll have access to theme-related methods and properties:
|
||||
From here, you can either follow the system theme:
|
||||
|
||||
```dart
|
||||
// Follow the system's theme mode
|
||||
class MainApp extends StatefulWidget {
|
||||
const MainApp({super.key});
|
||||
|
||||
@override
|
||||
State<MainApp> createState() => _MainAppState();
|
||||
}
|
||||
|
||||
class _MainAppState extends State<MainApp> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ArcaneApp(
|
||||
child: MaterialApp(
|
||||
theme: Arcane.theme.light,
|
||||
darkTheme: Arcane.theme.dark,
|
||||
themeMode: Arcane.theme.systemTheme.value,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
Arcane.theme.followSystemTheme(context);
|
||||
super.didChangeDependencies();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
or manually control the theme mode:
|
||||
|
||||
```dart
|
||||
// Manually control the theme mode
|
||||
class MainApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ArcaneApp(
|
||||
child: MaterialApp(
|
||||
theme: Arcane.theme.light,
|
||||
darkTheme: Arcane.theme.dark,
|
||||
themeMode: Arcane.theme.currentMode,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then, you can switch modes whenever you want:
|
||||
|
||||
```dart
|
||||
// Switch between light and dark themes
|
||||
Arcane.theme.switchTheme(context);
|
||||
Arcane.theme.switchTheme();
|
||||
|
||||
// Access current theme data
|
||||
final ThemeData currentTheme = Arcane.theme.currentMode == ThemeMode.dark
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: arcane_framework
|
||||
description: "Agnostic Reusable Component Architecture for New Ecosystems"
|
||||
version: 1.0.2
|
||||
version: 1.0.3
|
||||
repository: https://github.com/hanskokx/arcane_framework
|
||||
issue_tracker: https://github.com/hanskokx/arcane_framework/issues
|
||||
|
||||
|
||||
Reference in New Issue
Block a user