This commit is contained in:
2023-08-28 16:56:36 +08:00
parent 2cffe62963
commit 73f40a30e6
6 changed files with 83 additions and 2 deletions

View File

@@ -1,12 +1,26 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'globals.dart';
class HomePage extends StatelessWidget {
class HomePage extends HookWidget {
const HomePage({Key? key}) : super(key: key);
static const String routeName = '/';
@override
Widget build(BuildContext context) {
useEffect(() {
String? baseUrl = prefs.getString("baseUrl");
if (baseUrl == null) {
SchedulerBinding.instance.addPostFrameCallback((_) {
context.go("/set_server");
});
return;
}
return;
}, []);
return const Scaffold(
body: Center(
child: Text('Hello World!'),