Compare commits

..

No commits in common. "9ac4a940dde966100081c925aad3ba65d53e8679" and "a319bd7f8c23bffab987bb04928191d85be759e0" have entirely different histories.

17 changed files with 88 additions and 99 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="ic_launcher_background">#FFFFFFFF</color> <color name="ic_launcher_background">#FFFFFFFF</color>
<color name="ic_notification_background">#00000000</color>
</resources> </resources>

View File

@ -139,8 +139,6 @@
"fieldPostTitle": "Title", "fieldPostTitle": "Title",
"fieldPostDescription": "Description", "fieldPostDescription": "Description",
"fieldPostTags": "Tags", "fieldPostTags": "Tags",
"fieldPostAlias": "Alias",
"fieldPostAliasHint": "Optional, used to represent the post in URL, should follow URL-Safe.",
"postPublish": "Publish", "postPublish": "Publish",
"postPosted": "Post has been posted.", "postPosted": "Post has been posted.",
"postPublishedAt": "Published At", "postPublishedAt": "Published At",

View File

@ -123,8 +123,6 @@
"fieldPostTitle": "标题", "fieldPostTitle": "标题",
"fieldPostDescription": "描述", "fieldPostDescription": "描述",
"fieldPostTags": "标签", "fieldPostTags": "标签",
"fieldPostAlias": "别名",
"fieldPostAliasHint": "可选项,用于在 URL 中表示该帖子,应遵循 URL-Safe 的原则。",
"postPublish": "发布", "postPublish": "发布",
"postPublishedAt": "发布于", "postPublishedAt": "发布于",
"postPublishedUntil": "取消发布于", "postPublishedUntil": "取消发布于",

View File

@ -1,5 +1,4 @@
import 'dart:io'; import 'dart:io';
import 'dart:math' as math;
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -153,7 +152,6 @@ class PostWriteController extends ChangeNotifier {
final TextEditingController contentController = TextEditingController(); final TextEditingController contentController = TextEditingController();
final TextEditingController titleController = TextEditingController(); final TextEditingController titleController = TextEditingController();
final TextEditingController descriptionController = TextEditingController(); final TextEditingController descriptionController = TextEditingController();
final TextEditingController aliasController = TextEditingController();
PostWriteController() { PostWriteController() {
titleController.addListener(() => notifyListeners()); titleController.addListener(() => notifyListeners());
@ -200,7 +198,6 @@ class PostWriteController extends ChangeNotifier {
titleController.text = post.body['title'] ?? ''; titleController.text = post.body['title'] ?? '';
descriptionController.text = post.body['description'] ?? ''; descriptionController.text = post.body['description'] ?? '';
contentController.text = post.body['content'] ?? ''; contentController.text = post.body['content'] ?? '';
aliasController.text = post.alias ?? '';
publishedAt = post.publishedAt; publishedAt = post.publishedAt;
publishedUntil = post.publishedUntil; publishedUntil = post.publishedUntil;
visibleUsers = List.from(post.visibleUsersList ?? []); visibleUsers = List.from(post.visibleUsersList ?? []);
@ -272,7 +269,7 @@ class PostWriteController extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<void> sendPost(BuildContext context) async { Future<void> post(BuildContext context) async {
if (isBusy || publisher == null) return; if (isBusy || publisher == null) return;
final sn = context.read<SnNetworkProvider>(); final sn = context.read<SnNetworkProvider>();
@ -308,14 +305,12 @@ class PostWriteController extends ChangeNotifier {
place.$2, place.$2,
onProgress: (progress) { onProgress: (progress) {
// Calculate overall progress for attachments // Calculate overall progress for attachments
progress = math.max(((i + progress) / attachments.length) * kAttachmentProgressWeight, progress); progress = ((i + progress) / attachments.length) * kAttachmentProgressWeight;
notifyListeners(); notifyListeners();
}, },
); );
progress = (i + 1) / attachments.length * kAttachmentProgressWeight;
attachments[i] = PostWriteMedia(item); attachments[i] = PostWriteMedia(item);
notifyListeners();
} }
} catch (err) { } catch (err) {
isBusy = false; isBusy = false;
@ -339,7 +334,6 @@ class PostWriteController extends ChangeNotifier {
data: { data: {
'publisher': publisher!.id, 'publisher': publisher!.id,
'content': contentController.text, 'content': contentController.text,
if (aliasController.text.isNotEmpty) 'alias': aliasController.text,
if (titleController.text.isNotEmpty) 'title': titleController.text, if (titleController.text.isNotEmpty) 'title': titleController.text,
if (descriptionController.text.isNotEmpty) 'description': descriptionController.text, if (descriptionController.text.isNotEmpty) 'description': descriptionController.text,
if (thumbnail != null && thumbnail!.attachment != null) 'thumbnail': thumbnail!.attachment!.rid, if (thumbnail != null && thumbnail!.attachment != null) 'thumbnail': thumbnail!.attachment!.rid,

View File

@ -41,7 +41,8 @@ class SnAttachmentProvider {
return out; return out;
} }
Future<List<SnAttachment?>> getMultiple(List<String> rids, {noCache = false}) async { Future<List<SnAttachment?>> getMultiple(List<String> rids,
{noCache = false}) async {
final result = List<SnAttachment?>.filled(rids.length, null); final result = List<SnAttachment?>.filled(rids.length, null);
final Map<String, int> randomMapping = {}; final Map<String, int> randomMapping = {};
for (int i = 0; i < rids.length; i++) { for (int i = 0; i < rids.length; i++) {
@ -62,7 +63,9 @@ class SnAttachmentProvider {
'id': pendingFetch.join(','), 'id': pendingFetch.join(','),
}, },
); );
final out = resp.data['data'].map((e) => e['id'] == 0 ? null : SnAttachment.fromJson(e)).toList(); final out = resp.data['data']
.map((e) => e['id'] == 0 ? null : SnAttachment.fromJson(e))
.toList();
for (final item in out) { for (final item in out) {
if (item == null) continue; if (item == null) continue;
@ -76,7 +79,10 @@ class SnAttachmentProvider {
return result; return result;
} }
static Map<String, String> mimetypeOverrides = {'mov': 'video/quicktime', 'mp4': 'video/mp4'}; static Map<String, String> mimetypeOverrides = {
'mov': 'video/quicktime',
'mp4': 'video/mp4'
};
Future<SnAttachment> directUploadOne( Future<SnAttachment> directUploadOne(
Uint8List data, Uint8List data,
@ -87,8 +93,11 @@ class SnAttachmentProvider {
Function(double progress)? onProgress, Function(double progress)? onProgress,
}) async { }) async {
final filePayload = MultipartFile.fromBytes(data, filename: filename); final filePayload = MultipartFile.fromBytes(data, filename: filename);
final fileAlt = filename.contains('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename; final fileAlt = filename.contains('.')
final fileExt = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(); ? filename.substring(0, filename.lastIndexOf('.'))
: filename;
final fileExt =
filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
String? mimetypeOverride; String? mimetypeOverride;
if (mimetype != null) { if (mimetype != null) {
@ -124,8 +133,11 @@ class SnAttachmentProvider {
Map<String, dynamic>? metadata, { Map<String, dynamic>? metadata, {
String? mimetype, String? mimetype,
}) async { }) async {
final fileAlt = filename.contains('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename; final fileAlt = filename.contains('.')
final fileExt = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase(); ? filename.substring(0, filename.lastIndexOf('.'))
: filename;
final fileExt =
filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
String? mimetypeOverride; String? mimetypeOverride;
if (mimetype == null && mimetypeOverrides.keys.contains(fileExt)) { if (mimetype == null && mimetypeOverrides.keys.contains(fileExt)) {
@ -143,7 +155,10 @@ class SnAttachmentProvider {
if (mimetypeOverride != null) 'mimetype': mimetypeOverride, if (mimetypeOverride != null) 'mimetype': mimetypeOverride,
}); });
return (SnAttachment.fromJson(resp.data['meta']), resp.data['chunk_size'] as int); return (
SnAttachment.fromJson(resp.data['meta']),
resp.data['chunk_size'] as int
);
} }
Future<SnAttachment> _chunkedUploadOnePart( Future<SnAttachment> _chunkedUploadOnePart(
@ -185,17 +200,24 @@ class SnAttachmentProvider {
(entry.value + 1) * chunkSize, (entry.value + 1) * chunkSize,
await file.length(), await file.length(),
); );
final data = Uint8List.fromList(await file.openRead(beginCursor, endCursor).expand((chunk) => chunk).toList()); final data = Uint8List.fromList(await file
.openRead(beginCursor, endCursor)
.expand((chunk) => chunk)
.toList());
place = await _chunkedUploadOnePart( place = await _chunkedUploadOnePart(
data, data,
place.rid, place.rid,
entry.key, entry.key,
onProgress: (chunkProgress) {
final overallProgress =
(currentTask + chunkProgress) / chunks.length;
if (onProgress != null) {
onProgress(overallProgress);
}
},
); );
final overallProgress = currentTask / chunks.length;
onProgress?.call(overallProgress);
currentTask++; currentTask++;
}()); }());
} }

View File

@ -133,7 +133,7 @@ class _HomeDashUpdateWidget extends StatelessWidget {
final model = UpdateModel( final model = UpdateModel(
'https://files.solsynth.dev/d/production01/solian/app-arm64-v8a-release.apk', 'https://files.solsynth.dev/d/production01/solian/app-arm64-v8a-release.apk',
'solian-app-release-${config.updatableVersion!}.apk', 'solian-app-release-${config.updatableVersion!}.apk',
'ic_launcher', 'ic_notification',
'https://apps.apple.com/us/app/solian/id6499032345', 'https://apps.apple.com/us/app/solian/id6499032345',
); );
AzhonAppUpdate.update(model); AzhonAppUpdate.update(model);

View File

@ -13,7 +13,6 @@ import 'package:material_symbols_icons/symbols.dart';
import 'package:pasteboard/pasteboard.dart'; import 'package:pasteboard/pasteboard.dart';
import 'package:styled_widget/styled_widget.dart'; import 'package:styled_widget/styled_widget.dart';
import 'package:surface/controllers/post_write_controller.dart'; import 'package:surface/controllers/post_write_controller.dart';
import 'package:surface/providers/config.dart';
import 'package:surface/providers/sn_network.dart'; import 'package:surface/providers/sn_network.dart';
import 'package:surface/types/post.dart'; import 'package:surface/types/post.dart';
import 'package:surface/widgets/account/account_image.dart'; import 'package:surface/widgets/account/account_image.dart';
@ -72,14 +71,11 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
try { try {
final sn = context.read<SnNetworkProvider>(); final sn = context.read<SnNetworkProvider>();
final config = context.read<ConfigProvider>();
final resp = await sn.client.get('/cgi/co/publishers/me'); final resp = await sn.client.get('/cgi/co/publishers/me');
_publishers = List<SnPublisher>.from( _publishers = List<SnPublisher>.from(
resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [], resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [],
); );
final beforeId = config.prefs.getInt('int_last_publisher_id'); _writeController.setPublisher(_publishers?.firstOrNull);
_writeController
.setPublisher(_publishers?.where((ele) => ele.id == beforeId).firstOrNull ?? _publishers?.firstOrNull);
} catch (err) { } catch (err) {
if (!mounted) return; if (!mounted) return;
context.showErrorDialog(err); context.showErrorDialog(err);
@ -269,8 +265,6 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
}); });
} else { } else {
_writeController.setPublisher(value); _writeController.setPublisher(value);
final config = context.read<ConfigProvider>();
config.prefs.setInt('int_last_publisher_id', value.id);
} }
}, },
buttonStyleData: const ButtonStyleData( buttonStyleData: const ButtonStyleData(
@ -502,7 +496,7 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
onPressed: (_writeController.isBusy || _writeController.publisher == null) onPressed: (_writeController.isBusy || _writeController.publisher == null)
? null ? null
: () { : () {
_writeController.sendPost(context).then((_) { _writeController.post(context).then((_) {
if (!context.mounted) return; if (!context.mounted) return;
Navigator.pop(context, true); Navigator.pop(context, true);
}); });

View File

@ -17,8 +17,6 @@ import 'package:responsive_framework/responsive_framework.dart';
import 'package:screenshot/screenshot.dart'; import 'package:screenshot/screenshot.dart';
import 'package:share_plus/share_plus.dart'; import 'package:share_plus/share_plus.dart';
import 'package:styled_widget/styled_widget.dart'; import 'package:styled_widget/styled_widget.dart';
import 'package:surface/providers/config.dart';
import 'package:surface/providers/link_preview.dart';
import 'package:surface/providers/sn_network.dart'; import 'package:surface/providers/sn_network.dart';
import 'package:surface/providers/userinfo.dart'; import 'package:surface/providers/userinfo.dart';
import 'package:surface/types/post.dart'; import 'package:surface/types/post.dart';
@ -85,8 +83,6 @@ class PostItem extends StatelessWidget {
child: MultiProvider( child: MultiProvider(
providers: [ providers: [
Provider<SnNetworkProvider>(create: (_) => context.read()), Provider<SnNetworkProvider>(create: (_) => context.read()),
Provider<SnLinkPreviewProvider>(create: (_) => context.read()),
ChangeNotifierProvider<ConfigProvider>(create: (_) => context.read()),
], ],
child: ResponsiveBreakpoints.builder( child: ResponsiveBreakpoints.builder(
breakpoints: ResponsiveBreakpoints.of(context).breakpoints, breakpoints: ResponsiveBreakpoints.of(context).breakpoints,
@ -414,7 +410,7 @@ class PostShareImageWidget extends StatelessWidget {
size: Size(28, 28), size: Size(28, 28),
), ),
eyeStyle: QrEyeStyle( eyeStyle: QrEyeStyle(
eyeShape: QrEyeShape.circle, eyeShape: QrEyeShape.square,
color: Theme.of(context).colorScheme.onSurface, color: Theme.of(context).colorScheme.onSurface,
), ),
dataModuleStyle: QrDataModuleStyle( dataModuleStyle: QrDataModuleStyle(

View File

@ -189,19 +189,16 @@ class PostMediaPendingList extends StatelessWidget {
child: AspectRatio( child: AspectRatio(
aspectRatio: 1, aspectRatio: 1,
child: switch (thumbnail!.type) { child: switch (thumbnail!.type) {
PostWriteMediaType.image => Container( PostWriteMediaType.image => LayoutBuilder(builder: (context, constraints) {
color: Theme.of(context).colorScheme.surfaceContainer, return Image(
child: LayoutBuilder(builder: (context, constraints) { image: thumbnail!.getImageProvider(
return Image( context,
image: thumbnail!.getImageProvider( width: (constraints.maxWidth * devicePixelRatio).round(),
context, height: (constraints.maxHeight * devicePixelRatio).round(),
width: (constraints.maxWidth * devicePixelRatio).round(), )!,
height: (constraints.maxHeight * devicePixelRatio).round(), fit: BoxFit.cover,
)!, );
fit: BoxFit.contain, }),
);
}),
),
_ => Container( _ => Container(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
child: const Icon(Symbols.docs).center(), child: const Icon(Symbols.docs).center(),
@ -239,21 +236,18 @@ class PostMediaPendingList extends StatelessWidget {
child: AspectRatio( child: AspectRatio(
aspectRatio: 1, aspectRatio: 1,
child: switch (media.type) { child: switch (media.type) {
PostWriteMediaType.image => Container( PostWriteMediaType.image => LayoutBuilder(builder: (context, constraints) {
color: Theme.of(context).colorScheme.surfaceContainer, return Image(
child: LayoutBuilder(builder: (context, constraints) { image: media.getImageProvider(
return Image( context,
image: media.getImageProvider( width: (constraints.maxWidth * devicePixelRatio).round(),
context, height: (constraints.maxHeight * devicePixelRatio).round(),
width: (constraints.maxWidth * devicePixelRatio).round(), )!,
height: (constraints.maxHeight * devicePixelRatio).round(), fit: BoxFit.cover,
)!, );
fit: BoxFit.contain, }),
);
}),
),
_ => Container( _ => Container(
color: Theme.of(context).colorScheme.surfaceContainer, color: Theme.of(context).colorScheme.surface,
child: const Icon(Symbols.docs).center(), child: const Icon(Symbols.docs).center(),
), ),
}, },

View File

@ -114,18 +114,6 @@ class PostMetaEditor extends StatelessWidget {
controller.setTags(value); controller.setTags(value);
}, },
).padding(horizontal: 24), ).padding(horizontal: 24),
const Gap(4),
TextField(
controller: controller.aliasController,
decoration: InputDecoration(
labelText: 'fieldPostAlias'.tr(),
helperText: 'fieldPostAliasHint'.tr(),
helperMaxLines: 2,
border: UnderlineInputBorder(),
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
).padding(horizontal: 24),
const Gap(12), const Gap(12),
ListTile( ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 24), contentPadding: const EdgeInsets.symmetric(horizontal: 24),

View File

@ -7,7 +7,6 @@ import 'package:material_symbols_icons/symbols.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:styled_widget/styled_widget.dart'; import 'package:styled_widget/styled_widget.dart';
import 'package:surface/controllers/post_write_controller.dart'; import 'package:surface/controllers/post_write_controller.dart';
import 'package:surface/providers/config.dart';
import 'package:surface/providers/sn_network.dart'; import 'package:surface/providers/sn_network.dart';
import 'package:surface/types/post.dart'; import 'package:surface/types/post.dart';
import 'package:surface/widgets/account/account_image.dart'; import 'package:surface/widgets/account/account_image.dart';
@ -17,7 +16,6 @@ import 'package:surface/widgets/loading_indicator.dart';
class PostMiniEditor extends StatefulWidget { class PostMiniEditor extends StatefulWidget {
final int? postReplyId; final int? postReplyId;
final Function? onPost; final Function? onPost;
const PostMiniEditor({super.key, this.postReplyId, this.onPost}); const PostMiniEditor({super.key, this.postReplyId, this.onPost});
@override @override
@ -28,7 +26,6 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
final PostWriteController _writeController = PostWriteController(); final PostWriteController _writeController = PostWriteController();
bool _isFetching = false; bool _isFetching = false;
bool get _isLoading => _isFetching || _writeController.isLoading; bool get _isLoading => _isFetching || _writeController.isLoading;
List<SnPublisher>? _publishers; List<SnPublisher>? _publishers;
@ -38,14 +35,11 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
try { try {
final sn = context.read<SnNetworkProvider>(); final sn = context.read<SnNetworkProvider>();
final config = context.read<ConfigProvider>();
final resp = await sn.client.get('/cgi/co/publishers/me'); final resp = await sn.client.get('/cgi/co/publishers/me');
_publishers = List<SnPublisher>.from( _publishers = List<SnPublisher>.from(
resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [], resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [],
); );
final beforeId = config.prefs.getInt('int_last_publisher_id'); _writeController.setPublisher(_publishers?.firstOrNull);
_writeController
.setPublisher(_publishers?.where((ele) => ele.id == beforeId).firstOrNull ?? _publishers?.firstOrNull);
} catch (err) { } catch (err) {
if (!mounted) return; if (!mounted) return;
context.showErrorDialog(err); context.showErrorDialog(err);
@ -99,11 +93,17 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text(item.nick).textStyle(Theme.of(context).textTheme.bodyMedium!), Text(item.nick).textStyle(
Theme.of(context)
.textTheme
.bodyMedium!),
Text('@${item.name}') Text('@${item.name}')
.textStyle(Theme.of(context).textTheme.bodySmall!) .textStyle(Theme.of(context)
.textTheme
.bodySmall!)
.fontSize(12), .fontSize(12),
], ],
), ),
@ -120,7 +120,8 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
CircleAvatar( CircleAvatar(
radius: 16, radius: 16,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
foregroundColor: Theme.of(context).colorScheme.onSurface, foregroundColor:
Theme.of(context).colorScheme.onSurface,
child: const Icon(Symbols.add), child: const Icon(Symbols.add),
), ),
const Gap(8), const Gap(8),
@ -129,7 +130,8 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('publishersNew').tr().textStyle(Theme.of(context).textTheme.bodyMedium!), Text('publishersNew').tr().textStyle(
Theme.of(context).textTheme.bodyMedium!),
], ],
), ),
), ),
@ -140,7 +142,9 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
value: _writeController.publisher, value: _writeController.publisher,
onChanged: (SnPublisher? value) { onChanged: (SnPublisher? value) {
if (value == null) { if (value == null) {
GoRouter.of(context).pushNamed('accountPublisherNew').then((value) { GoRouter.of(context)
.pushNamed('accountPublisherNew')
.then((value) {
if (value == true) { if (value == true) {
_publishers = null; _publishers = null;
_fetchPublishers(); _fetchPublishers();
@ -148,8 +152,6 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
}); });
} else { } else {
_writeController.setPublisher(value); _writeController.setPublisher(value);
final config = context.read<ConfigProvider>();
config.prefs.setInt('int_last_publisher_id', value.id);
} }
}, },
buttonStyleData: const ButtonStyleData( buttonStyleData: const ButtonStyleData(
@ -176,7 +178,8 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
), ),
border: InputBorder.none, border: InputBorder.none,
), ),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(), onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
), ),
), ),
const Gap(8), const Gap(8),
@ -185,7 +188,8 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
TweenAnimationBuilder<double>( TweenAnimationBuilder<double>(
tween: Tween(begin: 0, end: _writeController.progress), tween: Tween(begin: 0, end: _writeController.progress),
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
builder: (context, value, _) => LinearProgressIndicator(value: value, minHeight: 2), builder: (context, value, _) =>
LinearProgressIndicator(value: value, minHeight: 2),
) )
else if (_writeController.isBusy) else if (_writeController.isBusy)
const LinearProgressIndicator(value: null, minHeight: 2), const LinearProgressIndicator(value: null, minHeight: 2),
@ -202,16 +206,18 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
'postEditor', 'postEditor',
pathParameters: {'mode': 'stories'}, pathParameters: {'mode': 'stories'},
queryParameters: { queryParameters: {
if (widget.postReplyId != null) 'replying': widget.postReplyId.toString(), if (widget.postReplyId != null)
'replying': widget.postReplyId.toString(),
}, },
); );
}, },
), ),
TextButton.icon( TextButton.icon(
onPressed: (_writeController.isBusy || _writeController.publisher == null) onPressed: (_writeController.isBusy ||
_writeController.publisher == null)
? null ? null
: () { : () {
_writeController.sendPost(context).then((_) { _writeController.post(context).then((_) {
if (!context.mounted) return; if (!context.mounted) return;
if (widget.onPost != null) widget.onPost!(); if (widget.onPost != null) widget.onPost!();
context.showSnackbar('postPosted'.tr()); context.showSnackbar('postPosted'.tr());

View File

@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 2.1.1+37 version: 2.1.1+36
environment: environment:
sdk: ^3.5.4 sdk: ^3.5.4