widget_collection 1.0.0+1
widget_collection: ^1.0.0+1 copied to clipboard
A collection of beautiful, customizable Flutter widgets including animated buttons, gradient containers, loading spinners, and shimmer effects.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:widget_collection/widgte_collection.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Widget Collection Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const DemoPage(),
);
}
}
class DemoPage extends StatelessWidget {
const DemoPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Widget Collection Demo'),
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text(
'AnimatedButton',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
AnimatedButton(
text: 'Tap Me!',
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Button pressed!')),
);
},
backgroundColor: Colors.blue,
),
const SizedBox(height: 30),
const Text(
'CustomCard',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
CustomCard(
child: const Text(
'This is a custom card with elevation and rounded corners.',
style: TextStyle(fontSize: 16),
),
onTap: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Card tapped!')),
);
},
),
const SizedBox(height: 30),
const Text(
'GradientContainer',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
GradientContainer(
colors: const [Colors.purple, Colors.blue, Colors.teal],
borderRadius: 12.0,
height: 100,
child: const Center(
child: Text(
'Gradient Background',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 30),
const Text(
'LoadingSpinner',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
const LoadingSpinner(
size: 50.0,
color: Colors.blue,
message: 'Loading...',
),
const SizedBox(height: 30),
const Text(
'ShimmerPlaceholder',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
Column(
children: [
const ShimmerPlaceholder(width: double.infinity, height: 20),
const SizedBox(height: 8),
const ShimmerPlaceholder(width: double.infinity, height: 20),
const SizedBox(height: 8),
const ShimmerPlaceholder(width: 150, height: 20),
],
),
],
),
),
);
}
}