opt.: auto switch status bar

This commit is contained in:
lollipopkit
2023-06-21 16:57:06 +08:00
parent 0aff5b3b72
commit 625bc280f0
4 changed files with 10 additions and 33 deletions

View File

@@ -42,7 +42,7 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
@override
void initState() {
super.initState();
hideStatusBar();
switchStatusBar(hide: true);
_timer = Timer.periodic(const Duration(minutes: 1), (_) {
if (mounted) {
setState(() {});

View File

@@ -50,6 +50,7 @@ class _HomePageState extends State<HomePage>
@override
void initState() {
super.initState();
switchStatusBar(hide: false);
WidgetsBinding.instance.addObserver(this);
_selectIndex.value = _setting.launchPage.fetch()!;
// avoid index out of range

View File

@@ -1,26 +0,0 @@
import 'package:flutter/material.dart';
class CardDialog extends StatelessWidget {
const CardDialog(
{Key? key, this.title, this.content, this.actions, this.padding})
: super(key: key);
final Widget? content;
final List<Widget>? actions;
final Widget? title;
final EdgeInsets? padding;
@override
Widget build(BuildContext context) {
return AlertDialog(
contentPadding: padding,
actionsPadding: const EdgeInsets.all(7),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20.0)),
),
title: title,
content: content,
actions: actions,
);
}
}