-
-
Save mmanflori/58aa10c0a8d31e1cf7a486751eaa5b70 to your computer and use it in GitHub Desktop.
This file contains 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'; | |
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