flutter_tweakcn_generator 0.2.3
flutter_tweakcn_generator: ^0.2.3 copied to clipboard
Converts tweakcn CSS themes into Flutter ThemeData with ColorScheme, ThemeExtension, Google Fonts, and light/dark mode support.
import 'package:flutter/material.dart';
import 'home_page.dart';
import 'theme/tweakcn_theme.g.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
ThemeMode _themeMode = ThemeMode.light;
void _toggleTheme() {
setState(() {
_themeMode = _themeMode == ThemeMode.light
? ThemeMode.dark
: ThemeMode.light;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'tweakcn Theme Example',
theme: TweakcnTheme.light,
darkTheme: TweakcnTheme.dark,
themeMode: _themeMode,
home: HomePage(onToggleTheme: _toggleTheme),
);
}
}