Advertisement
Guest User

Untitled

a guest
Dec 7th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.44 KB | None | 0 0
  1. class RoundedButton extends StatefulWidget {
  2.   RoundedButton({Key key, this.title, this.width, this.height})
  3.       : super(key: key);
  4.  
  5.   final String title;
  6.   double width;
  7.   double height;
  8.  
  9.   @override
  10.   _RoundedButtonState createState() => _RoundedButtonState();
  11. }
  12.  
  13. class _RoundedButtonState extends State<RoundedButton> {
  14.   int counter = 0;
  15.  
  16.   void _counter() {
  17.     setState(() {
  18.       counter = counter + 1;
  19.     });
  20.   }
  21.  
  22.   @override
  23.   Widget build(BuildContext context) {
  24.     return Column(
  25.       mainAxisAlignment: MainAxisAlignment.center,
  26.       children: [
  27.         Center(
  28.           child: ClipPath(
  29.             clipper: CustomClipperButton(),
  30.             child: Stack(
  31.               children: [
  32.                 InkWell(
  33.                   onTap: _counter,
  34.                   child: Container(
  35.                     width: widget.width,
  36.                     height: widget.height,
  37.                     color: Colors.purple[900],
  38.                     child: Container(
  39.                       width: widget.width*2/3,
  40.                       height: widget.height*2/3,
  41.                       decoration: BoxDecoration(
  42.                         boxShadow: [
  43.                           BoxShadow(
  44.                             color: Colors.purple[300],
  45.                             spreadRadius: 0,
  46.                             blurRadius: 20.0,
  47.                           ),
  48.                         ],
  49.                       ),
  50.                     ),
  51.                   ),
  52.                 ),
  53.                 Positioned(
  54.                   bottom: -70,
  55.                   right: -90,
  56.                   child: Container(
  57.                     width: widget.width*60/10,
  58.                     height: widget.width*60/10,
  59.                     decoration: BoxDecoration(
  60.                       color: Colors.transparent,
  61.                       shape: BoxShape.circle,
  62.                       boxShadow: [
  63.                         BoxShadow(
  64.                           color: Colors.purple[800],
  65.                           spreadRadius: 5,
  66.                           blurRadius: 20.0,
  67.                         ),
  68.                       ],
  69.                     ),
  70.                   ),
  71.                 ),
  72.               ],
  73.             ),
  74.           ),
  75.         ),
  76.         /*SizedBox(height: 30),
  77.           Text(
  78.             "You Pressed $counter times",
  79.             style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
  80.           )*/
  81.       ],
  82.     );
  83.   }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement