animal_crossing_ui 0.5.3
animal_crossing_ui: ^0.5.3 copied to clipboard
A beautiful Flutter UI component library inspired by Animal Crossing. Features 44+ custom widgets, 16+ predefined themes (character & seasonal palettes), dynamic theme builder, and true flat design. Z [...]
import 'package:flutter/widgets.dart';
import 'package:animal_crossing_ui/animal_crossing_ui.dart';
import 'pages/home_page.dart';
void main() {
runApp(const ExampleApp());
}
class ExampleApp extends StatefulWidget {
const ExampleApp({super.key});
@override
State<ExampleApp> createState() => _ExampleAppState();
}
class _ExampleAppState extends State<ExampleApp> {
String _currentTheme = 'autumn'; // Default theme
void _changeTheme(String themeName) {
setState(() {
_currentTheme = themeName;
});
}
@override
Widget build(BuildContext context) {
final lightTheme = ACUIThemePresets.getTheme(_currentTheme, dark: false);
final darkTheme = ACUIThemePresets.getTheme(_currentTheme, dark: true);
return ACUIApp(
title: 'Animal Crossing UI Example',
theme: lightTheme,
darkTheme: darkTheme,
home: Builder(
builder: (context) {
// Initialize toast controller with context
ACUIToastController.instance.init(context);
return HomePage(
currentTheme: _currentTheme,
onThemeChanged: _changeTheme,
);
},
),
);
}
}