-
Notifications
You must be signed in to change notification settings - Fork 0
/
Seite4.dart
82 lines (66 loc) · 2.03 KB
/
Seite4.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import 'package:flutter/material.dart';
class AnimierterButton extends StatefulWidget {
@override
_AnimierterButtonState createState() => _AnimierterButtonState();
}
class _AnimierterButtonState extends State<AnimierterButton> {
bool _visible = true;
@override
Widget build(BuildContext context) {
return Row(children: <Widget> [
Expanded(
child: SizedBox(
child: Row(children: <Widget>[
Container(
width: 200,
height: 200,
color: Colors.cyan,
child: FloatingActionButton(
heroTag: "demoValue",
tooltip: "Ich verschwinde",
child: _visible == true ? Text("Ich verschwinde, Bye") : Text("Bitte komm wieder"),
onPressed: () {
setState(() {
_visible = !_visible;
});
},
)),
Container(
child: Center(
child: AnimatedOpacity(
opacity: _visible ? 1.0 : 0.0,
duration: Duration(seconds: 2),
child: Container(
width: 100,
height: 100,
color: Colors.lime,
),
),
),
),
Container(
child: Text("Kleiner Test"),
)
])),
)
]);
}
}
class Seite4 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.red,
body: ListView(
children: <Widget>[
Center(
child: Text(
"Was geht hier??",
textScaleFactor: 2,
style: TextStyle(fontSize: 22),
)),
AnimierterButton(),
],
));
}
}