Created
March 21, 2020 16:50
-
-
Save AlexKenbo/1397c21024126b071578d12f9ffef9d4 to your computer and use it in GitHub Desktop.
estethic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
final config = { | |
'primaryColor': Colors.grey[200], | |
}; | |
double myOffset = -200.0; | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primaryColor: config['primaryColor'], | |
floatingActionButtonTheme: FloatingActionButtonThemeData( | |
elevation: 35, | |
highlightElevation: 20, | |
foregroundColor: Colors.grey[800], | |
), | |
accentColor: Colors.grey[200], | |
), | |
home: MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
elevation: 0, | |
title: Text(widget.title), | |
), | |
body: Stack( | |
children: <Widget>[ | |
Transform.translate( | |
offset: Offset(myOffset, 15.0), | |
child: Image.asset('assets/images/pngbarn1.png'), | |
), | |
], | |
), | |
floatingActionButton: | |
FloatingActionButton(child: Icon(Icons.ac_unit), onPressed: () { | |
setState(() { | |
myOffset = myOffset +15; | |
}); | |
}), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment