🍱 Update app icon for v1.2.0
This commit is contained in:
@ -83,7 +83,6 @@ class AttachmentProvider extends GetConnect {
|
||||
int id,
|
||||
String alt,
|
||||
String usage, {
|
||||
double? ratio,
|
||||
bool isMature = false,
|
||||
}) async {
|
||||
final AuthProvider auth = Get.find();
|
||||
@ -92,9 +91,6 @@ class AttachmentProvider extends GetConnect {
|
||||
final client = auth.configureClient('files');
|
||||
|
||||
var resp = await client.put('/attachments/$id', {
|
||||
'metadata': {
|
||||
if (ratio != null) 'ratio': ratio,
|
||||
},
|
||||
'alt': alt,
|
||||
'usage': usage,
|
||||
'is_mature': isMature,
|
||||
|
@ -137,7 +137,7 @@ class PostCreatePopup extends StatelessWidget {
|
||||
final List<dynamic> actionList = [
|
||||
(
|
||||
icon: const Icon(Icons.edit_square),
|
||||
label: 'postEditor'.tr,
|
||||
label: 'postEditorModeStory'.tr,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
AppRouter.instance.pushNamed('postEditor').then((val) {
|
||||
|
@ -134,7 +134,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: AppBarLeadingButton.adaptive(context),
|
||||
title: AppBarTitle('postPublish'.tr),
|
||||
title: AppBarTitle('postEditorModeStory'.tr),
|
||||
centerTitle: false,
|
||||
toolbarHeight: SolianTheme.toolbarHeight(context),
|
||||
actions: [
|
||||
|
@ -32,7 +32,9 @@ abstract class SolianTheme {
|
||||
brightness: brightness,
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
brightness: brightness, seedColor: Colors.indigo),
|
||||
brightness: brightness,
|
||||
seedColor: const Color.fromRGBO(103, 96, 193, 1),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import 'package:solian/translations/zh_cn.dart';
|
||||
class SolianMessages extends Translations {
|
||||
@override
|
||||
Map<String, Map<String, String>> get keys => {
|
||||
'en_US': messagesEnglish,
|
||||
'zh_CN': simplifiedChineseMessages,
|
||||
'en_US': i18nEnglish,
|
||||
'zh_CN': i18nSimplifiedChinese,
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
const messagesEnglish = {
|
||||
const i18nEnglish = {
|
||||
'done': 'Done',
|
||||
'hide': 'Hide',
|
||||
'okay': 'Okay',
|
||||
@ -97,7 +97,9 @@ const messagesEnglish = {
|
||||
'postPinned': 'Pinned',
|
||||
'postListNews': 'News',
|
||||
'postListShuffle': 'Random',
|
||||
'postEditor': 'Create new post',
|
||||
'postEditorModeStory': 'Post a post',
|
||||
'postEditorModeArticle': 'Post an article',
|
||||
'postEditor': 'Post editor',
|
||||
'articleEditor': 'Create new article',
|
||||
'articleDetail': 'Article details',
|
||||
'draftBoxOpen': 'Open draft box',
|
||||
|
@ -1,4 +1,4 @@
|
||||
const simplifiedChineseMessages = {
|
||||
const i18nSimplifiedChinese = {
|
||||
'done': '完成',
|
||||
'hide': '隐藏',
|
||||
'okay': '确认',
|
||||
@ -89,7 +89,9 @@ const simplifiedChineseMessages = {
|
||||
'pinPost': '置顶本帖',
|
||||
'unpinPost': '取消置顶本帖',
|
||||
'postPinned': '已置顶',
|
||||
'postEditor': '发个帖子',
|
||||
'postEditorModeStory': '发个帖子',
|
||||
'postEditorModeArticle': '撰写文章',
|
||||
'postEditor': '帖子编辑器',
|
||||
'articleEditor': '撰写文章',
|
||||
'articleDetail': '文章详情',
|
||||
'draftBoxOpen': '打开草稿箱',
|
||||
|
@ -108,7 +108,6 @@ class _AttachmentItemImage extends StatelessWidget {
|
||||
final Function? onHide;
|
||||
|
||||
const _AttachmentItemImage({
|
||||
super.key,
|
||||
required this.parentId,
|
||||
required this.item,
|
||||
required this.showBadge,
|
||||
@ -215,7 +214,7 @@ class _AttachmentItemImage extends StatelessWidget {
|
||||
class _AttachmentItemVideo extends StatefulWidget {
|
||||
final Attachment item;
|
||||
|
||||
const _AttachmentItemVideo({super.key, required this.item});
|
||||
const _AttachmentItemVideo({required this.item});
|
||||
|
||||
@override
|
||||
State<_AttachmentItemVideo> createState() => _AttachmentItemVideoState();
|
||||
|
@ -361,7 +361,7 @@ class _AttachmentPublishPopupState extends State<AttachmentPublishPopup> {
|
||||
alignment: WrapAlignment.center,
|
||||
runAlignment: WrapAlignment.center,
|
||||
children: [
|
||||
if (PlatformInfo.isDesktop)
|
||||
if (PlatformInfo.isDesktop || PlatformInfo.isIOS || PlatformInfo.isWeb)
|
||||
ElevatedButton.icon(
|
||||
icon: const Icon(Icons.paste),
|
||||
label: Text('attachmentAddClipboard'.tr),
|
||||
@ -426,12 +426,10 @@ class AttachmentEditorDialog extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AttachmentEditorDialogState extends State<AttachmentEditorDialog> {
|
||||
final _ratioController = TextEditingController();
|
||||
final _altController = TextEditingController();
|
||||
|
||||
bool _isBusy = false;
|
||||
bool _isMature = false;
|
||||
bool _hasAspectRatio = false;
|
||||
|
||||
Future<Attachment?> updateAttachment() async {
|
||||
final AttachmentProvider provider = Get.find();
|
||||
@ -442,9 +440,6 @@ class _AttachmentEditorDialogState extends State<AttachmentEditorDialog> {
|
||||
widget.item.id,
|
||||
_altController.value.text,
|
||||
widget.item.usage,
|
||||
ratio: _hasAspectRatio
|
||||
? (double.tryParse(_ratioController.value.text) ?? 1)
|
||||
: null,
|
||||
isMature: _isMature,
|
||||
);
|
||||
|
||||
@ -476,13 +471,6 @@ class _AttachmentEditorDialogState extends State<AttachmentEditorDialog> {
|
||||
void syncWidget() {
|
||||
_isMature = widget.item.isMature;
|
||||
_altController.text = widget.item.alt;
|
||||
|
||||
if (['image', 'video']
|
||||
.contains(widget.item.mimetype.split('/').firstOrNull)) {
|
||||
_ratioController.text =
|
||||
widget.item.metadata?['ratio']?.toString() ?? 1.toString();
|
||||
_hasAspectRatio = true;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -517,61 +505,6 @@ class _AttachmentEditorDialogState extends State<AttachmentEditorDialog> {
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextField(
|
||||
readOnly: !_hasAspectRatio,
|
||||
controller: _ratioController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
prefixIcon: const Icon(Icons.aspect_ratio),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'aspectRatio'.tr,
|
||||
),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Wrap(
|
||||
spacing: 6,
|
||||
runSpacing: 0,
|
||||
children: [
|
||||
ActionChip(
|
||||
avatar: Icon(Icons.square_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
label: Text('aspectRatioSquare'.tr),
|
||||
onPressed: () {
|
||||
if (_hasAspectRatio) {
|
||||
setState(() => _ratioController.text = '1');
|
||||
}
|
||||
},
|
||||
),
|
||||
ActionChip(
|
||||
avatar: Icon(Icons.portrait,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
label: Text('aspectRatioPortrait'.tr),
|
||||
onPressed: () {
|
||||
if (_hasAspectRatio) {
|
||||
setState(
|
||||
() => _ratioController.text = (9 / 16).toString());
|
||||
}
|
||||
},
|
||||
),
|
||||
ActionChip(
|
||||
avatar: Icon(Icons.landscape,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
label: Text('aspectRatioLandscape'.tr),
|
||||
onPressed: () {
|
||||
if (_hasAspectRatio) {
|
||||
setState(
|
||||
() => _ratioController.text = (16 / 9).toString());
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Card(
|
||||
child: CheckboxListTile(
|
||||
shape: const RoundedRectangleBorder(
|
||||
|
Reference in New Issue
Block a user