From 5594bd6ba7f7ed1f6e840dbe1607ac6563d16bfb Mon Sep 17 00:00:00 2001 From: Linloir <3145078758@qq.com> Date: Sun, 23 Oct 2022 10:32:46 +0800 Subject: [PATCH] Improvements: - Improve display paddings, sizes & experiences on remote platforms --- lib/chat/chat_page.dart | 4 +- lib/chat/cubit/chat_cubit.dart | 2 +- lib/chat/view/common/file_box.dart | 25 ++++--- lib/chat/view/common/image_box.dart | 4 +- lib/chat/view/common/text_box.dart | 23 ++++--- lib/chat/view/history_tile.dart | 6 +- lib/chat/view/in_message_box.dart | 68 +++++++++---------- lib/chat/view/input_box/input_box.dart | 12 ++-- lib/chat/view/out_message_box.dart | 68 +++++++++---------- .../view/message_page/view/message_tile.dart | 6 +- lib/login/login_page.dart | 4 +- lib/login/view/login_form.dart | 18 ++++- lib/main.dart | 4 +- lib/register/register_page.dart | 4 +- lib/register/view/register_form.dart | 18 ++++- lib/search/search_page.dart | 8 +-- lib/search/view/history_tile.dart | 10 +-- lib/search/view/user_tile.dart | 6 +- 18 files changed, 163 insertions(+), 127 deletions(-) diff --git a/lib/chat/chat_page.dart b/lib/chat/chat_page.dart index d247041..5f0e723 100644 --- a/lib/chat/chat_page.dart +++ b/lib/chat/chat_page.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 14:03:16 - * @LastEditTime : 2022-10-20 10:52:30 + * @LastEditTime : 2022-10-22 21:30:04 * @Description : */ @@ -88,7 +88,7 @@ class ChatPage extends StatelessWidget { //Return history tile return Padding( padding: const EdgeInsets.symmetric( - horizontal: 24, + horizontal: 16, vertical: 8 ), child: HistoryTile( diff --git a/lib/chat/cubit/chat_cubit.dart b/lib/chat/cubit/chat_cubit.dart index b10d666..def71ff 100644 --- a/lib/chat/cubit/chat_cubit.dart +++ b/lib/chat/cubit/chat_cubit.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 14:03:56 - * @LastEditTime : 2022-10-20 11:04:40 + * @LastEditTime : 2022-10-22 22:46:18 * @Description : */ diff --git a/lib/chat/view/common/file_box.dart b/lib/chat/view/common/file_box.dart index 18dc34d..87bbfaf 100644 --- a/lib/chat/view/common/file_box.dart +++ b/lib/chat/view/common/file_box.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-14 17:07:13 - * @LastEditTime : 2022-10-18 15:44:34 + * @LastEditTime : 2022-10-22 23:31:19 * @Description : */ @@ -35,7 +35,10 @@ class FileBox extends StatelessWidget { ); }, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric( + horizontal: 0.0, + vertical: 6.0 + ), child: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -43,38 +46,38 @@ class FileBox extends StatelessWidget { child: history.status == ChatHistoryStatus.none || history.status == ChatHistoryStatus.done ? Icon( Icons.file_present_rounded, - size: 24, + size: 20, color: history.type == ChatHistoryType.income ? Colors.blue[800] : Colors.white.withOpacity(0.8), ) : history.status == ChatHistoryStatus.failed ? Icon( Icons.refresh_rounded, - size: 24, + size: 20, color: history.type == ChatHistoryType.income ? Colors.red[800] : Colors.white.withOpacity(0.8), ) : history.status == ChatHistoryStatus.processing ? SizedBox( - height: 18.0, - width: 18.0, + height: 16.0, + width: 16.0, child: LoadingIndicator( indicatorType: Indicator.ballPulseSync, colors: [Colors.white.withOpacity(0.8)], ), ) : SizedBox( - height: 18.0, - width: 18.0, + height: 16.0, + width: 16.0, child: CircularProgressIndicator( color: history.type == ChatHistoryType.income ? Colors.blue[800] : Colors.white.withOpacity(0.8), - strokeWidth: 3, + strokeWidth: 2.5, ), ) ), - const SizedBox(width: 18.0,), + const SizedBox(width: 16.0,), Flexible( child: Text( history.message.contentDecoded, softWrap: true, style: TextStyle( - fontSize: 20.0, + fontSize: 16.0, color: history.type == ChatHistoryType.income ? Colors.grey[900] : Colors.white ), ), diff --git a/lib/chat/view/common/image_box.dart b/lib/chat/view/common/image_box.dart index 7ff9618..7b253d4 100644 --- a/lib/chat/view/common/image_box.dart +++ b/lib/chat/view/common/image_box.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-14 17:04:20 - * @LastEditTime : 2022-10-20 13:47:29 + * @LastEditTime : 2022-10-22 23:05:24 * @Description : */ @@ -25,7 +25,7 @@ class ImageBox extends StatelessWidget { child: Stack( children: [ Container( - constraints: const BoxConstraints(maxWidth: 500, maxHeight: 200), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 150), child: history.preCachedImage ?? Image.memory(base64Decode(history.message.contentDecoded)), ), Material( diff --git a/lib/chat/view/common/text_box.dart b/lib/chat/view/common/text_box.dart index ebb52fc..f9cd767 100644 --- a/lib/chat/view/common/text_box.dart +++ b/lib/chat/view/common/text_box.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-14 17:04:12 - * @LastEditTime : 2022-10-15 10:53:28 + * @LastEditTime : 2022-10-22 23:06:38 * @Description : */ @@ -25,7 +25,10 @@ class TextBox extends StatelessWidget { return InkWell( onTap: (){}, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric( + horizontal: 0.0, + vertical: 6.0 + ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.min, @@ -35,14 +38,14 @@ class TextBox extends StatelessWidget { if(history.status == ChatHistoryStatus.sending) ...[ SizedBox( - height: 15.0, - width: 15.0, + height: 12.0, + width: 12.0, child: CircularProgressIndicator( color: Colors.white.withOpacity(0.5), strokeWidth: 2.0, ), ), - const SizedBox(width: 16.0,), + const SizedBox(width: 12.0,), ], if(history.status == ChatHistoryStatus.failed) ...[ @@ -53,7 +56,7 @@ class TextBox extends StatelessWidget { child: Icon( Icons.error_rounded, color: Colors.white.withOpacity(0.5), - size: 20, + size: 18, ), onTap: () async { context.read().tcpRepository.pushRequest(SendMessageRequest( @@ -64,16 +67,16 @@ class TextBox extends StatelessWidget { ), ), ), - const SizedBox(width: 8.0,), + const SizedBox(width: 6.0,), ], if(history.status == ChatHistoryStatus.done) ...[ Icon( Icons.check_rounded, color: Colors.white.withOpacity(0.5), - size: 20, + size: 18, ), - const SizedBox(width: 12.0,), + const SizedBox(width: 8.0,), ], ], Flexible( @@ -81,7 +84,7 @@ class TextBox extends StatelessWidget { history.message.contentDecoded, softWrap: true, style: TextStyle( - fontSize: 18, + fontSize: 16, color: history.type == ChatHistoryType.income ? Colors.grey[900] : Colors.white ), ), diff --git a/lib/chat/view/history_tile.dart b/lib/chat/view/history_tile.dart index 8ac3554..3472052 100644 --- a/lib/chat/view/history_tile.dart +++ b/lib/chat/view/history_tile.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 14:03:45 - * @LastEditTime : 2022-10-15 10:52:30 + * @LastEditTime : 2022-10-22 21:30:26 * @Description : */ @@ -34,7 +34,7 @@ class HistoryTile extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ - UserAvatar(userid: history.message.senderID), + UserAvatar(userid: history.message.senderID, size: 42,), const SizedBox(width: 16.0,), Flexible( child: InMessageBox(history: history) @@ -58,7 +58,7 @@ class HistoryTile extends StatelessWidget { child: OutMessageBox(history: history), ), const SizedBox(width: 16.0,), - UserAvatar(userid: history.message.senderID), + UserAvatar(userid: history.message.senderID, size: 42,), ], ) ), diff --git a/lib/chat/view/in_message_box.dart b/lib/chat/view/in_message_box.dart index 334b936..5cef6cd 100644 --- a/lib/chat/view/in_message_box.dart +++ b/lib/chat/view/in_message_box.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-14 13:49:47 - * @LastEditTime : 2022-10-20 13:56:20 + * @LastEditTime : 2022-10-23 10:07:48 * @Description : */ @@ -42,37 +42,37 @@ class InMessageBox extends StatelessWidget { ), boxShadow: [BoxShadow(blurRadius: 5.0, color: Colors.grey.withOpacity(0.3))] ), - child: ClipRRect( - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(8.0), - topRight: Radius.circular(8.0), - bottomLeft: Radius.zero, - bottomRight: Radius.circular(8.0) - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - if(history.message.type == MessageType.file) - FileBox(history: history), - if(history.message.type == MessageType.image) - ImageBox(history: history), - if(history.message.type == MessageType.plaintext) - TextBox(history: history), - if(history.message.type != MessageType.image) - ...[ - const SizedBox(height: 4.0,), - Text( - _getTimeStamp(history.message.timeStamp), - style: TextStyle( - fontSize: 12, - color: Colors.grey[400], - ), - ) - ] - ], - ), - ) + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if(history.message.type == MessageType.file) + FileBox(history: history), + if(history.message.type == MessageType.image) + ClipRRect( + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(8.0), + topRight: Radius.circular(8.0), + bottomLeft: Radius.zero, + bottomRight: Radius.circular(8.0) + ), + child: ImageBox(history: history), + ), + if(history.message.type == MessageType.plaintext) + TextBox(history: history), + if(history.message.type != MessageType.image) + ...[ + const SizedBox(height: 4.0,), + Text( + _getTimeStamp(history.message.timeStamp), + style: TextStyle( + fontSize: 12, + color: Colors.grey[400], + ), + ) + ] + ], + ), ), if(history.message.type == MessageType.image) ...[ @@ -96,9 +96,9 @@ class InMessageBox extends StatelessWidget { if(date.day == DateTime.now().day) { return '${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } - //If date is yesterday, return 'yesterday' + //If date is yda, return 'yda' if(date.day == DateTime.now().day - 1) { - return 'yesterday ${date.hour}:${date.minute.toString().padLeft(2, '0')}'; + return 'yda ${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } //If date is within this week, return the weekday in english if(date.weekday < DateTime.now().weekday) { diff --git a/lib/chat/view/input_box/input_box.dart b/lib/chat/view/input_box/input_box.dart index 5c09050..3e62218 100644 --- a/lib/chat/view/input_box/input_box.dart +++ b/lib/chat/view/input_box/input_box.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-14 17:54:30 - * @LastEditTime : 2022-10-20 11:18:48 + * @LastEditTime : 2022-10-23 10:13:22 * @Description : */ @@ -34,7 +34,12 @@ class InputBox extends StatelessWidget { ), child: Container( // height: 64, - padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), + padding: const EdgeInsets.only( + left: 16.0, + right: 4.0, + top: 16.0, + bottom: 16.0 + ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -79,7 +84,6 @@ class InputBox extends StatelessWidget { ), ), ), - const SizedBox(width: 8.0,), IconButton( onPressed: () { var chatCubit = context.read(); @@ -98,7 +102,6 @@ class InputBox extends StatelessWidget { }, icon: Icon(Icons.attach_file_rounded, color: Colors.grey[700],) ), - const SizedBox(width: 8.0,), IconButton( onPressed: () { var chatCubit = context.read(); @@ -116,7 +119,6 @@ class InputBox extends StatelessWidget { }, icon: Icon(Icons.photo_rounded, color: Colors.grey[700],) ), - const SizedBox(width: 8.0,), BlocBuilder( builder:(context, state) { return IconButton( diff --git a/lib/chat/view/out_message_box.dart b/lib/chat/view/out_message_box.dart index 937a240..fb91095 100644 --- a/lib/chat/view/out_message_box.dart +++ b/lib/chat/view/out_message_box.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-14 13:49:28 - * @LastEditTime : 2022-10-19 23:47:20 + * @LastEditTime : 2022-10-23 10:07:32 * @Description : */ @@ -42,37 +42,37 @@ class OutMessageBox extends StatelessWidget { ), boxShadow: [BoxShadow(blurRadius: 5.0, color: Colors.grey.withOpacity(0.2))] ), - child: ClipRRect( - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(8.0), - topRight: Radius.circular(8.0), - bottomLeft: Radius.circular(8.0), - bottomRight: Radius.zero - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisSize: MainAxisSize.min, - children: [ - if(history.message.type == MessageType.file) - FileBox(history: history), - if(history.message.type == MessageType.image) - ImageBox(history: history), - if(history.message.type == MessageType.plaintext) - TextBox(history: history), - if(history.message.type != MessageType.image) - ...[ - const SizedBox(height: 4.0,), - Text( - _getTimeStamp(history.message.timeStamp), - style: TextStyle( - fontSize: 12, - color: Colors.grey[200], - ), - ) - ], - ], - ), - ) + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.min, + children: [ + if(history.message.type == MessageType.file) + FileBox(history: history), + if(history.message.type == MessageType.image) + ClipRRect( + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(8.0), + topRight: Radius.circular(8.0), + bottomLeft: Radius.circular(8.0), + bottomRight: Radius.zero + ), + child: ImageBox(history: history), + ), + if(history.message.type == MessageType.plaintext) + TextBox(history: history), + if(history.message.type != MessageType.image) + ...[ + const SizedBox(height: 4.0,), + Text( + _getTimeStamp(history.message.timeStamp), + style: TextStyle( + fontSize: 12, + color: Colors.grey[200], + ), + ) + ], + ], + ), ), if(history.message.type == MessageType.image) ...[ @@ -96,9 +96,9 @@ class OutMessageBox extends StatelessWidget { if(date.day == DateTime.now().day) { return '${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } - //If date is yesterday, return 'yesterday' + //If date is yda, return 'yda' if(date.day == DateTime.now().day - 1) { - return 'yesterday ${date.hour}:${date.minute.toString().padLeft(2, '0')}'; + return 'yda ${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } //If date is within this week, return the weekday in english if(date.weekday < DateTime.now().weekday) { diff --git a/lib/home/view/message_page/view/message_tile.dart b/lib/home/view/message_page/view/message_tile.dart index 73e58a1..12b331c 100644 --- a/lib/home/view/message_page/view/message_tile.dart +++ b/lib/home/view/message_page/view/message_tile.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 13:17:52 - * @LastEditTime : 2022-10-20 00:52:14 + * @LastEditTime : 2022-10-23 10:09:09 * @Description : */ @@ -150,9 +150,9 @@ class MessageTile extends StatelessWidget { if(date.day == DateTime.now().day) { return '${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } - //If date is yesterday, return 'yesterday' + //If date is yda, return 'yda' if(date.day == DateTime.now().day - 1) { - return 'yesterday'; + return 'yda ${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } //If date is within this week, return the weekday in english if(date.weekday < DateTime.now().weekday) { diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index abb266d..91b1cca 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-12 15:06:30 - * @LastEditTime : 2022-10-20 20:55:07 + * @LastEditTime : 2022-10-23 10:15:11 * @Description : */ @@ -81,7 +81,7 @@ class LoginPage extends StatelessWidget { Expanded( flex: 6, child: SizedBox( - width: MediaQuery.of(context).size.width * 0.5, + width: MediaQuery.of(context).size.width * 0.7, child: const LoginPanel() ) ), diff --git a/lib/login/view/login_form.dart b/lib/login/view/login_form.dart index 69470d4..285b5b7 100644 --- a/lib/login/view/login_form.dart +++ b/lib/login/view/login_form.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-12 16:29:25 - * @LastEditTime : 2022-10-20 20:43:51 + * @LastEditTime : 2022-10-23 10:28:05 * @Description : */ @@ -44,6 +44,11 @@ class UsernameInput extends StatelessWidget { onChanged: (username) { context.read().onUsernameChange(Username.dirty(username)); }, + textInputAction: TextInputAction.next, + textCapitalization: TextCapitalization.none, + autocorrect: false, + enableIMEPersonalizedLearning: false, + enableSuggestions: false, decoration: InputDecoration( labelText: 'Username', errorText: state.username.invalid ? 'Invalid username' : null @@ -60,12 +65,21 @@ class PasswordInput extends StatelessWidget { @override Widget build(BuildContext context) { return BlocBuilder( - buildWhen: (previous, current) => previous.password != current.password, + buildWhen: (previous, current) => previous.password != current.password || previous.status != current.status, builder: (context, state) { return TextField( onChanged: (password) { context.read().onPasswordChange(Password.dirty(password)); }, + onEditingComplete: () { + if( + state.status == FormzStatus.valid || + state.status == FormzStatus.submissionFailure + ) { + context.read().onSubmission(); + } + }, + textInputAction: TextInputAction.done, obscureText: true, decoration: InputDecoration( labelText: 'Password', diff --git a/lib/main.dart b/lib/main.dart index fbaee2f..de26e9d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-10 08:04:53 - * @LastEditTime : 2022-10-22 20:43:39 + * @LastEditTime : 2022-10-23 10:32:16 * @Description : */ import 'package:flutter/gestures.dart'; @@ -49,7 +49,7 @@ class SplashPage extends StatelessWidget { return BlocProvider( create: (context) { return InitializationCubit( - serverAddress: '192.168.43.155', + serverAddress: '127.0.0.1', serverPort: 20706 ); }, diff --git a/lib/register/register_page.dart b/lib/register/register_page.dart index a2d9c2e..077300a 100644 --- a/lib/register/register_page.dart +++ b/lib/register/register_page.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-12 17:36:38 - * @LastEditTime : 2022-10-20 20:55:17 + * @LastEditTime : 2022-10-23 10:15:31 * @Description : */ /* @@ -82,7 +82,7 @@ class RegisterPage extends StatelessWidget { listenWhen: (previous, current) => previous.status != current.status, child: Center( child: SizedBox( - width: MediaQuery.of(context).size.width * 0.5, + width: MediaQuery.of(context).size.width * 0.7, child: Column( mainAxisSize: MainAxisSize.max, children: [ diff --git a/lib/register/view/register_form.dart b/lib/register/view/register_form.dart index e73c27f..92f9cc8 100644 --- a/lib/register/view/register_form.dart +++ b/lib/register/view/register_form.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-12 16:29:25 - * @LastEditTime : 2022-10-20 20:54:22 + * @LastEditTime : 2022-10-23 10:28:12 * @Description : */ @@ -44,6 +44,11 @@ class UsernameInput extends StatelessWidget { onChanged: (username) { context.read().onUsernameChange(Username.dirty(username)); }, + textInputAction: TextInputAction.next, + textCapitalization: TextCapitalization.none, + autocorrect: false, + enableIMEPersonalizedLearning: false, + enableSuggestions: false, decoration: InputDecoration( labelText: 'Username', errorText: state.username.invalid ? 'Invalid username' : null @@ -60,12 +65,21 @@ class PasswordInput extends StatelessWidget { @override Widget build(BuildContext context) { return BlocBuilder( - buildWhen: (previous, current) => previous.password != current.password, + buildWhen: (previous, current) => previous.password != current.password || previous.status != current.status, builder: (context, state) { return TextField( onChanged: (password) { context.read().onPasswordChange(Password.dirty(password)); }, + onEditingComplete: () { + if( + state.status == FormzStatus.valid || + state.status == FormzStatus.submissionFailure + ) { + context.read().onSubmission(); + } + }, + textInputAction: TextInputAction.done, obscureText: true, decoration: InputDecoration( labelText: 'Password', diff --git a/lib/search/search_page.dart b/lib/search/search_page.dart index 75e38fa..7fd58d3 100644 --- a/lib/search/search_page.dart +++ b/lib/search/search_page.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 17:04:12 - * @LastEditTime : 2022-10-14 10:38:44 + * @LastEditTime : 2022-10-23 10:30:41 * @Description : */ @@ -61,7 +61,7 @@ class SearchPage extends StatelessWidget { const SizedBox(height: 16.0,), const Padding( padding: EdgeInsets.symmetric( - horizontal: 36.0, + horizontal: 24.0, vertical: 8.0 ), child: Text( @@ -80,7 +80,7 @@ class SearchPage extends StatelessWidget { const SizedBox(height: 16.0,), const Padding( padding: EdgeInsets.symmetric( - horizontal: 36.0, + horizontal: 24.0, vertical: 8.0 ), child: Text( @@ -102,7 +102,7 @@ class SearchPage extends StatelessWidget { const SizedBox(height: 16.0,), const Padding( padding: EdgeInsets.symmetric( - horizontal: 36.0, + horizontal: 24.0, vertical: 8.0 ), child: Text( diff --git a/lib/search/view/history_tile.dart b/lib/search/view/history_tile.dart index 174acf9..11cfb21 100644 --- a/lib/search/view/history_tile.dart +++ b/lib/search/view/history_tile.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 21:41:49 - * @LastEditTime : 2022-10-17 22:23:46 + * @LastEditTime : 2022-10-23 10:30:06 * @Description : */ @@ -24,8 +24,8 @@ class HistoryTile extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric( - vertical: 16.0, - horizontal: 36.0 + vertical: 8.0, + horizontal: 24.0 ), child: IntrinsicHeight( child: Row( @@ -87,9 +87,9 @@ class HistoryTile extends StatelessWidget { if(date.day == DateTime.now().day) { return '${date.hour}:${date.minute}'; } - //If date is yesterday, return 'yesterday' + //If date is yda, return 'yda' if(date.day == DateTime.now().day - 1) { - return 'yesterday'; + return 'yda ${date.hour}:${date.minute.toString().padLeft(2, '0')}'; } //If date is within this week, return the weekday in english if(date.weekday < DateTime.now().weekday) { diff --git a/lib/search/view/user_tile.dart b/lib/search/view/user_tile.dart index 5a9dd92..8ec1027 100644 --- a/lib/search/view/user_tile.dart +++ b/lib/search/view/user_tile.dart @@ -1,7 +1,7 @@ /* * @Author : Linloir * @Date : 2022-10-13 21:41:41 - * @LastEditTime : 2022-10-18 11:28:17 + * @LastEditTime : 2022-10-23 10:30:24 * @Description : */ @@ -35,8 +35,8 @@ class UserTile extends StatelessWidget { }, child: Padding( padding: const EdgeInsets.symmetric( - horizontal: 36, - vertical: 16, + horizontal: 24, + vertical: 8, ), child: Row( children: [