Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import 'package:flutter/material.dart';
class Option5 extends StatefulWidget {
_Option5State createState() => _Option5State();
class _Option5State extends State<Option5> with TickerProviderStateMixin {
AlignmentDirectional _ironManAlignment = AlignmentDirectional(0.0, 0.7);
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/ibg.png'),
fit: BoxFit.cover)),
duration: Duration(seconds: 3),
alignment: _ironManAlignment,
child: Container(
height: 250,
width: 150,
child: Image.asset('assets/images/ironman.png'),
alignment: AlignmentDirectional.bottomCenter,
child: RaisedButton(
onPressed: () {
child: Text('Go'),
textColor: Colors.yellowAccent,
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20))),
void _flyIronMan() {
setState(() {
_ironManAlignment = AlignmentDirectional(0.0,-0.7);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.