Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
16047a7d57 | |||
fdc68fc5e1 | |||
bbee825cf4 | |||
2673c11046 |
@ -98,6 +98,8 @@
|
||||
"accountFriendBlocked": "Friend blocklist",
|
||||
"accountFriendListHint": "Swipe left to decline, right to approve",
|
||||
"accountFriendRequestSent": "Friend request sent, waiting for processing...",
|
||||
"accountBlocked": "Account has been blocked",
|
||||
"accountUnblocked": "Account has been unblocked",
|
||||
"accountSuspended": "Account was suspended",
|
||||
"accountSuspendedAt": "Account was suspended since @date",
|
||||
"aspectRatio": "Aspect Ratio",
|
||||
@ -457,5 +459,9 @@
|
||||
"serviceStatus": "Status of Service",
|
||||
"firstBootTime": "First boot at @time",
|
||||
"rateTheApp": "Rate the app",
|
||||
"rateTheAppDesc": "Rate Solar Network on the App Store to let us serve you better!"
|
||||
"rateTheAppDesc": "Rate Solar Network on the App Store to let us serve you better!",
|
||||
"friendAdd": "Add as friend",
|
||||
"blockUser": "Block user",
|
||||
"unblockUser": "Unblock user",
|
||||
"learnMoreAboutPerson": "Learn more about that person"
|
||||
}
|
||||
|
@ -98,6 +98,8 @@
|
||||
"accountFriendBlocked": "好友黑名单",
|
||||
"accountFriendListHint": "左滑来拒绝,右滑来接受",
|
||||
"accountFriendRequestSent": "好友请求已发送,等待处理对方中……",
|
||||
"accountBlocked": "已屏蔽账号",
|
||||
"accountUnblocked": "已解除屏蔽账号",
|
||||
"accountSuspended": "帐号被停用",
|
||||
"accountSuspendedAt": "该帐号自 @date 起被停用",
|
||||
"aspectRatio": "纵横比",
|
||||
@ -453,5 +455,9 @@
|
||||
"serviceStatus": "服务状态",
|
||||
"firstBootTime": "首次启动于 @time",
|
||||
"rateTheApp": "给应用评分",
|
||||
"rateTheAppDesc": "在 App Store 上给 Solar Network 评分,让我们更好地为您服务吧!"
|
||||
"rateTheAppDesc": "在 App Store 上给 Solar Network 评分,让我们更好地为您服务吧!",
|
||||
"friendAdd": "添加好友",
|
||||
"blockUser": "屏蔽用户",
|
||||
"unblockUser": "解除屏蔽用户",
|
||||
"learnMoreAboutPerson": "了解关于 TA 的更多"
|
||||
}
|
||||
|
@ -26,6 +26,19 @@ class RelationshipProvider extends GetxController {
|
||||
return _friends.any((x) => x.relatedId == account.id);
|
||||
}
|
||||
|
||||
Future<Relationship?> getRelationship(int relatedId) async {
|
||||
final AuthProvider auth = Get.find();
|
||||
final client = await auth.configureClient('auth');
|
||||
final resp = await client.get('/users/me/relations/$relatedId');
|
||||
if (resp.statusCode == 404) {
|
||||
return null;
|
||||
} else if (resp.statusCode != 200) {
|
||||
throw RequestException(resp);
|
||||
}
|
||||
|
||||
return Relationship.fromJson(resp.body);
|
||||
}
|
||||
|
||||
Future<Response> listRelation() async {
|
||||
final AuthProvider auth = Get.find();
|
||||
final client = await auth.configureClient('auth');
|
||||
@ -38,7 +51,19 @@ class RelationshipProvider extends GetxController {
|
||||
return client.get('/users/me/relations?status=$status');
|
||||
}
|
||||
|
||||
Future<Response> makeFriend(String username) async {
|
||||
Future<Relationship?> blockUser(String username) async {
|
||||
final AuthProvider auth = Get.find();
|
||||
final client = await auth.configureClient('auth');
|
||||
final resp =
|
||||
await client.post('/users/me/relations/block?related=$username', {});
|
||||
if (resp.statusCode != 200) {
|
||||
throw RequestException(resp);
|
||||
}
|
||||
|
||||
return Relationship.fromJson(resp.body);
|
||||
}
|
||||
|
||||
Future<Relationship?> makeFriend(String username) async {
|
||||
final AuthProvider auth = Get.find();
|
||||
final client = await auth.configureClient('auth');
|
||||
final resp = await client.post('/users/me/relations?related=$username', {});
|
||||
@ -46,7 +71,7 @@ class RelationshipProvider extends GetxController {
|
||||
throw RequestException(resp);
|
||||
}
|
||||
|
||||
return resp;
|
||||
return Relationship.fromJson(resp.body);
|
||||
}
|
||||
|
||||
Future<Response> handleRelation(
|
||||
@ -64,17 +89,17 @@ class RelationshipProvider extends GetxController {
|
||||
return resp;
|
||||
}
|
||||
|
||||
Future<Response> editRelation(Relationship relationship, int status) async {
|
||||
Future<Relationship?> editRelation(int relatedId, int status) async {
|
||||
final AuthProvider auth = Get.find();
|
||||
final client = await auth.configureClient('auth');
|
||||
final resp = await client.patch(
|
||||
'/users/me/relations/${relationship.relatedId}',
|
||||
final resp = await client.put(
|
||||
'/users/me/relations/$relatedId',
|
||||
{'status': status},
|
||||
);
|
||||
if (resp.statusCode != 200) {
|
||||
throw RequestException(resp);
|
||||
}
|
||||
|
||||
return resp;
|
||||
return Relationship.fromJson(resp.body);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import 'package:solian/models/attachment.dart';
|
||||
import 'package:solian/models/daily_sign.dart';
|
||||
import 'package:solian/models/pagination.dart';
|
||||
import 'package:solian/models/post.dart';
|
||||
import 'package:solian/models/relations.dart';
|
||||
import 'package:solian/models/subscription.dart';
|
||||
import 'package:solian/providers/account_status.dart';
|
||||
import 'package:solian/providers/relation.dart';
|
||||
@ -26,6 +27,7 @@ import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||
import 'package:solian/widgets/daily_sign/history_chart.dart';
|
||||
import 'package:solian/widgets/posts/post_list.dart';
|
||||
import 'package:solian/widgets/posts/post_warped_list.dart';
|
||||
import 'package:solian/widgets/reports/abuse_report.dart';
|
||||
import 'package:solian/widgets/sized_container.dart';
|
||||
|
||||
class AccountProfilePage extends StatefulWidget {
|
||||
@ -50,6 +52,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
|
||||
Account? _userinfo;
|
||||
Subscription? _subscription;
|
||||
Relationship? _relationship;
|
||||
List<Post> _pinnedPosts = List.empty();
|
||||
List<DailySignRecord> _dailySignRecords = List.empty();
|
||||
int _totalUpvote = 0, _totalDownvote = 0;
|
||||
@ -61,6 +64,15 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
setState(() => _isSubscribing = false);
|
||||
}
|
||||
|
||||
Future<void> _getRelationship() async {
|
||||
setState(() => _isBusy = true);
|
||||
|
||||
final relations = Get.find<RelationshipProvider>();
|
||||
_relationship = await relations.getRelationship(_userinfo!.id);
|
||||
|
||||
setState(() => _isBusy = false);
|
||||
}
|
||||
|
||||
Future<void> _getUserinfo() async {
|
||||
setState(() => _isBusy = true);
|
||||
|
||||
@ -120,6 +132,63 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _subscribeToUser() async {
|
||||
setState(() => _isSubscribing = true);
|
||||
_subscription =
|
||||
await Get.find<SubscriptionProvider>().subscribeToUser(_userinfo!.id);
|
||||
setState(() => _isSubscribing = false);
|
||||
}
|
||||
|
||||
Future<void> _unsubscribeFromUser() async {
|
||||
setState(() => _isSubscribing = true);
|
||||
await Get.find<SubscriptionProvider>().unsubscribeFromUser(_userinfo!.id);
|
||||
_subscription = null;
|
||||
setState(() => _isSubscribing = false);
|
||||
}
|
||||
|
||||
Future<void> _makeFriend() async {
|
||||
setState(() => _isMakingFriend = true);
|
||||
try {
|
||||
_relationship = await _relationshipProvider.makeFriend(widget.name);
|
||||
context.showSnackbar(
|
||||
'accountFriendRequestSent'.tr,
|
||||
);
|
||||
} catch (e) {
|
||||
context.showErrorDialog(e);
|
||||
} finally {
|
||||
setState(() => _isMakingFriend = false);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _blockUser() async {
|
||||
setState(() => _isMakingFriend = true);
|
||||
try {
|
||||
_relationship = await _relationshipProvider.blockUser(widget.name);
|
||||
context.showSnackbar(
|
||||
'accountBlocked'.tr,
|
||||
);
|
||||
} catch (e) {
|
||||
context.showErrorDialog(e);
|
||||
} finally {
|
||||
setState(() => _isMakingFriend = false);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _unblockUser() async {
|
||||
setState(() => _isMakingFriend = true);
|
||||
try {
|
||||
_relationship =
|
||||
await _relationshipProvider.editRelation(_userinfo!.id, 1);
|
||||
context.showSnackbar(
|
||||
'accountUnblocked'.tr,
|
||||
);
|
||||
} catch (e) {
|
||||
context.showErrorDialog(e);
|
||||
} finally {
|
||||
setState(() => _isMakingFriend = false);
|
||||
}
|
||||
}
|
||||
|
||||
int get _userSocialCreditPoints {
|
||||
return _totalUpvote * 2 - _totalDownvote + _postController.postTotal.value;
|
||||
}
|
||||
@ -151,29 +220,13 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
});
|
||||
|
||||
_getUserinfo().then((_) {
|
||||
_getRelationship();
|
||||
_getSubscription();
|
||||
_getPinnedPosts();
|
||||
_getDailySignRecords();
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildStatisticsEntry(String label, String content) {
|
||||
return Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
Text(
|
||||
content,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_isBusy || _userinfo == null) {
|
||||
@ -221,59 +274,31 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
),
|
||||
),
|
||||
if (_userinfo != null && _subscription == null)
|
||||
OutlinedButton(
|
||||
IconButton(
|
||||
style: const ButtonStyle(
|
||||
visualDensity:
|
||||
VisualDensity(horizontal: -4, vertical: -2),
|
||||
),
|
||||
onPressed: _isSubscribing
|
||||
? null
|
||||
: () async {
|
||||
setState(() => _isSubscribing = true);
|
||||
_subscription =
|
||||
await Get.find<SubscriptionProvider>()
|
||||
.subscribeToUser(_userinfo!.id);
|
||||
setState(() => _isSubscribing = false);
|
||||
},
|
||||
child: Text('subscribe'.tr),
|
||||
onPressed: _isSubscribing ? null : _subscribeToUser,
|
||||
icon: const Icon(Icons.add_circle_outline),
|
||||
tooltip: 'subscribe'.tr,
|
||||
)
|
||||
else if (_userinfo != null)
|
||||
OutlinedButton(
|
||||
IconButton(
|
||||
style: const ButtonStyle(
|
||||
visualDensity:
|
||||
VisualDensity(horizontal: -4, vertical: -2),
|
||||
),
|
||||
onPressed: _isSubscribing
|
||||
? null
|
||||
: () async {
|
||||
setState(() => _isSubscribing = true);
|
||||
await Get.find<SubscriptionProvider>()
|
||||
.unsubscribeFromUser(_userinfo!.id);
|
||||
_subscription = null;
|
||||
setState(() => _isSubscribing = false);
|
||||
},
|
||||
child: Text('unsubscribe'.tr),
|
||||
onPressed:
|
||||
_isSubscribing ? null : _unsubscribeFromUser,
|
||||
icon: const Icon(Icons.remove_circle_outline),
|
||||
tooltip: 'unsubscribe'.tr,
|
||||
),
|
||||
if (_userinfo != null &&
|
||||
!_relationshipProvider.hasFriend(_userinfo!))
|
||||
if (_userinfo != null && _relationship == null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.person_add),
|
||||
onPressed: _isMakingFriend
|
||||
? null
|
||||
: () async {
|
||||
setState(() => _isMakingFriend = true);
|
||||
try {
|
||||
await _relationshipProvider
|
||||
.makeFriend(widget.name);
|
||||
context.showSnackbar(
|
||||
'accountFriendRequestSent'.tr,
|
||||
);
|
||||
} catch (e) {
|
||||
context.showErrorDialog(e);
|
||||
} finally {
|
||||
setState(() => _isMakingFriend = false);
|
||||
}
|
||||
},
|
||||
onPressed: _isMakingFriend ? null : _makeFriend,
|
||||
tooltip: 'friendAdd'.tr,
|
||||
)
|
||||
else
|
||||
const IconButton(
|
||||
@ -300,8 +325,8 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16),
|
||||
children: [
|
||||
const Gap(16),
|
||||
CenteredContainer(
|
||||
child: AccountHeadingWidget(
|
||||
name: _userinfo!.name,
|
||||
@ -421,9 +446,82 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
),
|
||||
),
|
||||
).marginOnly(
|
||||
right: 24, left: 12, bottom: 8, top: 24),
|
||||
right: 24,
|
||||
left: 12,
|
||||
bottom: 8,
|
||||
top: 24,
|
||||
),
|
||||
)
|
||||
],
|
||||
appendWidgets: [
|
||||
Card(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
horizontal: 8,
|
||||
),
|
||||
width: double.maxFinite,
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.spaceAround,
|
||||
children: [
|
||||
TextButton.icon(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -4,
|
||||
vertical: -2,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AbuseReportDialog(
|
||||
resourceId: 'user:${_userinfo!.id}',
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.flag,
|
||||
size: 16,
|
||||
),
|
||||
label: Text('reportAbuse'.tr),
|
||||
),
|
||||
if (_relationship?.status != 2)
|
||||
TextButton.icon(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -4,
|
||||
vertical: -2,
|
||||
),
|
||||
),
|
||||
onPressed:
|
||||
_isMakingFriend ? null : _blockUser,
|
||||
icon: const Icon(
|
||||
Icons.block,
|
||||
size: 16,
|
||||
),
|
||||
label: Text('blockUser'.tr),
|
||||
)
|
||||
else
|
||||
TextButton.icon(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -4,
|
||||
vertical: -2,
|
||||
),
|
||||
),
|
||||
onPressed:
|
||||
_isMakingFriend ? null : _unblockUser,
|
||||
icon: const Icon(
|
||||
Icons.add_circle_outline,
|
||||
size: 16,
|
||||
),
|
||||
label: Text('unblockUser'.tr),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -440,7 +538,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
_buildStatisticsEntry(
|
||||
_StatsWidget(
|
||||
'totalSocialCreditPoints'.tr,
|
||||
_userinfo != null
|
||||
? _userSocialCreditPoints.toString()
|
||||
@ -453,16 +551,16 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Obx(
|
||||
() => _buildStatisticsEntry(
|
||||
() => _StatsWidget(
|
||||
'totalPostCount'.tr,
|
||||
_postController.postTotal.value.toString(),
|
||||
),
|
||||
),
|
||||
_buildStatisticsEntry(
|
||||
_StatsWidget(
|
||||
'totalUpvote'.tr,
|
||||
_totalUpvote.toString(),
|
||||
),
|
||||
_buildStatisticsEntry(
|
||||
_StatsWidget(
|
||||
'totalDownvote'.tr,
|
||||
_totalDownvote.toString(),
|
||||
),
|
||||
@ -560,3 +658,28 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _StatsWidget extends StatelessWidget {
|
||||
final String label;
|
||||
final String content;
|
||||
|
||||
const _StatsWidget(this.label, this.content);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
Text(
|
||||
content,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ class AccountHeadingWidget extends StatelessWidget {
|
||||
final AccountProfile? profile;
|
||||
final List<AccountBadge>? badges;
|
||||
final List<Widget>? extraWidgets;
|
||||
final List<Widget>? appendWidgets;
|
||||
|
||||
final Future<Response>? status;
|
||||
final Function? onEditStatus;
|
||||
@ -39,6 +40,7 @@ class AccountHeadingWidget extends StatelessWidget {
|
||||
this.profile,
|
||||
this.status,
|
||||
this.extraWidgets,
|
||||
this.appendWidgets,
|
||||
this.onEditStatus,
|
||||
});
|
||||
|
||||
@ -257,6 +259,7 @@ class AccountHeadingWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
).paddingSymmetric(horizontal: 16),
|
||||
...?appendWidgets?.map((x) => x.paddingSymmetric(horizontal: 16)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -106,10 +106,14 @@ class _AccountProfilePopupState extends State<AccountProfilePopup> {
|
||||
extraWidgets: [
|
||||
Card(
|
||||
child: ListTile(
|
||||
leading: const Icon(
|
||||
Icons.contact_page_outlined,
|
||||
),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
title: Text('visitProfilePage'.tr),
|
||||
subtitle: Text('learnMoreAboutPerson'.tr),
|
||||
visualDensity:
|
||||
const VisualDensity(horizontal: -4, vertical: -2),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
|
@ -28,13 +28,9 @@ class SilverRelativeList extends StatelessWidget {
|
||||
showModalBottomSheet(
|
||||
useRootNavigator: true,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Theme
|
||||
.of(context)
|
||||
.colorScheme
|
||||
.surface,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
AccountProfilePopup(
|
||||
builder: (context) => AccountProfilePopup(
|
||||
name: element.related.name,
|
||||
),
|
||||
);
|
||||
@ -43,27 +39,35 @@ class SilverRelativeList extends StatelessWidget {
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if(element.status != 1 && element.status != 3)
|
||||
if (element.status != 1 && element.status != 3)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.check),
|
||||
onPressed: () {
|
||||
final RelationshipProvider provider = Get.find();
|
||||
if (element.status == 0) {
|
||||
provider.handleRelation(element, true).then((_) => onUpdate());
|
||||
provider
|
||||
.handleRelation(element, true)
|
||||
.then((_) => onUpdate());
|
||||
} else {
|
||||
provider.editRelation(element, 1).then((_) => onUpdate());
|
||||
provider
|
||||
.editRelation(element.relatedId, 1)
|
||||
.then((_) => onUpdate());
|
||||
}
|
||||
},
|
||||
),
|
||||
if(element.status != 2 && element.status != 3)
|
||||
if (element.status != 2 && element.status != 3)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () {
|
||||
final RelationshipProvider provider = Get.find();
|
||||
if (element.status == 0) {
|
||||
provider.handleRelation(element, false).then((_) => onUpdate());
|
||||
provider
|
||||
.handleRelation(element, false)
|
||||
.then((_) => onUpdate());
|
||||
} else {
|
||||
provider.editRelation(element, 2).then((_) => onUpdate());
|
||||
provider
|
||||
.editRelation(element.relatedId, 2)
|
||||
.then((_) => onUpdate());
|
||||
}
|
||||
},
|
||||
),
|
||||
|
@ -744,8 +744,8 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
return IgnorePointer(
|
||||
ignoring: _uploadController.isUploading.value,
|
||||
child: Container(
|
||||
height: 64,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
@ -754,11 +754,9 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
),
|
||||
),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 0,
|
||||
runSpacing: 8,
|
||||
alignment: WrapAlignment.center,
|
||||
runAlignment: WrapAlignment.center,
|
||||
children: [
|
||||
@ -766,55 +764,62 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
PlatformInfo.isIOS ||
|
||||
PlatformInfo.isWeb) &&
|
||||
!widget.imageOnly)
|
||||
ElevatedButton.icon(
|
||||
IconButton(
|
||||
icon: const Icon(Icons.paste),
|
||||
label: Text('attachmentAddClipboard'.tr),
|
||||
tooltip: 'attachmentAddClipboard'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _pasteFileToUpload(),
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add_photo_alternate),
|
||||
label: Text('attachmentAddGalleryPhoto'.tr),
|
||||
tooltip: 'attachmentAddGalleryPhoto'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _pickPhotoToUpload(),
|
||||
),
|
||||
if (!widget.imageOnly)
|
||||
ElevatedButton.icon(
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add_road),
|
||||
label: Text('attachmentAddGalleryVideo'.tr),
|
||||
tooltip: 'attachmentAddGalleryVideo'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _pickVideoToUpload(),
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
if (PlatformInfo.isMobile)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.photo_camera_back),
|
||||
label: Text('attachmentAddCameraPhoto'.tr),
|
||||
tooltip: 'attachmentAddCameraPhoto'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _takeMediaToUpload(false),
|
||||
),
|
||||
if (!widget.imageOnly)
|
||||
ElevatedButton.icon(
|
||||
if (!widget.imageOnly && PlatformInfo.isMobile)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.video_camera_back_outlined),
|
||||
label: Text('attachmentAddCameraVideo'.tr),
|
||||
tooltip: 'attachmentAddCameraVideo'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _takeMediaToUpload(true),
|
||||
),
|
||||
if (!widget.imageOnly)
|
||||
ElevatedButton.icon(
|
||||
IconButton(
|
||||
icon: const Icon(Icons.file_present_rounded),
|
||||
label: Text('attachmentAddFile'.tr),
|
||||
tooltip: 'attachmentAddFile'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _pickFileToUpload(),
|
||||
),
|
||||
if (!widget.imageOnly)
|
||||
ElevatedButton.icon(
|
||||
IconButton(
|
||||
icon: const Icon(Icons.link),
|
||||
label: Text('attachmentAddFile'.tr),
|
||||
tooltip: 'attachmentAddLink'.tr,
|
||||
style: const ButtonStyle(visualDensity: density),
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: () => _linkAttachments(),
|
||||
),
|
||||
],
|
||||
).paddingSymmetric(horizontal: 12),
|
||||
),
|
||||
)
|
||||
.animate(
|
||||
target: _uploadController.isUploading.value ? 0 : 1,
|
||||
|
@ -12,8 +12,6 @@
|
||||
<true/>
|
||||
<key>com.apple.security.device.audio-input</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.bluetooth</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.camera</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
|
@ -10,8 +10,6 @@
|
||||
<true/>
|
||||
<key>com.apple.security.device.audio-input</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.bluetooth</key>
|
||||
<true/>
|
||||
<key>com.apple.security.device.camera</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
|
@ -2,7 +2,7 @@ name: solian
|
||||
description: "The Solar Network App"
|
||||
publish_to: "none"
|
||||
|
||||
version: 1.2.4+1
|
||||
version: 1.2.5+1
|
||||
|
||||
environment:
|
||||
sdk: ">=3.3.4 <4.0.0"
|
||||
|
Reference in New Issue
Block a user