Skip to content

Instantly share code, notes, and snippets.

@SouzaRodrigo61
Created August 31, 2019 15:07
Show Gist options
  • Save SouzaRodrigo61/03de9aa70d1657483305c3fa1e5110be to your computer and use it in GitHub Desktop.
Save SouzaRodrigo61/03de9aa70d1657483305c3fa1e5110be to your computer and use it in GitHub Desktop.
AnimatedContainer
class HomeView extends StatefulWidget {
const HomeView({Key key}) : super(key: key);
@override
_HomeViewState createState() => _HomeViewState();
}
class _HomeViewState extends State<HomeView> {
// Add variable to top of class
Alignment childAlignment = Alignment.center;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white30,
body: AnimatedContainer(
curve: Curves.easeOut,
duration: Duration(
milliseconds: 1000,
),
width: double.infinity,
height: double.infinity,
padding: const EdgeInsets.all(20),
alignment: Alignment.bottomCenter,
child: Container(
margin: const EdgeInsets.only(bottom: 50),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10)
),
color: Colors.white.withAlpha(200),
),
width: 360,
height: 200,
padding: const EdgeInsets.all(20),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
'teste',
style: TextStyle(fontSize: 30),
),
TextField(
decoration: InputDecoration(
hasFloatingPlaceholder: true,
hintText: 'Enter things here'
),
)
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment