yir_glass_card 0.0.7
yir_glass_card: ^0.0.7 copied to clipboard
A modern glassmorphism card widget for Flutter with blur effects, gradients, and customizable UI design.
import 'package:flutter/material.dart';
import 'package:yir_glass_card/yir_glass_card.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
final List<Color> colors = const [
Colors.black,
Colors.blue,
Colors.purple,
Colors.orange,
Colors.red,
Colors.teal,
Colors.green,
Colors.brown,
];
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: const Text("YIR Glass Card",style: TextStyle(color: Colors.white),),
backgroundColor: Colors.red,
elevation: 0,
),
body: Padding(
padding: const EdgeInsets.all(12),
child: GridView.builder(
itemCount: colors.length,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, // 2 columns
crossAxisSpacing: 12,
mainAxisSpacing: 12,
childAspectRatio: 1.1,
),
itemBuilder: (context, index) {
return YirGlassCard(
width: double.infinity,
height: double.infinity,
color: colors[index],
blur: 12,
child: Center(
child: Text(
"YIR Card ${index + 1}",
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
);
},
),
),
),
);
}
}