Erweiterungen
This commit is contained in:
1 parent
70fb6dd5ef
commit
70a8c04516
3 files changed
+46
-17
No files matched your search
+28
-14
@@ -122,7 +122,7 @@ class Main extends StatefulWidget {
|
||||
State<Main> createState() => _MainState();
|
||||
}
|
||||
|
||||
class _MainState extends State<Main> {
|
||||
class _MainState extends State<Main> with SingleTickerProviderStateMixin {
|
||||
late ContentViewWidget _currentContent;
|
||||
late WidgetStack<ContentViewWidget> contentStack = WidgetStack();
|
||||
|
||||
@@ -141,10 +141,17 @@ class _MainState extends State<Main> {
|
||||
|
||||
final ValueNotifier<bool> _connectionLostValueNotifier = ValueNotifier<bool>(true);
|
||||
|
||||
late AnimationController _animationController;
|
||||
late Animation<double> _animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 1000));
|
||||
_animationController.repeat(reverse: true);
|
||||
_animation = Tween<double>(begin: 0.5, end: 1.0).animate(_animationController);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_initMessages();
|
||||
|
||||
@@ -269,26 +276,33 @@ class _MainState extends State<Main> {
|
||||
builder: (context, value, child) {
|
||||
return Visibility(
|
||||
visible: value,
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 30,
|
||||
color: Colors.red,
|
||||
child: const Center(
|
||||
child: Text(
|
||||
"*** OFFLINE ***",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15.0,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 1),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 40,
|
||||
color: Constants.colorPrimary,
|
||||
child: Center(
|
||||
child: FadeTransition(
|
||||
opacity: _animation,
|
||||
child: const Text(
|
||||
"*** OFFLINE ***",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 25.0,
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Expanded(child: _currentContent),
|
||||
],
|
||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user