adaptive_theme_fluent_ui 1.3.0 adaptive_theme_fluent_ui: ^1.3.0 copied to clipboard
An extension package of adaptive_theme library that supports dynamic theming for fluent_ui package.
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:example/fluent_example.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final savedThemeMode = await AdaptiveTheme.getThemeMode();
runApp(MyApp(savedThemeMode: savedThemeMode));
}
class MyApp extends StatefulWidget {
final AdaptiveThemeMode? savedThemeMode;
const MyApp({super.key, this.savedThemeMode});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return AnimatedSwitcher(
duration: const Duration(seconds: 1),
child: FluentExample(
savedThemeMode: widget.savedThemeMode,
),
);
}
}