Skip to content

Commit

Permalink
feat: update contact screen
Browse files Browse the repository at this point in the history
  • Loading branch information
sonle-geekyants committed Feb 15, 2023
1 parent 34ad937 commit 29c61ac
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 413 deletions.
10 changes: 5 additions & 5 deletions lib/screens/contact_new_version/add_contact_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ class _AddContactScreenState extends State<AddContactScreen> {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text(
"atSign verified",
"atSign valid",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Color(0xffCACACA),
),
),
const SizedBox(width: 10),
Expand Down Expand Up @@ -181,7 +180,9 @@ class _AddContactScreenState extends State<AddContactScreen> {
height: 60,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.black,
color: !state.isVerify
? ColorConstants.buttonGrey
: Colors.black,
borderRadius: BorderRadius.circular(8),
),
child: const Center(
Expand All @@ -208,8 +209,7 @@ class _AddContactScreenState extends State<AddContactScreen> {
}

void _checkValid() {
if (atSignController.text.isNotEmpty &&
nicknameController.text.isNotEmpty) {
if (atSignController.text.isNotEmpty) {
addContactProvider.changeVerifyStatus(true);
} else {
addContactProvider.changeVerifyStatus(false);
Expand Down
76 changes: 46 additions & 30 deletions lib/screens/contact_new_version/contact_detail_screen.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:at_contact/at_contact.dart';
import 'package:at_contacts_flutter/services/contact_service.dart';
import 'package:at_contacts_group_flutter/models/group_contacts_model.dart';
import 'package:atsign_atmosphere_pro/screens/common_widgets/avatar_widget.dart';
import 'package:atsign_atmosphere_pro/screens/common_widgets/card_widget.dart';
import 'package:atsign_atmosphere_pro/utils/colors.dart';
import 'package:atsign_atmosphere_pro/utils/vectors.dart';
import 'package:atsign_atmosphere_pro/view_models/trusted_sender_view_model.dart';
import 'package:atsign_atmosphere_pro/view_models/welcome_screen_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

Expand All @@ -23,12 +25,14 @@ class ContactDetailScreen extends StatefulWidget {
class _ContactDetailScreenState extends State<ContactDetailScreen> {
late TrustedContactProvider _trustedContactProvider;
late ContactService _contactService;
late WelcomeScreenProvider _welcomeScreenProvider;

bool isTrusted = false;

@override
void initState() {
_trustedContactProvider = TrustedContactProvider();
_welcomeScreenProvider = WelcomeScreenProvider();
_contactService = ContactService();
checkTrustedContact();
super.initState();
Expand Down Expand Up @@ -158,36 +162,48 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
height: 63,
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[
Color(0xfff05e3f),
Color(0xffeaa743),
],
InkWell(
onTap: () {
Navigator.of(context).pop(false);
_welcomeScreenProvider.selectedContacts = [
GroupContactsModel(
contactType: ContactsType.CONTACT,
contact: widget.contact,
),
];
_welcomeScreenProvider.changeBottomNavigationIndex(0);
},
child: Container(
height: 63,
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[
ColorConstants.orangeColor,
ColorConstants.yellow,
],
),
borderRadius: BorderRadius.circular(10),
),
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text(
"Transfer Now",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
color: Colors.white,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text(
"Transfer Now",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
),
const SizedBox(width: 24),
SvgPicture.asset(
AppVectors.icArrow,
),
],
const SizedBox(width: 24),
SvgPicture.asset(
AppVectors.icArrow,
),
],
),
),
),
),
Expand Down Expand Up @@ -231,7 +247,7 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
await _contactService.deleteAtSign(
atSign: widget.contact.atSign!,
);
Navigator.of(context).pop(true);
Navigator.of(context).pop();
},
),
const SizedBox(height: 25),
Expand All @@ -243,7 +259,7 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
contact: widget.contact,
blockAction: true,
);
Navigator.of(context).pop(true);
Navigator.of(context).pop();
},
),
const SizedBox(height: 25),
Expand Down
7 changes: 4 additions & 3 deletions lib/screens/contact_new_version/contact_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class _ContactScreenState extends State<ContactScreen> {
child: ListContactScreen(
contactsTrusted: trustedProvider.trustedContacts,
onTapContact: (contact) async {
await showModalBottomSheet<bool?>(
final result = await showModalBottomSheet<bool?>(
context: context,
isScrollControlled: true,
useRootNavigator: true,
Expand All @@ -137,8 +137,9 @@ class _ContactScreenState extends State<ContactScreen> {
);
},
);

reloadPage();
if (result != false) {
reloadPage();
}
},
),
),
Expand Down
Loading

0 comments on commit 29c61ac

Please sign in to comment.