spring_view 0.0.8
spring_view: ^0.0.8 copied to clipboard
A Flutter package that provides an animated button with a delightful bounce effect. Easily integrate it into your app for a playful touch.
import 'package:flutter/material.dart';
import 'package:spring_view/spring_view.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
title: const Text("Spring view"),
),
body: Column(
children: [
const SizedBox(
height: 30,
),
SpringView(
child: Center(
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(8),
),
child: const Text(
"Spring view example",
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
),
),
onPressed: () {}),
const SizedBox(
height: 30,
),
SpringView(
child: Center(
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(8),
),
child: const Icon(
Icons.add,
color: Colors.white,
),
),
),
onPressed: () {}),
const SizedBox(
height: 30,
),
SpringView(
child: const Center(
child: Text(
"Simple text",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
)),
onPressed: () {}),
const SizedBox(
height: 30,
),
],
),
);
}
}