Skip to content
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

feat: update contact screen #252

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
24 changes: 20 additions & 4 deletions lib/screens/contact_new_version/contact_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:atsign_atmosphere_pro/screens/contact_new_version/contact_detail
import 'package:atsign_atmosphere_pro/screens/contact_new_version/group_contact_screen.dart';
import 'package:atsign_atmosphere_pro/screens/contact_new_version/trusted_contact_screen.dart';
import 'package:atsign_atmosphere_pro/utils/colors.dart';
import 'package:atsign_atmosphere_pro/utils/images.dart';
import 'package:atsign_atmosphere_pro/utils/vectors.dart';
import 'package:atsign_atmosphere_pro/view_models/trusted_sender_view_model.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -61,7 +62,21 @@ class _ContactScreenState extends State<ContactScreen> {
),
),
),
body: buildBody(),
body: Stack(
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
ImageConstants.welcomeBackground,
),
fit: BoxFit.fill,
),
),
),
buildBody(),
],
),
);
}

Expand Down Expand Up @@ -126,7 +141,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 +152,9 @@ class _ContactScreenState extends State<ContactScreen> {
);
},
);

reloadPage();
if (result != false) {
reloadPage();
}
},
),
),
Expand Down
17 changes: 16 additions & 1 deletion lib/screens/history/transfer_history_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:atsign_atmosphere_pro/screens/history/widgets/filter_item_widget
import 'package:atsign_atmosphere_pro/utils/app_utils.dart';
import 'package:atsign_atmosphere_pro/utils/colors.dart';
import 'package:atsign_atmosphere_pro/utils/constants.dart';
import 'package:atsign_atmosphere_pro/utils/images.dart';
import 'package:atsign_atmosphere_pro/utils/vectors.dart';
import 'package:atsign_atmosphere_pro/view_models/history_provider.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -53,7 +54,21 @@ class _TransferHistoryScreenState extends State<TransferHistoryScreen> {
height: 130,
title: "Transfer History",
),
body: buildBody(),
body: Stack(
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
ImageConstants.welcomeBackground,
),
fit: BoxFit.fill,
),
),
),
buildBody(),
],
),
);
}

Expand Down
Loading