Compare commits
No commits in common. "dec34e297dc14a129ed5c0ea7058aa7b809a3bfc" and "d2f37ae45d91648f074b6687a0f23b358a259a31" have entirely different histories.
dec34e297d
...
d2f37ae45d
@ -1,4 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="dev.solsynth.solian">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-feature android:name="android.hardware.camera" />
|
<uses-feature android:name="android.hardware.camera" />
|
||||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
|
||||||
|
@ -18,7 +18,7 @@ pluginManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
id "com.android.application" version '8.6.0' apply false
|
id "com.android.application" version '8.4.0' apply false
|
||||||
id "com.google.gms.google-services" version "4.3.15" apply false
|
id "com.google.gms.google-services" version "4.3.15" apply false
|
||||||
id "com.google.firebase.crashlytics" version "2.8.1" apply false
|
id "com.google.firebase.crashlytics" version "2.8.1" apply false
|
||||||
id "org.jetbrains.kotlin.android" version '2.0.0' apply false
|
id "org.jetbrains.kotlin.android" version '2.0.0' apply false
|
||||||
|
@ -68,11 +68,6 @@
|
|||||||
"notificationUnreadCount": "@count unread notifications",
|
"notificationUnreadCount": "@count unread notifications",
|
||||||
"errorHappened": "An error occurred",
|
"errorHappened": "An error occurred",
|
||||||
"errorHappenedUnauthorized": "Unauthorized request, please sign in or try resign in.",
|
"errorHappenedUnauthorized": "Unauthorized request, please sign in or try resign in.",
|
||||||
"errorHappenedRequestBad": "Request error, the server refused to process the request. Please check your request data.",
|
|
||||||
"errorHappenedRequestForbidden": "Request error, insufficient permissions.",
|
|
||||||
"errorHappenedRequestNotFound": "Request error, the requested data does not exist.",
|
|
||||||
"errorHappenedRequestConnection": "Network request failed. Please check the connection status and service status, then try again.",
|
|
||||||
"errorHappenedRequestUnknown": "Request error, unknown type. Please take a full screenshot of this message and submit feedback.",
|
|
||||||
"forgotPassword": "Forgot password",
|
"forgotPassword": "Forgot password",
|
||||||
"email": "Email",
|
"email": "Email",
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
@ -355,7 +350,8 @@
|
|||||||
"bsCheckForUpdate": "Checking For Updates",
|
"bsCheckForUpdate": "Checking For Updates",
|
||||||
"bsCheckForUpdateFailed": "Unable to Check Updates",
|
"bsCheckForUpdateFailed": "Unable to Check Updates",
|
||||||
"bsCheckForUpdateNew": "Found New Version",
|
"bsCheckForUpdateNew": "Found New Version",
|
||||||
"bsCheckForUpdateDesc": "Please head to app store and update your app to latest version to prevent error happens and get latest functions.",
|
"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": "Unable connect to server, check your network connection",
|
"bsCheckingServerFail": "Unable connect to server, check your network connection",
|
||||||
"bsCheckingServerDown": "Server currently unavailable, please retry later",
|
"bsCheckingServerDown": "Server currently unavailable, please retry later",
|
||||||
@ -426,7 +422,5 @@
|
|||||||
"notificationTopicPostFeedback": "Post feedbacks",
|
"notificationTopicPostFeedback": "Post feedbacks",
|
||||||
"notificationTopicPostSubscription": "Post subscriptions",
|
"notificationTopicPostSubscription": "Post subscriptions",
|
||||||
"preferencesApplied": "Preferences has been applied.",
|
"preferencesApplied": "Preferences has been applied.",
|
||||||
"save": "Save",
|
"save": "Save"
|
||||||
"updateAvailable": "Update available",
|
|
||||||
"updateAvailableDesc": "There is an update available (@version). Do you want to download and install it now? You can still use the app normally while waiting for the download to complete."
|
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,8 @@
|
|||||||
"bsCheckForUpdate": "正在检查更新",
|
"bsCheckForUpdate": "正在检查更新",
|
||||||
"bsCheckForUpdateFailed": "无法检查更新",
|
"bsCheckForUpdateFailed": "无法检查更新",
|
||||||
"bsCheckForUpdateNew": "发现新版本",
|
"bsCheckForUpdateNew": "发现新版本",
|
||||||
"bsCheckForUpdateDesc": "请前往应用商店并将您的应用程序更新到最新版本,以防止出现错误并获取最新功能。",
|
"bsCheckForUpdateDescApple": "请前往 TestFlight 并将您的应用程序更新到最新版本,以防止出现错误并获取最新功能。",
|
||||||
|
"bsCheckForUpdateDescCommon": "请前往我们的网站下载并安装最新版本的应用程序,以防止出现错误并获取最新功能。",
|
||||||
"bsCheckingServer": "检查服务器状态中",
|
"bsCheckingServer": "检查服务器状态中",
|
||||||
"bsCheckingServerFail": "无法连接至服务器,请检查你的网络连接状态",
|
"bsCheckingServerFail": "无法连接至服务器,请检查你的网络连接状态",
|
||||||
"bsCheckingServerDown": "当前服务器不可用,请稍后重试",
|
"bsCheckingServerDown": "当前服务器不可用,请稍后重试",
|
||||||
@ -422,7 +423,5 @@
|
|||||||
"notificationTopicPostFeedback": "帖子反馈",
|
"notificationTopicPostFeedback": "帖子反馈",
|
||||||
"notificationTopicPostSubscription": "订阅源",
|
"notificationTopicPostSubscription": "订阅源",
|
||||||
"preferencesApplied": "偏好设置已应用",
|
"preferencesApplied": "偏好设置已应用",
|
||||||
"save": "保存",
|
"save": "保存"
|
||||||
"updateAvailable": "有可用更新",
|
|
||||||
"updateAvailableDesc": "有可用更新 (@version) 你想现在下载安装吗?在等待下载期间你仍可以正常使用。"
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ import 'package:solian/providers/theme_switcher.dart';
|
|||||||
import 'package:solian/providers/websocket.dart';
|
import 'package:solian/providers/websocket.dart';
|
||||||
import 'package:solian/services.dart';
|
import 'package:solian/services.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
import 'package:flutter_app_update/flutter_app_update.dart';
|
|
||||||
|
|
||||||
class BootstrapperShell extends StatefulWidget {
|
class BootstrapperShell extends StatefulWidget {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
@ -50,40 +49,15 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
final info = await PackageInfo.fromPlatform();
|
final info = await PackageInfo.fromPlatform();
|
||||||
final localVersionString = '${info.version}+${info.buildNumber}';
|
final localVersionString = '${info.version}+${info.buildNumber}';
|
||||||
final resp = await GetConnect().get(
|
final resp = await GetConnect().get(
|
||||||
'https://git.solsynth.dev/api/v1/repos/hydrogen/solian/tags?page=1&limit=1',
|
'https://git.solsynth.dev/api/v1/repos/hydrogen/solian/tags?limit=1',
|
||||||
);
|
);
|
||||||
if (resp.body[0]['name'] != localVersionString) {
|
if (resp.body[0]['name'] != localVersionString) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isErrored = true;
|
_isErrored = true;
|
||||||
_subtitle = 'bsCheckForUpdateDesc'.tr;
|
_subtitle = PlatformInfo.isIOS || PlatformInfo.isMacOS
|
||||||
|
? 'bsCheckForUpdateDescApple'.tr
|
||||||
|
: 'bsCheckForUpdateDescCommon'.tr;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (PlatformInfo.isAndroid) {
|
|
||||||
context
|
|
||||||
.showConfirmDialog(
|
|
||||||
'updateAvailable'.tr,
|
|
||||||
'updateAvailableDesc'.trParams({
|
|
||||||
'version': resp.body[0]['name'],
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.then((result) {
|
|
||||||
if (result) {
|
|
||||||
final model = UpdateModel(
|
|
||||||
'https://files.solsynth.dev/d/production01/solian/app-arm64-v8a-release.apk',
|
|
||||||
'solian-app-arm64-v8a-release.apk',
|
|
||||||
'ic_launcher',
|
|
||||||
'https://testflight.apple.com/join/YJ0lmN6O',
|
|
||||||
);
|
|
||||||
AzhonAppUpdate.update(model);
|
|
||||||
if (mounted) {
|
|
||||||
setState(() {
|
|
||||||
_isErrored = false;
|
|
||||||
_subtitle = null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -51,28 +51,6 @@ extension AppExtensions on BuildContext {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> showConfirmDialog(String title, body) async {
|
|
||||||
return await showDialog<bool>(
|
|
||||||
useRootNavigator: true,
|
|
||||||
context: this,
|
|
||||||
builder: (ctx) => AlertDialog(
|
|
||||||
title: Text(title),
|
|
||||||
content: Text(body),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.pop(ctx, false),
|
|
||||||
child: Text('cancel'.tr),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.pop(ctx, true),
|
|
||||||
child: Text('okay'.tr),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
) ??
|
|
||||||
false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> showErrorDialog(dynamic exception) {
|
Future<void> showErrorDialog(dynamic exception) {
|
||||||
Widget content = Text(exception.toString().capitalize!);
|
Widget content = Text(exception.toString().capitalize!);
|
||||||
if (exception is UnauthorizedException) {
|
if (exception is UnauthorizedException) {
|
||||||
|
@ -9,6 +9,7 @@ import 'package:go_router/go_router.dart';
|
|||||||
import 'package:protocol_handler/protocol_handler.dart';
|
import 'package:protocol_handler/protocol_handler.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:solian/background.dart';
|
import 'package:solian/background.dart';
|
||||||
|
import 'package:solian/bootstrapper.dart';
|
||||||
import 'package:solian/firebase_options.dart';
|
import 'package:solian/firebase_options.dart';
|
||||||
import 'package:solian/platform.dart';
|
import 'package:solian/platform.dart';
|
||||||
import 'package:solian/providers/attachment_uploader.dart';
|
import 'package:solian/providers/attachment_uploader.dart';
|
||||||
@ -122,7 +123,9 @@ class SolianApp extends StatelessWidget {
|
|||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return SystemShell(
|
return SystemShell(
|
||||||
child: ScaffoldMessenger(
|
child: ScaffoldMessenger(
|
||||||
child: child ?? const SizedBox.shrink(),
|
child: BootstrapperShell(
|
||||||
|
child: child ?? const SizedBox.shrink(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:solian/bootstrapper.dart';
|
|
||||||
import 'package:solian/models/realm.dart';
|
import 'package:solian/models/realm.dart';
|
||||||
import 'package:solian/screens/about.dart';
|
import 'package:solian/screens/about.dart';
|
||||||
import 'package:solian/screens/account.dart';
|
import 'package:solian/screens/account.dart';
|
||||||
@ -33,12 +32,9 @@ abstract class AppRouter {
|
|||||||
static GoRouter instance = GoRouter(
|
static GoRouter instance = GoRouter(
|
||||||
routes: [
|
routes: [
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
builder: (context, state, child) => BootstrapperShell(
|
builder: (context, state, child) => RootShell(
|
||||||
key: const Key('global-bootstrapper'),
|
state: state,
|
||||||
child: RootShell(
|
child: child,
|
||||||
state: state,
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
@ -233,7 +233,6 @@ class _AttachmentItemVideoState extends State<_AttachmentItemVideo> {
|
|||||||
final ratio = widget.item.metadata?['ratio'] ?? 16 / 9;
|
final ratio = widget.item.metadata?['ratio'] ?? 16 / 9;
|
||||||
if (!_showContent) {
|
if (!_showContent) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
if (widget.item.metadata?['thumbnail'] != null)
|
if (widget.item.metadata?['thumbnail'] != null)
|
||||||
@ -401,7 +400,6 @@ class _AttachmentItemAudioState extends State<_AttachmentItemAudio> {
|
|||||||
const ratio = 16 / 9;
|
const ratio = 16 / 9;
|
||||||
if (!_showContent) {
|
if (!_showContent) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
if (widget.item.metadata?['thumbnail'] != null)
|
if (widget.item.metadata?['thumbnail'] != null)
|
||||||
|
@ -10,7 +10,6 @@ class AutoCacheImage extends StatelessWidget {
|
|||||||
final BoxFit? fit;
|
final BoxFit? fit;
|
||||||
final bool noProgressIndicator;
|
final bool noProgressIndicator;
|
||||||
final bool noErrorWidget;
|
final bool noErrorWidget;
|
||||||
final bool isDense;
|
|
||||||
|
|
||||||
const AutoCacheImage(
|
const AutoCacheImage(
|
||||||
this.url, {
|
this.url, {
|
||||||
@ -20,7 +19,6 @@ class AutoCacheImage extends StatelessWidget {
|
|||||||
this.fit,
|
this.fit,
|
||||||
this.noProgressIndicator = false,
|
this.noProgressIndicator = false,
|
||||||
this.noErrorWidget = false,
|
this.noErrorWidget = false,
|
||||||
this.isDense = false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -48,14 +46,13 @@ class AutoCacheImage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.close, size: isDense ? 24 : 32)
|
const Icon(Icons.close, size: 32)
|
||||||
.animate(onPlay: (e) => e.repeat(reverse: true))
|
.animate(onPlay: (e) => e.repeat(reverse: true))
|
||||||
.fade(duration: 500.ms),
|
.fade(duration: 500.ms),
|
||||||
if (!isDense)
|
Text(
|
||||||
Text(
|
error.toString(),
|
||||||
error.toString(),
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -92,14 +89,13 @@ class AutoCacheImage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.close, size: isDense ? 24 : 32)
|
const Icon(Icons.close, size: 32)
|
||||||
.animate(onPlay: (e) => e.repeat(reverse: true))
|
.animate(onPlay: (e) => e.repeat(reverse: true))
|
||||||
.fade(duration: 500.ms),
|
.fade(duration: 500.ms),
|
||||||
if (!isDense)
|
Text(
|
||||||
Text(
|
error.toString(),
|
||||||
error.toString(),
|
textAlign: TextAlign.center,
|
||||||
textAlign: TextAlign.center,
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -415,7 +415,6 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
|
|||||||
x.imageUrl,
|
x.imageUrl,
|
||||||
width: 28,
|
width: 28,
|
||||||
height: 28,
|
height: 28,
|
||||||
isDense: true,
|
|
||||||
),
|
),
|
||||||
display: x.name,
|
display: x.name,
|
||||||
content: x.textWarpedPlaceholder,
|
content: x.textWarpedPlaceholder,
|
||||||
|
@ -635,14 +635,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.0"
|
version: "4.5.0"
|
||||||
flutter_app_update:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_app_update
|
|
||||||
sha256: "2b83278d5cc807f543e623d5b466216316104335a4918d9cc4556f39985fe84a"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "3.1.0"
|
|
||||||
flutter_background_service:
|
flutter_background_service:
|
||||||
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.1+41
|
version: 1.2.1+40
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.4 <4.0.0"
|
sdk: ">=3.3.4 <4.0.0"
|
||||||
@ -80,7 +80,6 @@ dependencies:
|
|||||||
path_provider: ^2.1.4
|
path_provider: ^2.1.4
|
||||||
flutter_background_service: ^5.0.10
|
flutter_background_service: ^5.0.10
|
||||||
flutter_local_notifications: ^17.2.2
|
flutter_local_notifications: ^17.2.2
|
||||||
flutter_app_update: ^3.1.0
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user