123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'dart:ffi';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import '../../../controller/controllers.dart';
- import '../controllers/welcome_controller.dart';
- class WelcomeView extends GetView<WelcomeController> {
- const WelcomeView({Key? key}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.white,
- body: Obx(() {
- if(controller.error.value.isNotEmpty) {
- String mess = controller.error.value;
- controller.error.value = '';
- Future.delayed(Duration.zero, () async {
- bool? result = await controllers.dialog.showNormalDialog(
- title: "提示",
- content: mess,
- cancelText: "取消",
- enterText: "确认",
- );
- if (result != null && result) {
- // User pressed "确认"
- await controller.fetchSysConfig();
- } else {
- // User pressed "取消" or dismissed the dialog
- }
- });
- }
- return const Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- CircularProgressIndicator(), // 菊花加载指示器
- SizedBox(height: 20), // 用于给加载指示器和文字之间增加一些空间
- Text(
- '正在获取系统配置',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- ),
- ),
- ],
- ), // 当不在加载时,你可能想要显示其他的 Widget
- );
- }),
- );
- }
- }
|