Compare commits
	
		
			2 Commits
		
	
	
		
			f00135c4bf
			...
			e2dc520012
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e2dc520012 | |||
| cff9c15e31 | 
| @@ -144,6 +144,7 @@ | |||||||
|     "other": "{} attachments" |     "other": "{} attachments" | ||||||
|   }, |   }, | ||||||
|   "edited": "Edited", |   "edited": "Edited", | ||||||
|  |   "editedAt": "Edited at {}", | ||||||
|   "addVideo": "Add video", |   "addVideo": "Add video", | ||||||
|   "addPhoto": "Add photo", |   "addPhoto": "Add photo", | ||||||
|   "addAudio": "Add audio", |   "addAudio": "Add audio", | ||||||
|   | |||||||
| @@ -279,18 +279,14 @@ class _DraftItem extends StatelessWidget { | |||||||
|  |  | ||||||
|   String _parseVisibility(int visibility) { |   String _parseVisibility(int visibility) { | ||||||
|     switch (visibility) { |     switch (visibility) { | ||||||
|       case 0: |  | ||||||
|         return 'public'.tr(); |  | ||||||
|       case 1: |       case 1: | ||||||
|         return 'unlisted'.tr(); |         return 'postVisibilityFriends'; | ||||||
|       case 2: |       case 2: | ||||||
|         return 'friends'.tr(); |         return 'postVisibilityUnlisted'; | ||||||
|       case 3: |       case 3: | ||||||
|         return 'selected'.tr(); |         return 'postVisibilityPrivate'; | ||||||
|       case 4: |  | ||||||
|         return 'private'.tr(); |  | ||||||
|       default: |       default: | ||||||
|         return 'unknown'.tr(); |         return 'postVisibilityPublic'; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -314,6 +314,19 @@ class PostItem extends HookConsumerWidget { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     String _parseVisibility(int visibility) { | ||||||
|  |       switch (visibility) { | ||||||
|  |         case 1: | ||||||
|  |           return 'postVisibilityFriends'; | ||||||
|  |         case 2: | ||||||
|  |           return 'postVisibilityUnlisted'; | ||||||
|  |         case 3: | ||||||
|  |           return 'postVisibilityPrivate'; | ||||||
|  |         default: | ||||||
|  |           return 'postVisibilityPublic'; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     return Column( |     return Column( | ||||||
|       mainAxisSize: MainAxisSize.min, |       mainAxisSize: MainAxisSize.min, | ||||||
|       crossAxisAlignment: CrossAxisAlignment.start, |       crossAxisAlignment: CrossAxisAlignment.start, | ||||||
| @@ -349,13 +362,29 @@ class PostItem extends HookConsumerWidget { | |||||||
|                       Text('@${item.publisher.name}').fontSize(11), |                       Text('@${item.publisher.name}').fontSize(11), | ||||||
|                     ], |                     ], | ||||||
|                   ), |                   ), | ||||||
|                   Text( |                   Row( | ||||||
|                     isFullPost |                     spacing: 6, | ||||||
|                         ? (item.publishedAt ?? item.createdAt)!.formatSystem() |                     crossAxisAlignment: CrossAxisAlignment.end, | ||||||
|                         : (item.publishedAt ?? item.createdAt)!.formatRelative( |                     children: [ | ||||||
|                           context, |                       Text( | ||||||
|                         ), |                         isFullPost | ||||||
|                   ).fontSize(10), |                             ? (item.publishedAt ?? item.createdAt)! | ||||||
|  |                                 .formatSystem() | ||||||
|  |                             : (item.publishedAt ?? item.createdAt)! | ||||||
|  |                                 .formatRelative(context), | ||||||
|  |                       ).fontSize(10), | ||||||
|  |                       if (item.editedAt != null) | ||||||
|  |                         Text( | ||||||
|  |                           'editedAt'.tr(args: [item.editedAt!.formatSystem()]), | ||||||
|  |                           style: TextStyle(height: 1.2), | ||||||
|  |                         ).fontSize(10), | ||||||
|  |                       if (item.visibility != 0) | ||||||
|  |                         Text( | ||||||
|  |                           _parseVisibility(item.visibility).tr(), | ||||||
|  |                           style: TextStyle(height: 1.45), | ||||||
|  |                         ).fontSize(10), | ||||||
|  |                     ], | ||||||
|  |                   ), | ||||||
|                 ], |                 ], | ||||||
|               ), |               ), | ||||||
|             ), |             ), | ||||||
| @@ -781,10 +810,14 @@ class PostReplyPreview extends HookConsumerWidget { | |||||||
|           '/sphere/posts/${parent.id}/replies', |           '/sphere/posts/${parent.id}/replies', | ||||||
|           queryParameters: {'offset': posts.value.length, 'take': pageSize}, |           queryParameters: {'offset': posts.value.length, 'take': pageSize}, | ||||||
|         ); |         ); | ||||||
|         posts.value = [ |         try { | ||||||
|           ...posts.value, |           posts.value = [ | ||||||
|           ...response.data.map((e) => SnPost.fromJson(e)), |             ...posts.value, | ||||||
|         ]; |             ...response.data.map((e) => SnPost.fromJson(e)), | ||||||
|  |           ]; | ||||||
|  |         } catch (_) { | ||||||
|  |           // ignore disposed | ||||||
|  |         } | ||||||
|       } catch (err) { |       } catch (err) { | ||||||
|         showErrorAlert(err); |         showErrorAlert(err); | ||||||
|       } finally { |       } finally { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user