Skip to content

Instantly share code, notes, and snippets.

@erikwco
Created May 16, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikwco/2a5bf6e6d06c86b325b2f3e19913b019 to your computer and use it in GitHub Desktop.
Save erikwco/2a5bf6e6d06c86b325b2f3e19913b019 to your computer and use it in GitHub Desktop.
Animated Button 0
import 'package:flutter/material.dart';
class AnimatedProgressButton extends StatefulWidget {
@override
_AnimatedProgressButtonState createState() => _AnimatedProgressButtonState();
}
class _AnimatedProgressButtonState extends State<AnimatedProgressButton>{
@override
void initState() {
super.initState();
}
@override dispose() {
super.dispose();
}
Widget build(BuildContext context) => Stack(
alignment: Alignment.topLeft,
children: <Widget>[
Container(margin: EdgeInsets.only(top: 40), width: 300, height: 5,
decoration: BoxDecoration(color: Colors.yellow),),
Container(width: 300,height: 40,
decoration: BoxDecoration(borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10))),
child: RaisedButton(onPressed: (){},
color: Colors.grey,
child: Text("Welcome",style: TextStyle(color: Colors.white, fontSize: 20),),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10),
),
),
disabledColor: Colors.black,
disabledElevation: 2.0,
splashColor: Colors.transparent,
),
)
],
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: AnimatedProgressButton()
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment