Compare commits
3 Commits
4616f3a3e2
...
1.2.0+9
| Author | SHA1 | Date | |
|---|---|---|---|
| 989b5babd9 | |||
| 9ea364640d | |||
| a9f55a489d |
@@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/platform.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/content/channel.dart';
|
import 'package:solian/providers/content/channel.dart';
|
||||||
import 'package:solian/providers/content/realm.dart';
|
import 'package:solian/providers/content/realm.dart';
|
||||||
@@ -24,6 +26,7 @@ class BootstrapperShell extends StatefulWidget {
|
|||||||
class _BootstrapperShellState extends State<BootstrapperShell> {
|
class _BootstrapperShellState extends State<BootstrapperShell> {
|
||||||
bool _isBusy = true;
|
bool _isBusy = true;
|
||||||
bool _isErrored = false;
|
bool _isErrored = false;
|
||||||
|
bool _isDismissable = true;
|
||||||
String? _subtitle;
|
String? _subtitle;
|
||||||
|
|
||||||
Color get _unFocusColor =>
|
Color get _unFocusColor =>
|
||||||
@@ -38,6 +41,32 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
await context.read<ThemeSwitcher>().restoreTheme();
|
await context.read<ThemeSwitcher>().restoreTheme();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
label: 'bsCheckForUpdate',
|
||||||
|
action: () async {
|
||||||
|
if (PlatformInfo.isWeb) return;
|
||||||
|
try {
|
||||||
|
final info = await PackageInfo.fromPlatform();
|
||||||
|
final localVersionString = '${info.version}+${info.buildNumber}';
|
||||||
|
final resp = await GetConnect().get(
|
||||||
|
'https://git.solsynth.dev/api/v1/repos/hydrogen/solian/tags?limit=1',
|
||||||
|
);
|
||||||
|
if (resp.body[0]['name'] != localVersionString) {
|
||||||
|
setState(() {
|
||||||
|
_isErrored = true;
|
||||||
|
_subtitle = PlatformInfo.isIOS || PlatformInfo.isMacOS
|
||||||
|
? 'bsCheckForUpdateDescApple'.tr
|
||||||
|
: 'bsCheckForUpdateDescCommon'.tr;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setState(() {
|
||||||
|
_isErrored = true;
|
||||||
|
_subtitle = 'bsCheckForUpdateFailed'.tr;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
(
|
(
|
||||||
label: 'bsCheckingServer',
|
label: 'bsCheckingServer',
|
||||||
action: () async {
|
action: () async {
|
||||||
@@ -47,12 +76,14 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isErrored = true;
|
_isErrored = true;
|
||||||
_subtitle = 'bsCheckingServerDown'.tr;
|
_subtitle = 'bsCheckingServerDown'.tr;
|
||||||
|
_isDismissable = false;
|
||||||
});
|
});
|
||||||
throw Exception('unable connect to server');
|
throw Exception('unable connect to server');
|
||||||
} else if (resp.statusCode == null) {
|
} else if (resp.statusCode == null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isErrored = true;
|
_isErrored = true;
|
||||||
_subtitle = 'bsCheckingServerFail'.tr;
|
_subtitle = 'bsCheckingServerFail'.tr;
|
||||||
|
_isDismissable = false;
|
||||||
});
|
});
|
||||||
throw Exception('unable connect to server');
|
throw Exception('unable connect to server');
|
||||||
}
|
}
|
||||||
@@ -148,9 +179,11 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
if (_isErrored)
|
if (_isErrored && !_isDismissable)
|
||||||
const Icon(Icons.cancel, size: 24)
|
const Icon(Icons.cancel, size: 24),
|
||||||
else
|
if (_isErrored && _isDismissable)
|
||||||
|
const Icon(Icons.warning, size: 24),
|
||||||
|
if (!_isErrored && _isBusy)
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
@@ -161,15 +194,24 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
maxWidth: 280,
|
maxWidth: 280,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
if (_subtitle == null)
|
||||||
_subtitle ??
|
Text(
|
||||||
'${_periods[_periodCursor].label.tr} (${_periodCursor + 1}/${_periods.length})',
|
'${_periods[_periodCursor].label.tr} (${_periodCursor + 1}/${_periods.length})',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: _unFocusColor,
|
color: _unFocusColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
if (_subtitle != null)
|
||||||
|
Text(
|
||||||
|
_subtitle!,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _unFocusColor,
|
||||||
|
),
|
||||||
|
).paddingOnly(bottom: 4),
|
||||||
Text(
|
Text(
|
||||||
'2024 © Solsynth LLC',
|
'2024 © Solsynth LLC',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@@ -185,12 +227,19 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (_isBusy) return;
|
if (_isBusy) return;
|
||||||
setState(() {
|
if (_isDismissable) {
|
||||||
_isBusy = true;
|
setState(() {
|
||||||
_isErrored = false;
|
_isBusy = false;
|
||||||
_periodCursor = 0;
|
_isErrored = false;
|
||||||
});
|
});
|
||||||
_runPeriods();
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_isBusy = true;
|
||||||
|
_isErrored = false;
|
||||||
|
_periodCursor = 0;
|
||||||
|
});
|
||||||
|
_runPeriods();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -30,6 +30,23 @@ extension SolianExtenions on BuildContext {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> showInfoDialog(String title, body) {
|
||||||
|
return showDialog<void>(
|
||||||
|
useRootNavigator: true,
|
||||||
|
context: this,
|
||||||
|
builder: (ctx) => AlertDialog(
|
||||||
|
title: Text(title),
|
||||||
|
content: Text(body),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(ctx),
|
||||||
|
child: Text('okay'.tr),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> showErrorDialog(dynamic exception) {
|
Future<void> showErrorDialog(dynamic exception) {
|
||||||
var stack = StackTrace.current;
|
var stack = StackTrace.current;
|
||||||
var stackTrace = '$stack';
|
var stackTrace = '$stack';
|
||||||
|
|||||||
@@ -314,6 +314,11 @@ const i18nEnglish = {
|
|||||||
'accountStatusNeutral': 'Neutral',
|
'accountStatusNeutral': 'Neutral',
|
||||||
'accountStatusPositive': 'Positive',
|
'accountStatusPositive': 'Positive',
|
||||||
'bsLoadingTheme': 'Loading Theme',
|
'bsLoadingTheme': 'Loading Theme',
|
||||||
|
'bsCheckForUpdate': 'Checking For Updates',
|
||||||
|
'bsCheckForUpdateFailed': 'Unable to Check Updates',
|
||||||
|
'bsCheckForUpdateNew': 'Found New Version',
|
||||||
|
'bsCheckForUpdateDescApple': 'Please head to TestFlight and update your app to latest version to prevent error happens and get latest functions.',
|
||||||
|
'bsCheckForUpdateDescCommon': 'Please head to our website download and install latest version of application to prevent error happens and get latest functions.',
|
||||||
'bsCheckingServer': 'Checking Server Status',
|
'bsCheckingServer': 'Checking Server Status',
|
||||||
'bsCheckingServerFail':
|
'bsCheckingServerFail':
|
||||||
'Unable connect to server, check your network connection',
|
'Unable connect to server, check your network connection',
|
||||||
|
|||||||
@@ -293,6 +293,11 @@ const i18nSimplifiedChinese = {
|
|||||||
'accountStatusNeutral': '中性',
|
'accountStatusNeutral': '中性',
|
||||||
'accountStatusPositive': '积极',
|
'accountStatusPositive': '积极',
|
||||||
'bsLoadingTheme': '正在装载主题',
|
'bsLoadingTheme': '正在装载主题',
|
||||||
|
'bsCheckForUpdate': '正在检查更新',
|
||||||
|
'bsCheckForUpdateFailed': '无法检查更新',
|
||||||
|
'bsCheckForUpdateNew': '发现新版本',
|
||||||
|
'bsCheckForUpdateDescApple': '请前往 TestFlight 并将您的应用程序更新到最新版本,以防止出现错误并获取最新功能。',
|
||||||
|
'bsCheckForUpdateDescCommon': '请前往我们的网站下载并安装最新版本的应用程序,以防止出现错误并获取最新功能。',
|
||||||
'bsCheckingServer': '检查服务器状态中',
|
'bsCheckingServer': '检查服务器状态中',
|
||||||
'bsCheckingServerFail': '无法连接至服务器,请检查你的网络连接状态',
|
'bsCheckingServerFail': '无法连接至服务器,请检查你的网络连接状态',
|
||||||
'bsCheckingServerDown': '当前服务器不可用,请稍后重试',
|
'bsCheckingServerDown': '当前服务器不可用,请稍后重试',
|
||||||
|
|||||||
22
pubspec.lock
22
pubspec.lock
@@ -317,10 +317,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dev_build
|
name: dev_build
|
||||||
sha256: "76dd5b2587a891ab9c1e7f7eea6ca4a3504667321e0186ecb1e385183889d89b"
|
sha256: f526d1fbe68875f6119ffc333f114dfe6aa93ad04439276d53968f7977cc410e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0+10"
|
version: "1.0.0+11"
|
||||||
device_info_plus:
|
device_info_plus:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -369,14 +369,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.9"
|
version: "2.3.9"
|
||||||
easy_debounce:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: easy_debounce
|
|
||||||
sha256: f082609cfb8f37defb9e37fc28bc978c6712dedf08d4c5a26f820fa10165a236
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.3"
|
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -769,7 +761,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.2"
|
||||||
image:
|
image:
|
||||||
dependency: "direct main"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
|
sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
|
||||||
@@ -1701,14 +1693,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.0"
|
version: "0.7.0"
|
||||||
textfield_tags:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: textfield_tags
|
|
||||||
sha256: d1f2204114157a1296bb97c20d7f8c8c7fd036212812afb2e19de7bb34acc55b
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.1"
|
|
||||||
timeago:
|
timeago:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: solian
|
|||||||
description: "The Solar Network App"
|
description: "The Solar Network App"
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 1.2.0+7
|
version: 1.2.0+9
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.4 <4.0.0"
|
sdk: ">=3.3.4 <4.0.0"
|
||||||
@@ -27,7 +27,6 @@ dependencies:
|
|||||||
crypto: ^3.0.3
|
crypto: ^3.0.3
|
||||||
path: ^1.9.0
|
path: ^1.9.0
|
||||||
intl: ^0.19.0
|
intl: ^0.19.0
|
||||||
image: ^4.1.7
|
|
||||||
font_awesome_flutter: ^10.7.0
|
font_awesome_flutter: ^10.7.0
|
||||||
web_socket_channel: ^3.0.0
|
web_socket_channel: ^3.0.0
|
||||||
permission_handler: ^11.3.1
|
permission_handler: ^11.3.1
|
||||||
@@ -50,7 +49,6 @@ dependencies:
|
|||||||
media_kit: ^1.1.10+1
|
media_kit: ^1.1.10+1
|
||||||
media_kit_video: ^1.2.4
|
media_kit_video: ^1.2.4
|
||||||
media_kit_libs_video: ^1.0.4
|
media_kit_libs_video: ^1.0.4
|
||||||
textfield_tags: ^3.0.1
|
|
||||||
pasteboard: ^0.2.0
|
pasteboard: ^0.2.0
|
||||||
desktop_drop: ^0.4.4
|
desktop_drop: ^0.4.4
|
||||||
badges: ^3.1.2
|
badges: ^3.1.2
|
||||||
@@ -60,7 +58,6 @@ dependencies:
|
|||||||
flutter_cache_manager: ^3.3.3
|
flutter_cache_manager: ^3.3.3
|
||||||
flutter_markdown_selectionarea: ^0.6.17+1
|
flutter_markdown_selectionarea: ^0.6.17+1
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
easy_debounce: ^2.0.3
|
|
||||||
provider: ^6.1.2
|
provider: ^6.1.2
|
||||||
gal: ^2.3.0
|
gal: ^2.3.0
|
||||||
dio: ^5.5.0+1
|
dio: ^5.5.0+1
|
||||||
|
|||||||
Reference in New Issue
Block a user