Skip to content

Instantly share code, notes, and snippets.

@mmanflori
Created January 27, 2019 10:47
Show Gist options
  • Save mmanflori/58aa10c0a8d31e1cf7a486751eaa5b70 to your computer and use it in GitHub Desktop.
Save mmanflori/58aa10c0a8d31e1cf7a486751eaa5b70 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'library.dart';
void main() => runApp(MeineApp());
class MeineApp extends StatefulWidget {
@override
_MeineAppState createState() => _MeineAppState();
}
class _MeineAppState extends State<MeineApp> {
double aA=0;
double bB=0;
dynamic mneueBox=boxDeco(0.0, 0.0);
void neueBox(){
setState(() {
aA=aA + 1.0;
bB=bB + 1.0;
mneueBox=boxDeco(aA, bB);
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "StateDemo",
home: new Scaffold(
body: new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Center(
child: new Container(
width: 50.0,
height: 50.0,
child: Center(child: new Text("Hallo"),),
decoration: mneueBox,
),
),
new IconButton(
color: Colors.deepOrange,
icon:Icon(Icons.star) ,
onPressed:neueBox,
)
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment