-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]TW-2042 Update contacts screen ui #2057
Open
KhaledNjim
wants to merge
6
commits into
main
Choose a base branch
from
TW-2042_update_contacts_ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+271
−154
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
77b5dfb
TW-2042 Update contacts appBar for mobile
KhaledNjim edbc7f7
TW-2042 Update contacts app bar for web
KhaledNjim b8c2f51
TW-2042 added invite freind button
KhaledNjim 99f30bc
TW-2042 Update contact list item
KhaledNjim 6561b83
fixup! TW-2042 Update contact list item
KhaledNjim ccaeee3
TW-2042 refactor to use system design items
KhaledNjim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,40 @@ | ||
import 'package:fluffychat/di/global/get_it_initializer.dart'; | ||
import 'package:fluffychat/utils/responsive/responsive_utils.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class ContactsAppbarStyle { | ||
static ResponsiveUtils responsiveUtils = getIt.get<ResponsiveUtils>(); | ||
static const Size preferredSizeAppBar = Size.fromHeight(120); | ||
|
||
static const double iconSize = 24.0; | ||
|
||
static const double textFieldHeight = 64.0; | ||
static const double textFieldHeight = 56.0; | ||
|
||
static const double toolbarHeight = 56.0; | ||
|
||
static const double leadingWidth = 76.0; | ||
|
||
static const double textFieldBorderRadius = 24.0; | ||
|
||
static AlignmentGeometry alignment = AlignmentDirectional.centerStart; | ||
static AlignmentGeometry alignmentTitle(context) => | ||
ResponsiveUtils().isMobile(context) | ||
? Alignment.center | ||
: AlignmentDirectional.centerStart; | ||
|
||
static EdgeInsetsDirectional appbarPadding = | ||
const EdgeInsetsDirectional.symmetric( | ||
horizontal: 16.0, | ||
); | ||
|
||
static EdgeInsetsDirectional contentPadding = EdgeInsetsDirectional.zero; | ||
static const double textStyleHeight = 24 / 17; | ||
static const EdgeInsets trailingIconPadding = EdgeInsets.only(right: 16.0); | ||
static EdgeInsets titlePadding(context) => EdgeInsets.only( | ||
left: ResponsiveUtils().isMobile(context) ? 0 : 16.0, | ||
); | ||
static const EdgeInsets searchFieldPadding = EdgeInsets.only( | ||
left: 16.0, | ||
right: 16.0, | ||
bottom: 8.0, | ||
); | ||
static const trailingIconSize = 24.0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,19 @@ import 'package:fluffychat/presentation/model/contact/get_presentation_contacts_ | |
import 'package:fluffychat/presentation/model/contact/presentation_contact.dart'; | ||
import 'package:fluffychat/presentation/model/contact/presentation_contact_success.dart'; | ||
import 'package:fluffychat/presentation/model/search/presentation_search.dart'; | ||
import 'package:fluffychat/resource/image_paths.dart'; | ||
import 'package:fluffychat/utils/platform_infos.dart'; | ||
import 'package:fluffychat/widgets/contacts_warning_banner/contacts_warning_banner_view.dart'; | ||
import 'package:fluffychat/widgets/sliver_expandable_list.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/l10n.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:linagora_design_flutter/linagora_design_flutter.dart'; | ||
import 'package:matrix/matrix.dart'; | ||
|
||
class ContactsTabBodyView extends StatelessWidget { | ||
final ContactsTabController controller; | ||
final bool enableFriendsInvite = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it doesn't change use |
||
|
||
const ContactsTabBodyView( | ||
this.controller, { | ||
|
@@ -36,7 +39,7 @@ class ContactsTabBodyView extends StatelessWidget { | |
slivers: [ | ||
_SliverWarningBanner(controller: controller), | ||
_SliverPhonebookLoading(controller: controller), | ||
_SliverRecentContacts(controller: controller), | ||
if (enableFriendsInvite) const InviteFriendWidget(), | ||
_SliverContactsList(controller: controller), | ||
_SliverPhonebookList(controller: controller), | ||
const _SliverPadding(), | ||
|
@@ -347,6 +350,7 @@ class _SliverPhonebookLoading extends StatelessWidget { | |
} | ||
} | ||
|
||
// ignore: unused_element | ||
class _SliverRecentContacts extends StatelessWidget { | ||
final ContactsTabController controller; | ||
|
||
|
@@ -487,3 +491,59 @@ class _Contact extends StatelessWidget { | |
); | ||
} | ||
} | ||
|
||
class InviteFriendWidget extends StatelessWidget { | ||
const InviteFriendWidget({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SliverToBoxAdapter( | ||
child: Container( | ||
height: 64, | ||
decoration: BoxDecoration( | ||
border: Border( | ||
bottom: BorderSide( | ||
color: LinagoraStateLayer( | ||
LinagoraSysColors.material().surfaceTint, | ||
).opacityLayer3, | ||
), | ||
), | ||
), | ||
child: InkWell( | ||
child: Padding( | ||
padding: ContactsTabViewStyle.invitefriendContainterPadding, | ||
child: Row( | ||
children: [ | ||
Padding( | ||
padding: ContactsTabViewStyle | ||
.invitefriendContainterLeadingIconPadding, | ||
child: SvgPicture.asset( | ||
ImagePaths.icPersonCheck, | ||
width: ContactsTabViewStyle.leadingIconDimension, | ||
height: ContactsTabViewStyle.leadingIconDimension, | ||
colorFilter: ColorFilter.mode( | ||
Theme.of(context).primaryColor, | ||
BlendMode.srcIn, | ||
), | ||
), | ||
), | ||
Padding( | ||
padding: ContactsTabViewStyle.invitefriendTextPadding, | ||
child: Text( | ||
L10n.of(context)!.inviteFriend, | ||
style: Theme.of(context).textTheme.bodyLarge?.copyWith( | ||
fontSize: 17, | ||
color: LinagoraSysColors.material().primary, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is it? can you explain it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default height of the text( 17 is this case) will be multiplied by this, to make the height of the text 24