beautiful_widgets 0.0.1
beautiful_widgets: ^0.0.1 copied to clipboard
Animated button widget with built-in press transitions
example/lib/main.dart
import 'package:beautiful_widgets/beautiful_widgets.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const DemoApp());
}
class DemoApp extends StatelessWidget {
const DemoApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'beautiful_widgets demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: const DemoPage(),
);
}
}
class DemoPage extends StatelessWidget {
const DemoPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('BeautifulButton demo')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
_demoButton(
label: 'ScaleTransition',
type: TransactionType.ScaleTransition,
),
const SizedBox(height: 12),
_demoButton(
label: 'SlideTransition',
type: TransactionType.SlideTransition,
),
const SizedBox(height: 12),
_demoButton(
label: 'FadeTransition',
type: TransactionType.FadeTransition,
),
const SizedBox(height: 12),
_demoButton(
label: 'RotationTransition',
type: TransactionType.RotationTransition,
),
const SizedBox(height: 12),
_demoButton(
label: 'SizeTransition',
type: TransactionType.SizeTransition,
),
],
),
);
}
Widget _demoButton({required String label, required TransactionType type}) {
return BeautifulButton(
label,
transactionType: type,
minimumSize: const Size.fromHeight(48),
onPressed: () {},
);
}
}