Skip to content

Instantly share code, notes, and snippets.

@AlexKenbo
Created March 21, 2020 16:50
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 AlexKenbo/1397c21024126b071578d12f9ffef9d4 to your computer and use it in GitHub Desktop.
Save AlexKenbo/1397c21024126b071578d12f9ffef9d4 to your computer and use it in GitHub Desktop.
estethic
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