flutter_skin 0.0.2
flutter_skin: ^0.0.2 copied to clipboard
A runtime skin engine for Flutter projects, allowing dynamic theme changes without the need for app restarts.
import 'package:flutter/material.dart';
import 'package:flutter_skin/flutter_skin.dart';
import 'pages/home_page.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await FlutterSkin.init(
apiKey:
"fsk_b4331e99326b000434d601a80284abf89b8425e5f246f3b76a924c9d04486012",
);
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
FlutterSkin.onSkinChanged.listen((_) {
setState(() {});
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: FlutterSkin.toThemeData(),
home: const MyHomePage(title: 'Movie Browser'),
);
}
}