|
@@ -3,6 +3,7 @@ import 'dart:ffi';
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
+import 'package:naiyouwl/app/component/sys_app_bar.dart';
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
import '../../../controller/controllers.dart';
|
|
@@ -13,66 +14,76 @@ class WelcomeView extends GetView<WelcomeController> {
|
|
|
|
|
|
@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 {
|
|
|
+ return Container(
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ image: DecorationImage(
|
|
|
+ image: AssetImage("assets/images/main/qidong.png"),
|
|
|
+ fit: BoxFit.fill,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Scaffold(
|
|
|
+ backgroundColor: Colors.transparent,
|
|
|
+ appBar: const SysAppBar(title: Text("启动"),),
|
|
|
+ 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 {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(controller.isUPdateVerion.value == true){
|
|
|
+ controller.isUPdateVerion.value = false;
|
|
|
+ Future.delayed(Duration.zero, () async {
|
|
|
+ bool? result = await controllers.dialog.showNormalDialog(
|
|
|
+ title: "提示",
|
|
|
+ content: controller.verModes.value.appmsg ?? "有更新",
|
|
|
+ cancelText: "取消",
|
|
|
+ enterText: "确认",
|
|
|
+ );
|
|
|
+ if (result != null && result) {
|
|
|
+ // User pressed "确认"
|
|
|
+ if(controller.verModes.value.appdownload != null){
|
|
|
+ await launchUrl(Uri.parse(controller.verModes.value.appdownload ?? ""));
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if(controller.isUPdateVerion.value){
|
|
|
- controller.isUPdateVerion.value = false;
|
|
|
- Future.delayed(Duration.zero, () async {
|
|
|
- bool? result = await controllers.dialog.showNormalDialog(
|
|
|
- title: "提示",
|
|
|
- content: controller.verModes.value.appmsg ?? "有更新",
|
|
|
- cancelText: "取消",
|
|
|
- enterText: "确认",
|
|
|
- );
|
|
|
- if (result != null && result) {
|
|
|
- // User pressed "确认"
|
|
|
- if(controller.verModes.value.appdownload != null){
|
|
|
- await launchUrl(Uri.parse(controller.verModes.value.appdownload ?? ""));
|
|
|
+ } else {
|
|
|
await controller.fetchSysConfig();
|
|
|
}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return Center(
|
|
|
+ child: Column(
|
|
|
|
|
|
- } else {
|
|
|
- await controller.fetchSysConfig();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- return Center(
|
|
|
- child: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: <Widget>[
|
|
|
- controller.isLoading.value == true ? const CircularProgressIndicator() : Container(), // 菊花加载指示器
|
|
|
- const SizedBox(height: 20), // 用于给加载指示器和文字之间增加一些空间
|
|
|
- Text(
|
|
|
- controller.msgStatus.value,
|
|
|
- style: const TextStyle(
|
|
|
- fontSize: 16,
|
|
|
- fontWeight: FontWeight.w600,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ const SizedBox(height: 500),
|
|
|
+ controller.isLoading.value == true ? const CircularProgressIndicator() : Container(), // 菊花加载指示器
|
|
|
+ const SizedBox(height: 10),// 用于给加载指示器和文字之间增加一些空间
|
|
|
+ Text(
|
|
|
+ controller.msgStatus.value,
|
|
|
+ style: const TextStyle(
|
|
|
+ fontSize: 16,
|
|
|
+ fontWeight: FontWeight.w600,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ), // 当不在加载时,你可能想要显示其他的 Widget
|
|
|
- );
|
|
|
+ ],
|
|
|
+ ), // 当不在加载时,你可能想要显示其他的 Widget
|
|
|
+ );
|
|
|
|
|
|
- }),
|
|
|
+ }),
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
}
|