apliarte_glass_theme 0.2.0
apliarte_glass_theme: ^0.2.0 copied to clipboard
A beautiful glass morphism UI component library for Flutter — bottom navigation bar, app bar, and cards with liquid glass effects.
example/lib/main.dart
import 'package:apliarte_glass_theme/apliarte_glass_theme.dart';
void main() {
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ApliArte Glass Theme',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorSchemeSeed: const Color(0xFF10B981),
useMaterial3: true,
brightness: Brightness.light,
),
darkTheme: ThemeData(
colorSchemeSeed: const Color(0xFF10B981),
useMaterial3: true,
brightness: Brightness.dark,
),
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
int _currentIndex = 0;
bool _isDark = false;
void _toggleTheme() {
setState(() => _isDark = !_isDark);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorSchemeSeed: const Color(0xFF10B981),
useMaterial3: true,
brightness: Brightness.light,
),
darkTheme: ThemeData(
colorSchemeSeed: const Color(0xFF10B981),
useMaterial3: true,
brightness: Brightness.dark,
),
themeMode: _isDark ? ThemeMode.dark : ThemeMode.light,
home: Scaffold(
appBar: AppBar(
title: const Text('ApliArte Glass'),
actions: [
IconButton(
icon: Icon(_isDark ? Icons.light_mode : Icons.dark_mode),
onPressed: _toggleTheme,
),
],
),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
Card(
child: Column(
children: [
const Text('Glass Card',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
const SizedBox(height: 8),
const Text(
'Este card se adapta a tema claro y oscuro automáticamente.',
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
FilledButton(
onPressed: () {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('Diálogo Glass'),
content:
const Text('Este diálogo también es de vidrio.'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('Cerrar'),
),
],
),
);
},
child: const Text('Abrir diálogo'),
),
],
),
),
const SizedBox(height: 16),
Card(
child: ListTile(
leading: Icon(Icons.star, color: Colors.amber),
title: const Text('Componentes glass'),
subtitle: const Text('AppBar, Card, NavigationBar, BottomAppBar, AlertDialog'),
),
),
],
),
bottomNavigationBar: NavigationBar(
destinations: const [
NavigationDestination(icon: Icon(Icons.home_rounded), label: 'Home'),
NavigationDestination(icon: Icon(Icons.search_rounded), label: 'Search'),
NavigationDestination(icon: Icon(Icons.favorite_rounded), label: 'Favorites'),
NavigationDestination(icon: Icon(Icons.person_rounded), label: 'Profile'),
],
selectedIndex: _currentIndex,
onDestinationSelected: (index) {
setState(() => _currentIndex = index);
},
),
),
);
}
}