Compare commits
No commits in common. "74b6ccd5c7ff2ca5468d4dbcf9ed4f95ff013d6b" and "102df2ef1cd76cebd06b4954ec49b074f0eff25f" have entirely different histories.
74b6ccd5c7
...
102df2ef1c
@ -33,18 +33,11 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
action: () async {
|
action: () async {
|
||||||
final client = ServiceFinder.configureClient('dealer');
|
final client = ServiceFinder.configureClient('dealer');
|
||||||
final resp = await client.get('/.well-known');
|
final resp = await client.get('/.well-known');
|
||||||
if (resp.statusCode != null && resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
setState(() {
|
|
||||||
_isErrored = true;
|
|
||||||
_subtitle = 'bsCheckingServerDown'.tr;
|
|
||||||
});
|
|
||||||
throw Exception('unable connect to server');
|
|
||||||
} else if (resp.statusCode == null) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_isErrored = true;
|
_isErrored = true;
|
||||||
_subtitle = 'bsCheckingServerFail'.tr;
|
_subtitle = 'bsCheckingServerFail'.tr;
|
||||||
});
|
});
|
||||||
throw Exception('unable connect to server');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -97,16 +90,12 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
];
|
];
|
||||||
|
|
||||||
Future<void> _runPeriods() async {
|
Future<void> _runPeriods() async {
|
||||||
try {
|
|
||||||
for (var idx = 0; idx < _periods.length; idx++) {
|
for (var idx = 0; idx < _periods.length; idx++) {
|
||||||
await _periods[idx].action();
|
await _periods[idx].action();
|
||||||
if (_isErrored) break;
|
|
||||||
setState(() => _periodCursor++);
|
setState(() => _periodCursor++);
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -130,8 +119,7 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
child: Image.asset('assets/logo.png', width: 80, height: 80),
|
child: Image.asset('assets/logo.png', width: 80, height: 80),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GestureDetector(
|
Column(
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
if (_isErrored)
|
if (_isErrored)
|
||||||
const Icon(Icons.cancel, size: 24)
|
const Icon(Icons.cancel, size: 24)
|
||||||
@ -144,9 +132,7 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
CenteredContainer(
|
CenteredContainer(
|
||||||
maxWidth: 280,
|
maxWidth: 280,
|
||||||
child: Column(
|
child: Text(
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
_subtitle ??
|
_subtitle ??
|
||||||
'${_periods[_periodCursor].label.tr} (${_periodCursor + 1}/${_periods.length})',
|
'${_periods[_periodCursor].label.tr} (${_periodCursor + 1}/${_periods.length})',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@ -155,28 +141,8 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
color: _unFocusColor,
|
color: _unFocusColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
|
||||||
'2024 © Solsynth LLC',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
color: _unFocusColor,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
if (_isBusy) return;
|
|
||||||
setState(() {
|
|
||||||
_isBusy = true;
|
|
||||||
_isErrored = false;
|
|
||||||
_periodCursor = 0;
|
|
||||||
});
|
|
||||||
_runPeriods();
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -278,8 +278,7 @@ const messagesEnglish = {
|
|||||||
'accountStatusNeutral': 'Neutral',
|
'accountStatusNeutral': 'Neutral',
|
||||||
'accountStatusPositive': 'Positive',
|
'accountStatusPositive': 'Positive',
|
||||||
'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 or follow our service maintenance status',
|
||||||
'bsCheckingServerDown': 'Server currently unavailable, please retry later',
|
|
||||||
'bsAuthorizing': 'Authorizing',
|
'bsAuthorizing': 'Authorizing',
|
||||||
'bsEstablishingConn': 'Establishing Connection',
|
'bsEstablishingConn': 'Establishing Connection',
|
||||||
'bsPreparingData': 'Preparing User Data',
|
'bsPreparingData': 'Preparing User Data',
|
||||||
|
@ -257,8 +257,7 @@ const simplifiedChineseMessages = {
|
|||||||
'accountStatusNeutral': '中性',
|
'accountStatusNeutral': '中性',
|
||||||
'accountStatusPositive': '积极',
|
'accountStatusPositive': '积极',
|
||||||
'bsCheckingServer': '检查服务器状态中',
|
'bsCheckingServer': '检查服务器状态中',
|
||||||
'bsCheckingServerFail': '无法连接至服务器,请检查你的网络连接状态',
|
'bsCheckingServerFail': '无法连接至服务器,请检查你的网络状态或我们服务维护状态',
|
||||||
'bsCheckingServerDown': '当前服务器不可用,请稍后重试',
|
|
||||||
'bsAuthorizing': '正在授权中',
|
'bsAuthorizing': '正在授权中',
|
||||||
'bsEstablishingConn': '部署连接中',
|
'bsEstablishingConn': '部署连接中',
|
||||||
'bsPreparingData': '正在准备用户资料',
|
'bsPreparingData': '正在准备用户资料',
|
||||||
|
@ -82,7 +82,6 @@ class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
|
|||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: IgnorePointer(
|
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 300,
|
height: 300,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
@ -93,7 +92,6 @@ class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.animate(target: _showDetails ? 1 : 0)
|
.animate(target: _showDetails ? 1 : 0)
|
||||||
.fadeIn(curve: Curves.fastEaseInToSlowEaseOut),
|
.fadeIn(curve: Curves.fastEaseInToSlowEaseOut),
|
||||||
@ -101,7 +99,6 @@ class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
|
|||||||
bottom: MediaQuery.of(context).padding.bottom,
|
bottom: MediaQuery.of(context).padding.bottom,
|
||||||
left: 16,
|
left: 16,
|
||||||
right: 16,
|
right: 16,
|
||||||
child: IgnorePointer(
|
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -173,7 +170,6 @@ class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.animate(target: _showDetails ? 1 : 0)
|
.animate(target: _showDetails ? 1 : 0)
|
||||||
.fadeIn(curve: Curves.fastEaseInToSlowEaseOut),
|
.fadeIn(curve: Curves.fastEaseInToSlowEaseOut),
|
||||||
|
@ -25,7 +25,7 @@ class _PostActionState extends State<PostAction> {
|
|||||||
bool _isBusy = true;
|
bool _isBusy = true;
|
||||||
bool _canModifyContent = false;
|
bool _canModifyContent = false;
|
||||||
|
|
||||||
void _checkAbleToModifyContent() async {
|
void checkAbleToModifyContent() async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) return;
|
if (auth.isAuthorized.isFalse) return;
|
||||||
|
|
||||||
@ -38,25 +38,10 @@ class _PostActionState extends State<PostAction> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _doShare() async {
|
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
|
||||||
await Share.share(
|
|
||||||
'postShareContent'.trParams({
|
|
||||||
'username': widget.item.author.nick,
|
|
||||||
'content': widget.item.body['content'] ?? 'no content',
|
|
||||||
'link': 'https://sn.solsynth.dev/posts/${widget.item.id}',
|
|
||||||
}),
|
|
||||||
subject: 'postShareSubject'.trParams({
|
|
||||||
'username': widget.item.author.nick,
|
|
||||||
}),
|
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_checkAbleToModifyContent();
|
checkAbleToModifyContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -87,7 +72,17 @@ class _PostActionState extends State<PostAction> {
|
|||||||
leading: const Icon(Icons.share),
|
leading: const Icon(Icons.share),
|
||||||
title: Text('share'.tr),
|
title: Text('share'.tr),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await _doShare();
|
await Share.share(
|
||||||
|
'postShareContent'.trParams({
|
||||||
|
'username': widget.item.author.nick,
|
||||||
|
'content': widget.item.body['text'],
|
||||||
|
'link':
|
||||||
|
'https://sn.solsynth.dev/posts/${widget.item.id}',
|
||||||
|
}),
|
||||||
|
subject: 'postShareSubject'.trParams({
|
||||||
|
'username': widget.item.author.nick,
|
||||||
|
}),
|
||||||
|
);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -192,7 +187,7 @@ class PostDeletionDialog extends StatefulWidget {
|
|||||||
class _PostDeletionDialogState extends State<PostDeletionDialog> {
|
class _PostDeletionDialogState extends State<PostDeletionDialog> {
|
||||||
bool _isBusy = false;
|
bool _isBusy = false;
|
||||||
|
|
||||||
void _performAction() async {
|
void performAction() async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) return;
|
if (auth.isAuthorized.isFalse) return;
|
||||||
|
|
||||||
@ -224,7 +219,7 @@ class _PostDeletionDialogState extends State<PostDeletionDialog> {
|
|||||||
child: Text('cancel'.tr),
|
child: Text('cancel'.tr),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: _isBusy ? null : () => _performAction(),
|
onPressed: _isBusy ? null : () => performAction(),
|
||||||
child: Text('confirm'.tr),
|
child: Text('confirm'.tr),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -2,7 +2,7 @@ name: solian
|
|||||||
description: "The Solar Network App"
|
description: "The Solar Network App"
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 1.1.0+48
|
version: 1.1.0+47
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.4 <4.0.0"
|
sdk: ">=3.3.4 <4.0.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user