Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RoundedButton extends StatefulWidget {
- RoundedButton({Key key, this.title, this.width, this.height})
- : super(key: key);
- final String title;
- double width;
- double height;
- @override
- _RoundedButtonState createState() => _RoundedButtonState();
- }
- class _RoundedButtonState extends State<RoundedButton> {
- int counter = 0;
- void _counter() {
- setState(() {
- counter = counter + 1;
- });
- }
- @override
- Widget build(BuildContext context) {
- return Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Center(
- child: ClipPath(
- clipper: CustomClipperButton(),
- child: Stack(
- children: [
- InkWell(
- onTap: _counter,
- child: Container(
- width: widget.width,
- height: widget.height,
- color: Colors.purple[900],
- child: Container(
- width: widget.width*2/3,
- height: widget.height*2/3,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.purple[300],
- spreadRadius: 0,
- blurRadius: 20.0,
- ),
- ],
- ),
- ),
- ),
- ),
- Positioned(
- bottom: -70,
- right: -90,
- child: Container(
- width: widget.width*60/10,
- height: widget.width*60/10,
- decoration: BoxDecoration(
- color: Colors.transparent,
- shape: BoxShape.circle,
- boxShadow: [
- BoxShadow(
- color: Colors.purple[800],
- spreadRadius: 5,
- blurRadius: 20.0,
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- /*SizedBox(height: 30),
- Text(
- "You Pressed $counter times",
- style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
- )*/
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement