Skip to content

Commit

Permalink
TW-1830 changed text when user has no contacts (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaledNjim authored Jun 18, 2024
1 parent f6fbbc0 commit e136975
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 40 deletions.
3 changes: 2 additions & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3068,5 +3068,6 @@
"switchAccounts": "Switch accounts",
"selectAccount": "Select account",
"privacyPolicy": "Privacy Policy",
"byContinuingYourAgreeingToOur": "By continuing, you're agreeing to our"
"byContinuingYourAgreeingToOur": "By continuing, you're agreeing to our",
"youDontHaveAnyContactsYet": "You dont have any contacts yet."
}
97 changes: 58 additions & 39 deletions lib/pages/new_private_chat/widget/no_contacts_found.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,68 @@ class NoContactsFound extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (keyword != null)
Text(
L10n.of(context)!.noResultForKeyword(keyword!),
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(
height: 8.0,
),
Text.rich(
TextSpan(
style: Theme.of(context).textTheme.bodyMedium,
return keyword != null
? Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextSpan(
children: [
TextSpan(text: L10n.of(context)!.searchResultNotFound1),
TextSpan(text: L10n.of(context)!.searchResultNotFound2),
TextSpan(text: L10n.of(context)!.searchResultNotFound3),
TextSpan(text: L10n.of(context)!.searchResultNotFound4),
TextSpan(
text: L10n.of(context)!.searchResultNotFound5,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.primary,
Text(
L10n.of(context)!.noResultForKeyword(keyword!),
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(
height: 8.0,
),
Text.rich(
TextSpan(
style: Theme.of(context).textTheme.bodyMedium,
children: [
TextSpan(
children: [
TextSpan(
text: L10n.of(context)!.searchResultNotFound1,
),
TextSpan(
text: L10n.of(context)!.searchResultNotFound2,
),
TextSpan(
text: L10n.of(context)!.searchResultNotFound3,
),
),
],
TextSpan(
text: L10n.of(context)!.searchResultNotFound4,
),
TextSpan(
text: L10n.of(context)!.searchResultNotFound5,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(
color: Theme.of(context).colorScheme.primary,
),
),
],
),
],
),
),
const SizedBox(
height: 8.0,
),
const Align(
alignment: Alignment.center,
child: EmptySearchWidget(),
),
],
),
),
const SizedBox(
height: 8.0,
),
const Align(
alignment: Alignment.center,
child: EmptySearchWidget(),
),
],
),
);
)
: SizedBox(
height: MediaQuery.sizeOf(context).height * 0.7,
child: Align(
child: Text(
L10n.of(context)!.youDontHaveAnyContactsYet,
),
),
);
}
}

0 comments on commit e136975

Please sign in to comment.