diff --git a/lib/Common/api_urls.dart b/lib/Common/api_urls.dart index aeb0699..cbc0a2b 100644 --- a/lib/Common/api_urls.dart +++ b/lib/Common/api_urls.dart @@ -33,4 +33,26 @@ class ApiUrls { static const storeDetailsOfOAuth = "${baseUrl}update-user-account-type"; static const getuserdetails = "${baseUrl}get-auth-user-data"; + + static const getfaqs = "${baseUrl}fetch-faqs"; + + static const getprivacypolicy = "${baseUrl}fetch-privacy-policy"; + + static const gettermsconditios = "${baseUrl}fetch-terms-and-condition"; + + static const postcontactus = "${baseUrl}contact-us"; + + static const postreportbug = "${baseUrl}bug-report"; + + static const getfollowers = "${baseUrl}fetch-followers"; + + static const getfollowing = "${baseUrl}fetch-following"; + + static const postblock = "${baseUrl}block-profile"; + + static const postunfollow = "${baseUrl}follow-user"; + + static const postremoveuser = "${baseUrl}remove-follower"; + + } diff --git a/lib/Common/controller/data/network/network_api.dart b/lib/Common/controller/data/network/network_api.dart index 225ff5c..dfee1ad 100644 --- a/lib/Common/controller/data/network/network_api.dart +++ b/lib/Common/controller/data/network/network_api.dart @@ -72,6 +72,9 @@ class NetworkApiServices { if (response.statusCode == 200) { return ResponseData("success", ResponseStatus.SUCCESS, data: response.data); + } else if (response.statusCode == 201) { + return ResponseData("success", ResponseStatus.SUCCESS, + data: response.data); } else if (response.statusCode == 404) { return ResponseData("error", ResponseStatus.ERROR, data: response.data); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart b/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart index 686fc05..19fcb62 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart @@ -1,11 +1,19 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class Followers extends StatefulWidget { const Followers({super.key}); @@ -15,43 +23,59 @@ class Followers extends StatefulWidget { } class _FollowersState extends State { - List followersData = [ - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwart", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Ahmad Rhiel Madsen", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Kaylynn Vaccaro", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Kianna Donin", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Maria Herwitz", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Ahmad Rhiel Madsen", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Kaylynn Vaccaro", - "subtitle": "Lorem ipsum dummy text", - }, - ]; + StreamController searchcontroller = StreamController(); + + @override + void initState() { + // TODO: implement initState + var updata = ""; + Profilegetmethod().getFollowers(updata, streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + int? blockid; + int? removeid; + + RemoveUploadata() async { + utils.loader(); + Map updata = { + "iam_principal_xid": removeid, + }; + final data = await Profilepostmethod().postRemoveuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + BlockUploadata() async { + utils.loader(); + Map updata = { + "blocked_iam_principal_xid": blockid, + }; + final data = await Profilepostmethod().postBlockuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } @override Widget build(BuildContext context) { @@ -64,13 +88,14 @@ class _FollowersState extends State { ), resizeToAvoidBottomInset: false, body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column(children: [ + ), + SingleChildScrollView( + child: Column(children: [ Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), @@ -86,125 +111,283 @@ class _FollowersState extends State { ), ), ), + texttype: TextInputType.text, + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + Profilegetmethod().getFollowers(value, + streamController: searchcontroller); + }, hintText: "Search people", ), ), sizedBoxHeight(25.h), - ListView.builder( - shrinkWrap: true, - itemCount: followersData.length, - itemBuilder: (context, index) { - return Column( - children: [ - followerWidget( - imagePath: followersData[index]["imagePath"], - title: followersData[index]["title"], - subtitle: followersData[index]["subtitle"]), - if (index != followersData.length - 1) commonDivider(), - ], - ); + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followersobj!.data!.isEmpty + ? _buildNoDataBody(context) + : + // ListView.builder( + // shrinkWrap: true, + // itemCount: followersobj!.data!.length, + // itemBuilder: (context, index) { + // return Column( + // children: [ + // followerWidget( + // imagePath: followersobj?.data?[index] + // .follower?.profilePhoto ?? + // "", + // // followersData[index]["imagePath"], + // title: followersobj?.data?[index].follower + // ?.fullName ?? + // "", + // // followersData[index]["title"], + // subtitle: followersobj?.data?[index] + // .follower?.userName ?? + // "", + // blockonTap: () { + // BlockUploadata(followersobj! + // .data![index].follower!.id); + // } + // // followersData[index]["subtitle"] + // ), + // if (index != followersobj!.data!.length - 1) + // commonDivider(), + // ], + // ); + // }, + // ); + + ListView.separated( + physics: ScrollPhysics(), + shrinkWrap: true, + itemCount: followersobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + return Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + followersobj!.data![index].follower! + .profilePhoto == + null || + followersobj! + .data![index] + .follower! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + followersobj! + .data![index] + .follower! + .profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + followersobj!.data![index].follower! + .fullName == + null || + followersobj! + .data![index] + .follower! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC( + followersobj!.data![index] + .follower!.fullName!), + sizedBoxHeight(4.h), + followersobj!.data![index].follower! + .userName == + null || + followersobj! + .data![index] + .follower! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + followersobj!.data![index] + .follower!.userName!) + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: Offset(0, 20), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + // onTap: () {}, + onTap: () async { + setState(() { + removeid = followersobj! + .data![index] + .follower! + .id ?? + 0; + followersobj!.data! + .removeWhere((item) => + item.follower! + .id == + removeid); + RemoveUploadata(); + }); + }, + child: Padding( + padding: + EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Remove user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_delete-28-regular.png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: + EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-regular.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + setState(() { + blockid = followersobj! + .data![index] + .follower! + .id ?? + 0; + followersobj!.data! + .removeWhere((item) => + item.follower! + .id == + blockid); + BlockUploadata(); + }); + }, + child: Padding( + padding: + EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Block user"), + Spacer(), + Image.asset( + "assets/images/png/blockchat.png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ) + ], + ); + }, + ); + } }, - ) + ), ]) ])) ])); } - Widget followerWidget({ - required String imagePath, - required String title, - required String subtitle, - }) { - return Padding( - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - CircleAvatar( - backgroundImage: AssetImage(imagePath), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur(subtitle) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Message user"), - Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Block user"), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, - ), - ), - )), + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) ], ), ); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart b/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart index 6dd9960..ea23321 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart @@ -1,11 +1,19 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class Following extends StatefulWidget { const Following({super.key}); @@ -15,43 +23,45 @@ class Following extends StatefulWidget { } class _FollowingState extends State { - List followingData = [ - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwart", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Ahmad Rhiel Madsen", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Kaylynn Vaccaro", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Kianna Donin", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Maria Herwitz", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Ahmad Rhiel Madsen", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Kaylynn Vaccaro", - "subtitle": "Lorem ipsum dummy text", - }, - ]; + StreamController searchcontroller = StreamController(); + + @override + void initState() { + // TODO: implement initState + var updata = ""; + Profilegetmethod().getFollowing(updata, streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + Uploadata() async { + utils.loader(); + Map updata = { + "following_iam_principal_xid": unfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("unfollow done"); + // setState(() { + // // Assuming followingobj is a list of items, remove the item with matching user ID + // followingobj!.data!.removeWhere((item) => item.following!.id == userid); + // }); + return utils.showToast(data.message); + } else { + Get.back(); + print("unfollow not done"); + return utils.showToast(data.message); + } + } + + int? unfollowid; @override Widget build(BuildContext context) { @@ -64,13 +74,14 @@ class _FollowingState extends State { titleTxt: "Following", ), body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column(children: [ + ), + SingleChildScrollView( + child: Column(children: [ Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), @@ -87,106 +98,244 @@ class _FollowingState extends State { ), ), hintText: "Search people", + texttype: TextInputType.text, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + // Onboard().postGroupsearch({"search": value}, + // streamController: searchcontroller); + // searchGroups(value!); + Profilegetmethod().getFollowing(value, + streamController: searchcontroller); + }, ), ), sizedBoxHeight(25.h), - ListView.builder( - shrinkWrap: true, - itemCount: followingData.length, - itemBuilder: (context, index) { - return Column( - children: [ - followingWidget( - imagePath: followingData[index]["imagePath"], - title: followingData[index]["title"], - subtitle: followingData[index]["subtitle"]), - if (index != followingData.length - 1) commonDivider(), - ], - ); + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followingobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: ScrollPhysics(), + shrinkWrap: true, + itemCount: followingobj!.data!.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + return + // Column( + // children: [ + // Followinglist( + // imagePath: followingobj?.data?[index] + // .following?.profilePhoto ?? + // '', + // title: followingobj! + // .data?[index].following?.fullName ?? + // '', + // subtitle: followingobj! + // .data?[index].following?.userName ?? + // '', + // unfollowontap: (id) => Uploadata(id), + // unfollowindex: followingobj! + // .data![index].following!.id!, + // ), + // if (index != followingobj!.data!.length - 1) + // commonDivider(), + // ], + // ); + Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + followingobj!.data![index].following! + .profilePhoto == + null || + followingobj! + .data![index] + .following! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + followingobj! + .data![index] + .following! + .profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + followingobj! + .data![index] + .following! + .fullName == + null || + followingobj! + .data![index] + .following! + .fullName! + .isEmpty + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC( + followingobj!.data![index] + .following!.fullName!), + sizedBoxHeight(4.h), + followingobj! + .data![index] + .following! + .userName == + null || + followingobj! + .data![index] + .following! + .userName! + .isEmpty + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + followingobj!.data![index] + .following!.userName!) + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: Offset(0, 20), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + onTap: () async { + setState(() { + unfollowid = + followingobj! + .data![ + index] + .following! + .id ?? + 0; + // followingobj!.data!.removeAt(index); + followingobj!.data! + .removeWhere((item) => + item.following! + .id == + unfollowid); + Uploadata(); + }); + }, + child: Padding( + padding: + EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Unfollow user"), + Spacer(), + Image.asset( + "assets/images/png/Black1323e.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: + EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-22.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ), + ], + ); + }, + ); + } }, - ) + ), ]) ])) ])); } - Widget followingWidget({ - required String imagePath, - required String title, - required String subtitle, - }) { - return Padding( - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - CircleAvatar( - backgroundImage: AssetImage(imagePath), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur(subtitle) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Unfollow user"), - Spacer(), - Image.asset( - "assets/images/png/Black1323e.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-22.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, - ), - ), - )), + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) ], ), ); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart new file mode 100644 index 0000000..e5d9420 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart @@ -0,0 +1,53 @@ +class FaqModel { + String? status; + int? statusCode; + String? message; + List? data; + + FaqModel({this.status, this.statusCode, this.message, this.data}); + + FaqModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? question; + String? answer; + + Data({this.id, this.question, this.answer}); + + Data.fromJson(Map json) { + id = json['id']; + question = json['question']; + answer = json['answer']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['question'] = this.question; + data['answer'] = this.answer; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart new file mode 100644 index 0000000..1c0e3d7 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart @@ -0,0 +1,82 @@ +class FollowersModel { + String? status; + int? statusCode; + String? message; + List? data; + + FollowersModel({this.status, this.statusCode, this.message, this.data}); + + FollowersModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? followingIamPrincipalXid; + int? iamPrincipalXid; + Follower? follower; + + Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower}); + + Data.fromJson(Map json) { + followingIamPrincipalXid = json['following_iam_principal_xid']; + iamPrincipalXid = json['iam_principal_xid']; + follower = json['follower'] != null + ? new Follower.fromJson(json['follower']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['following_iam_principal_xid'] = this.followingIamPrincipalXid; + data['iam_principal_xid'] = this.iamPrincipalXid; + if (this.follower != null) { + data['follower'] = this.follower!.toJson(); + } + return data; + } +} + +class Follower { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + + Follower({this.id, this.userName, this.fullName, this.profilePhoto}); + + Follower.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart new file mode 100644 index 0000000..323b892 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart @@ -0,0 +1,82 @@ +class FollowingModel { + String? status; + int? statusCode; + String? message; + List? data; + + FollowingModel({this.status, this.statusCode, this.message, this.data}); + + FollowingModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? followingIamPrincipalXid; + int? iamPrincipalXid; + Following? following; + + Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following}); + + Data.fromJson(Map json) { + followingIamPrincipalXid = json['following_iam_principal_xid']; + iamPrincipalXid = json['iam_principal_xid']; + following = json['following'] != null + ? new Following.fromJson(json['following']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['following_iam_principal_xid'] = this.followingIamPrincipalXid; + data['iam_principal_xid'] = this.iamPrincipalXid; + if (this.following != null) { + data['following'] = this.following!.toJson(); + } + return data; + } +} + +class Following { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + + Following({this.id, this.userName, this.fullName, this.profilePhoto}); + + Following.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart new file mode 100644 index 0000000..c129c6e --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart @@ -0,0 +1,45 @@ +class PrivacypolicyModel { + String? status; + int? statusCode; + String? message; + Data? data; + + PrivacypolicyModel({this.status, this.statusCode, this.message, this.data}); + + PrivacypolicyModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + String? content; + + Data({this.id, this.content}); + + Data.fromJson(Map json) { + id = json['id']; + content = json['content']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['content'] = this.content; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart b/lib/Feed Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart new file mode 100644 index 0000000..9a36d04 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart @@ -0,0 +1,45 @@ +class TermsConditionsModel { + String? status; + int? statusCode; + String? message; + Data? data; + + TermsConditionsModel({this.status, this.statusCode, this.message, this.data}); + + TermsConditionsModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + String? content; + + Data({this.id, this.content}); + + Data.fromJson(Map json) { + id = json['id']; + content = json['content']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['content'] = this.content; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart index 45290de..616ef33 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart @@ -1,12 +1,16 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Common/CommonButton.dart'; -import 'package:regroup/Common/CommonDropDown.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; import '../../../../Utils/Common/CustomTextformfield.dart'; @@ -18,91 +22,188 @@ class ContactUs extends StatefulWidget { } class _ContactUsState extends State { + final GlobalKey _formkey = GlobalKey(); + TextEditingController fullname = TextEditingController(); + TextEditingController email = TextEditingController(); + TextEditingController querycontroller = TextEditingController(); + + String _selectedreasontocontact = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedreasontocontact = value; + }); + } + + Uploadata() async { + utils.loader(); + Map updata = { + "full_name": fullname.text, + "email": email.text, + "reason_to_contact": _selectedreasontocontact, + "query": querycontroller.text + }; + final data = await Profilepostmethod().postContactus(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + Get.back(); + print("contact us done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("contact us not done"); + return utils.showToast(data.message); + } + } + @override Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Contact us", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Contact us", ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(20.h), - text16400white("Full name"), - sizedBoxHeight(16.h), - CustomTextFormField( - leadingIcon: Container( - height: 17.h, - width: 18.w, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: Form( + key: _formkey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16400white("Full name"), + sizedBoxHeight(16.h), + CustomTextFormField( + leadingIcon: Container( height: 17.h, width: 18.w, - fit: BoxFit.cover, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + height: 17.h, + width: 18.w, + fit: BoxFit.cover, + ), + ), ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + hintText: "Enter full name", + textEditingController: fullname, ), - ), - hintText: "Edward Hackett", - ), - text16400white("Email address"), - sizedBoxHeight(16.h), - CustomTextFormField( - leadingIcon: Container( - height: 17.h, - width: 18.w, - child: Center( - child: Image.asset( - "assets/images/png/Frame 12.png", + sizedBoxHeight(10.h), + text16400white("Email address"), + sizedBoxHeight(16.h), + CustomTextFormField( + leadingIcon: Container( + height: 17.h, + width: 18.w, + child: Center( + child: Image.asset( + "assets/images/png/Frame 12.png", + height: 17.h, + width: 18.w, + fit: BoxFit.cover, + ), + ), + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your e-mail address'; + } + if (!RegExp( + r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + .hasMatch(value)) { + return 'Enter a valid e-mail address'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + textEditingController: email, + hintText: "Enter email address", + ), + sizedBoxHeight(10.h), + text16400white("Reason to contact"), + sizedBoxHeight(16.h), + CustomDropDownRadio( + header: "", + title: "", + listData: [ + "Feature suggestion", + "Issues with app", + "Scoreboard", + "Feedback" + ], + onItemSelected: _onItemSelected, + leadingImage: Image.asset( + "assets/images/png/fluent_person-support-20-regular.png", height: 17.h, width: 18.w, - fit: BoxFit.cover, ), ), - ), - hintText: "loremipsum@gmail.com", - ), - text16400white("Reason to contact"), - sizedBoxHeight(16.h), - CustomDropDownRadio( - header: "", - title: "", - listData: [ - "Feature suggestion", - "Issues with app", - "Scoreboard", - "Feedback" - ], - onItemSelected: (p0) {}, - leadingImage: Image.asset( - "assets/images/png/fluent_person-support-20-regular.png", - height: 17.h, - width: 18.w, - ), - ), - sizedBoxHeight(25.h), - text16400white("Query"), - sizedBoxHeight(16.h), - CustomTextFormField2( - maxlines: 3, - hintText: - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", - ), - CommonBtn(text: "Send") - ]), - )) - ])); + sizedBoxHeight(25.h), + text16400white("Query"), + sizedBoxHeight(16.h), + CustomTextFormField2( + maxlines: 3, + hintText: "Enter query", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + textEditingController: querycontroller, + ), + CustomButton( + onPressed: () { + // final isValid = + // _formkey.currentState?.validate(); + if (fullname.text.isBlank! && + email.text.isBlank! && + querycontroller.text.isBlank! && + _selectedreasontocontact.isEmpty) { + utils.showToast("Please fill all fields"); + } else { + Uploadata(); + } + }, + text: "Send") + ]), + ), + )) + ])), + ); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart index f046a3f..ebb976d 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -20,7 +21,10 @@ class _FaqScreenState extends State { @override void initState() { - isExpandedList = RxList.generate(faqcard.length, (index) => index == 0); + // myfuture = Profilegetmethod().getfaqs().then((value) { + // isExpandedList = + // RxList.generate(faqobj!.data!.length, (index) => index == 0); + // }); super.initState(); } @@ -59,44 +63,99 @@ class _FaqScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - resizeToAvoidBottomInset: false, - extendBody: true, - appBar: CommonAppbar( - titleTxt: "FAQ’s", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), - Positioned.fill( - child: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column(children: [ - sizedBoxHeight(25.h), - ListView.builder( - controller: ScrollController(), - shrinkWrap: true, - itemCount: faqcard.length, - itemBuilder: (BuildContext context, int index) { - return Obx( - () { - return customExpandableItem( - isExpanded: isExpandedList[index], - title: faqcard[index]['title'] ?? '', - content: faqcard[index]['content'] ?? '', - toggleExpansion: () => - toggleExpansion(index), - ); - }, + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + resizeToAvoidBottomInset: false, + extendBody: true, + appBar: CommonAppbar( + titleTxt: "FAQ’s", + ), + body: FutureBuilder( + future: Profilegetmethod().getFaqs(), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + isExpandedList = + RxList.generate(faqobj!.data!.length, (index) => index == 0); + return faqobj!.data!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + Widget _buildBody(context) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Positioned.fill( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(25.h), + ListView.builder( + controller: ScrollController(), + shrinkWrap: true, + itemCount: faqobj!.data!.length, + itemBuilder: (BuildContext context, int index) { + return Obx( + () { + return customExpandableItem( + isExpanded: isExpandedList[index], + title: faqobj!.data![index].question ?? '', + content: faqobj!.data![index].answer ?? '', + toggleExpansion: () => toggleExpansion(index), ); - }) - ])))) - ])); + }, + ); + }) + ])))) + ]); } Widget customExpandableItem({ diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart index bdbe277..609776d 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -16,35 +19,109 @@ class _PrivacyPolicyState extends State { @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Privacy policy", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column(children: [ - sizedBoxHeight(20.h), - text18w700white( - "Regroup is a community where everyone can belong"), - sizedBoxHeight(20.h), - text16400whiteblur( - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), - sizedBoxHeight(20.h), - text16400whiteblur( - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.") - ]), - ), + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + titleTxt: "Privacy policy", + ), + body: FutureBuilder( + future: Profilegetmethod().getPrivacypolicy(), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return Center(child: CircularProgressIndicator()); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return privacyobj!.data!.isBlank! + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), ) - ])); + ], + ), + ); + } + + Widget _buildBody(context) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: SingleChildScrollView( + child: Column(children: [ + sizedBoxHeight(20.h), + + Html( + data: privacyobj!.data!.content, + // style: { + // "html": Style( + // color: Colors.white, + // fontFamily: "Poppins", + // fontSize: FontSize(18.sp), + // fontWeight: FontWeight.w700, + // ), + // }, + style: { + "html": Style( + color: Colors.white, // Text color + fontFamily: "Poppins", // Font family + fontSize: FontSize(18), // Font size + fontWeight: FontWeight.w700, // Font weight + ), + "p": Style( + color: Colors.white, + fontSize: FontSize(18.sp), + fontWeight: FontWeight.w500), + "a": Style( + color: Colors.white, + fontSize: FontSize(18.sp), + fontWeight: FontWeight.w500 + // Link color + ), + }, + ) + // text18w700white( + // "Regroup is a community where everyone can belong"), + // sizedBoxHeight(20.h), + // text16400whiteblur( + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // sizedBoxHeight(20.h), + // text16400whiteblur( + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.") + ]), + ), + ) + ]); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart index e36df66..083adbd 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart @@ -1,13 +1,22 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonDropDown.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class ReportABug extends StatefulWidget { const ReportABug({super.key}); @@ -17,131 +26,243 @@ class ReportABug extends StatefulWidget { } class _ReportABugState extends State { + final GlobalKey _formkey = GlobalKey(); + TextEditingController deviceoscontroller = TextEditingController(); + TextEditingController versionoscontroller = TextEditingController(); + TextEditingController emailcontroller = TextEditingController(); + TextEditingController querycontroller = TextEditingController(); + + String _selectedreasontocontact = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedreasontocontact = value; + }); + } + + Uploadata() async { + utils.loader(); + Map updata = { + "device": deviceoscontroller.text, + "version": versionoscontroller.text, + "email": emailcontroller.text, + "reason_to_contact": _selectedreasontocontact, + "query": querycontroller.text, + }; + final data = await Profilepostmethod().postReportandbug(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + Get.back(); + print("report done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("report not done"); + return utils.showToast(data.message); + } + } + @override Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Report a bug", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + resizeToAvoidBottomInset: false, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Report a bug", ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(20.h), - Row( - children: [ - text16400white("Device OS"), - sizedBoxWidth(8.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(15.h), - CustomTextFormField( - leadingIcon: Container( - height: 25.h, - width: 15.w, - child: Center( - child: Image.asset( - "assets/images/png/VectorDevice.png", - height: 25.h, - width: 15.w, - fit: BoxFit.cover, + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + physics: ScrollPhysics(), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Form( + key: _formkey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + Row( + children: [ + text16400white("Device OS"), + sizedBoxWidth(8.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, + ) + ], ), - ), - ), - hintText: "Apple iphone", - ), - Row( - children: [ - text16400white("OS version"), - sizedBoxWidth(8.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(15.h), - CustomTextFormField( - leadingIcon: Container( - height: 23.h, - width: 23.w, - child: Center( - child: Image.asset( - "assets/images/png/setting2.png", - height: 23.h, - width: 23.w, - fit: BoxFit.cover, + sizedBoxHeight(15.h), + CustomTextFormField( + leadingIcon: Container( + height: 25.h, + width: 15.w, + child: Center( + child: Image.asset( + "assets/images/png/VectorDevice.png", + height: 25.h, + width: 15.w, + fit: BoxFit.cover, + ), + ), + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your decice os'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + hintText: "Enter decice os", + textEditingController: deviceoscontroller, ), - ), - ), - hintText: "Version 16", - ), - text16400white("Email address"), - sizedBoxHeight(15.h), - CustomTextFormField( - leadingIcon: Container( - height: 17.h, - width: 22.w, - child: Center( - child: Image.asset( - "assets/images/png/Frame 12 (1).png", - height: 17.h, - width: 22.w, - fit: BoxFit.cover, + sizedBoxHeight(10.h), + Row( + children: [ + text16400white("OS version"), + sizedBoxWidth(8.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, + ) + ], ), - ), - ), - hintText: "loremipsum@gmail.com", - ), - text16400white("Reason to contact"), - sizedBoxHeight(15.h), - CustomDropDownRadio( - header: "", - title: "", - listData: [ - "Messaging", - "Crashes", - "Constant logout", - "Unable to view post" - ], - onItemSelected: (p0) {}, - leadingImage: Image.asset( - "assets/images/png/codicon_bug.png", - height: 23.h, - width: 23.w, - ), - showOtherOption: true, - ), - sizedBoxHeight(20.h), - text16400white("Query"), - sizedBoxHeight(15.h), - CustomTextFormField2( - maxlines: 3, - hintText: - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", - ), - sizedBoxHeight(20.h), - CommonBtn(text: "Send") - ])), - ) - ])); + sizedBoxHeight(15.h), + CustomTextFormField( + leadingIcon: Container( + height: 23.h, + width: 23.w, + child: Center( + child: Image.asset( + "assets/images/png/setting2.png", + height: 23.h, + width: 23.w, + fit: BoxFit.cover, + ), + ), + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your os version'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + hintText: "Enter os verison", + textEditingController: versionoscontroller, + ), + sizedBoxHeight(10.h), + text16400white("Email address"), + sizedBoxHeight(15.h), + CustomTextFormField( + leadingIcon: Container( + height: 17.h, + width: 24.w, + child: Center( + child: Image.asset( + "assets/images/png/Frame 12.png", + height: 17.h, + width: 22.w, + fit: BoxFit.cover, + ), + ), + ), + validator: (value) { + if (value!.isEmpty) { + return 'Enter your e-mail address'; + } + if (!RegExp( + r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + .hasMatch(value)) { + return 'Enter a valid e-mail address'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + textEditingController: emailcontroller, + hintText: "Enter email address", + ), + sizedBoxHeight(10.h), + text16400white("Reason to contact"), + sizedBoxHeight(15.h), + CustomDropDownRadio( + header: "", + title: "", + listData: [ + "Messaging", + "Crashes", + "Constant logout", + "Unable to view post" + ], + onItemSelected: _onItemSelected, + leadingImage: Image.asset( + "assets/images/png/codicon_bug.png", + height: 23.h, + width: 23.w, + ), + showOtherOption: true, + ), + sizedBoxHeight(20.h), + text16400white("Query"), + sizedBoxHeight(15.h), + CustomTextFormField2( + maxlines: 3, + hintText: "Enter query", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + textEditingController: querycontroller, + ), + sizedBoxHeight(20.h), + CustomButton( + onPressed: () { + if (deviceoscontroller.text.isBlank! && + versionoscontroller.text.isBlank! && + querycontroller.text.isBlank! && + emailcontroller.text.isBlank! && + _selectedreasontocontact.isEmpty) { + utils.showToast("Please fill all fields"); + } else { + Uploadata(); + } + }, + text: "Send") + ]), + ), + ), + ) + ])), + ); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart b/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart index b46c099..01a0d99 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; class TermsCondition extends StatefulWidget { const TermsCondition({super.key}); @@ -16,35 +17,92 @@ class _TermsConditionState extends State { @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Terms & Condition", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column(children: [ - sizedBoxHeight(20.h), - text18w700white( - "Regroup is a community where everyone can belong"), - sizedBoxHeight(20.h), - text16400whiteblur( - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), - sizedBoxHeight(20.h), - text16400whiteblur( - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.") - ]), - ), + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + titleTxt: "Terms & Condition", + ), + body: FutureBuilder( + future: Profilegetmethod().getTermsConditions(), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return Center(child: CircularProgressIndicator()); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return termsobj!.data!.isBlank! + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), ) - ])); + ], + ), + ); + } + + Widget _buildBody(context) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: SingleChildScrollView( + child: Column(children: [ + sizedBoxHeight(20.h), + Html( + data: termsobj!.data!.content, + style: { + "html": Style( + color: Colors.white, // Text color + fontFamily: "Poppins", // Font family + fontSize: FontSize(18), // Font size + fontWeight: FontWeight.w700, // Font weight + ), + "p": Style( + color: Colors.white, + fontSize: FontSize(18.sp), + fontWeight: FontWeight.w500), + "a": Style( + color: Colors.white, + fontSize: FontSize(18.sp), + fontWeight: FontWeight.w500 + // Link color + ), + }, + ) + ]), + ), + ) + ]); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart new file mode 100644 index 0000000..254111f --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart @@ -0,0 +1,81 @@ +import 'dart:async'; +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/faqModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart'; + +FaqModel? faqobj; +PrivacypolicyModel? privacyobj; +TermsConditionsModel? termsobj; +FollowersModel? followersobj; +FollowingModel? followingobj; + +class Profilegetmethod { + Future> getFaqs() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getfaqs, + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + faqobj = FaqModel.fromJson(response.data); + log(faqobj!.data.toString()); + } + return response; + } + + Future> getPrivacypolicy() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getprivacypolicy, + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + privacyobj = PrivacypolicyModel.fromJson(response.data); + log(privacyobj!.data.toString()); + } + return response; + } + + Future> getTermsConditions() async { + final response = await NetworkApiServices().getApi( + ApiUrls.gettermsconditios, + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + termsobj = TermsConditionsModel.fromJson(response.data); + log(termsobj!.data.toString()); + } + return response; + } + + Future> getFollowers(updata, + {required StreamController streamController}) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getfollowers}?search=$updata", + ); + + if (response.status == ResponseStatus.SUCCESS) { + followersobj = FollowersModel.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(followersobj!); + } + return response; + } + + Future> getFollowing(updata, + {required StreamController streamController}) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getfollowing}?search=$updata", + ); + + if (response.status == ResponseStatus.SUCCESS) { + followingobj = FollowingModel.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(followingobj!); + } + return response; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart new file mode 100644 index 0000000..8a833c8 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart @@ -0,0 +1,62 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +class Profilepostmethod { + Profilepostmethod(); + + Future> postContactus(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postcontactus, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postReportandbug(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postreportbug, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postBlockuser(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postblock, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postunfollowuser(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postunfollow, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postRemoveuser(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postremoveuser, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } +} diff --git a/lib/Login/View/loginscreen.dart b/lib/Login/View/loginscreen.dart index 232a523..cc4337c 100644 --- a/lib/Login/View/loginscreen.dart +++ b/lib/Login/View/loginscreen.dart @@ -72,7 +72,7 @@ class _LoginScreenState extends State { snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); - //Get.toNamed(RouteName.mainscreen); + Get.toNamed(RouteName.mainscreen); logger.d("go to login"); } } else { @@ -198,307 +198,310 @@ class _LoginScreenState extends State { @override Widget build(BuildContext context) { - return Scaffold( - resizeToAvoidBottomInset: - false, // Prevent resizing when the keyboard opens - backgroundColor: const Color.fromARGB(255, 18, 32, 47), - body: Stack( - clipBehavior: Clip.none, - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Choice screen.png"), - fit: BoxFit.cover)), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 150.h, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Align( - alignment: Alignment.center, - child: Container( - width: 107.w, - height: 70.h, - child: SvgPicture.asset( - "assets/images/svg/onboarding2.svg", - fit: BoxFit.cover, + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + resizeToAvoidBottomInset: + false, // Prevent resizing when the keyboard opens + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + body: Stack( + clipBehavior: Clip.none, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Choice screen.png"), + fit: BoxFit.cover)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 150.h, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Align( + alignment: Alignment.center, + child: Container( + width: 107.w, + height: 70.h, + child: SvgPicture.asset( + "assets/images/svg/onboarding2.svg", + fit: BoxFit.cover, + ), ), ), ), - ), - sizedBoxHeight(20.h), - Align( - alignment: Alignment.center, - child: text22400FCFCFC("Find your community")), - sizedBoxHeight(40.h), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16400white('Email address'), - sizedBoxHeight(10.h), - CustomTextFormField( - textEditingController: _emailController, - hintText: "Enter your email address", - leadingIcon: - // const Icon(Icons.mail_outline), - SizedBox( - width: 22.w, - height: 17.h, - child: Image.asset( - 'assets/images/png/mail.png', + sizedBoxHeight(20.h), + Align( + alignment: Alignment.center, + child: text22400FCFCFC("Find your community")), + sizedBoxHeight(40.h), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white('Email address'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: _emailController, + hintText: "Enter your email address", + leadingIcon: + // const Icon(Icons.mail_outline), + SizedBox( + width: 22.w, + height: 17.h, + child: Image.asset( + 'assets/images/png/mail.png', + width: 22.w, + height: 17.h, + ), + ), + // validationMessage: errormsg.value, + validator: (value) { + if (value!.isEmpty) { + return 'Enter your e-mail address'; + } + if (!RegExp( + r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + .hasMatch(value)) { + return 'Enter a valid e-mail address'; + } + return null; + }, + // onInput: (p0) { + // if (p0!.isEmpty) { + // errormsg.value = 'Enter your e-mail address'; + // } + // if (!RegExp( + // r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + // .hasMatch(p0!)) { + // errormsg.value = 'Enter a valid e-mail address'; + // } + // return null; + // }, + // validatorText: "Email Id", + + inputFormatters: [ + LengthLimitingTextInputFormatter(30), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + text16400white('Password'), + sizedBoxHeight(10.h), + CustomTextFormField( + isInputPassword: true, + textEditingController: _passwordController, + hintText: 'Enter your password', + leadingIcon: Image.asset( + 'assets/images/png/lock.png', width: 22.w, height: 17.h, ), - ), - // validationMessage: errormsg.value, - validator: (value) { - if (value!.isEmpty) { - return 'Enter your e-mail address'; - } - if (!RegExp( - r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') - .hasMatch(value)) { - return 'Enter a valid e-mail address'; - } - return null; - }, - // onInput: (p0) { - // if (p0!.isEmpty) { - // errormsg.value = 'Enter your e-mail address'; - // } - // if (!RegExp( - // r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') - // .hasMatch(p0!)) { - // errormsg.value = 'Enter a valid e-mail address'; - // } - // return null; - // }, - // validatorText: "Email Id", - - inputFormatters: [ - LengthLimitingTextInputFormatter(30), - RemoveEmojiInputFormatter() - ], - ), - sizedBoxHeight(10.h), - text16400white('Password'), - sizedBoxHeight(10.h), - CustomTextFormField( - isInputPassword: true, - textEditingController: _passwordController, - hintText: 'Enter your password', - leadingIcon: Image.asset( - 'assets/images/png/lock.png', - width: 22.w, - height: 17.h, - ), - // validationMessage: errormsgpass.value, - validator: (value) { - if (value!.isEmpty) { - return 'Please enter your password'; - } - if (!RegExp( - r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$') - .hasMatch(value)) { - return 'Enter a valid password'; - } - - return null; - }, - // onInput: (p0) { - // if (p0 == null || p0.isEmpty) { - // errormsgpass.value = - // 'Please enter your password'; - // } - // return null; - // }, - inputFormatters: [ - LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter() - ], - ), - sizedBoxHeight(10.h), - Align( - alignment: Alignment.centerRight, - child: Padding( - padding: EdgeInsets.only(right: 6.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.forgotpass); - }, - child: text14400white('Forgot password ?')), - )), - sizedBoxHeight(40.h), - CustomButton( - text: "Login", - onPressed: () { - _logincheck(); - }), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.signupscreen); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text14400white('Don’t have account ? '), - sizedBoxWidth(5.w), - text14700white('Sign up') + // validationMessage: errormsgpass.value, + validator: (value) { + if (value!.isEmpty) { + return 'Please enter your password'; + } + if (!RegExp( + r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$') + .hasMatch(value)) { + return 'Enter a valid password'; + } + + return null; + }, + // onInput: (p0) { + // if (p0 == null || p0.isEmpty) { + // errormsgpass.value = + // 'Please enter your password'; + // } + // return null; + // }, + inputFormatters: [ + LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter() ], ), - ), - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: 160, - decoration: const ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 0.50, - strokeAlign: BorderSide.strokeAlignCenter, - color: Color(0xFF434A53), - ), - ), - ), - ), - sizedBoxWidth(6.w), - text14400white('Or'), - sizedBoxWidth(6.w), - Container( - width: 160, - decoration: const ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 0.50, - strokeAlign: BorderSide.strokeAlignCenter, - color: Color(0xFF434A53), - ), - ), - ), - ), - ], - ), - sizedBoxHeight(20.h), - Center( - child: SizedBox( - width: 220.w, + sizedBoxHeight(10.h), + Align( + alignment: Alignment.centerRight, + child: Padding( + padding: EdgeInsets.only(right: 6.w), + child: GestureDetector( + onTap: () { + Get.toNamed(RouteName.forgotpass); + }, + child: text14400white('Forgot password ?')), + )), + sizedBoxHeight(40.h), + CustomButton( + text: "Login", + onPressed: () { + _logincheck(); + }), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.signupscreen); + }, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (Platform.isIOS) - GestureDetector( - onTap: () { - _loginWithApple(); - }, - child: Container( - width: 55, - height: 55, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), - colors: [ - Colors.white.withOpacity( - 0.07999999821186066), - Colors.white.withOpacity( - 0.12999999523162842) - ], - ), - shape: const OvalBorder( - side: BorderSide( - width: 0.50, - color: Color(0xFF434A53)), - ), - image: const DecorationImage( - image: AssetImage( - 'assets/images/png/login2.png'))), - ), - ), - // const Spacer(), - if (Platform.isAndroid) - GestureDetector( - onTap: () { - _loginWithGoogle(); - }, - child: Container( - width: 55, - height: 55, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), - colors: [ - Colors.white.withOpacity( - 0.07999999821186066), - Colors.white.withOpacity( - 0.12999999523162842) - ], - ), - shape: const OvalBorder( - side: BorderSide( - width: 0.50, - color: Color(0xFF434A53)), - ), - image: const DecorationImage( - image: AssetImage( - 'assets/images/png/login3.png'))), - ), - ), - // const Spacer(), - GestureDetector( - onTap: () async { - _checkIfisLoggedIn(); - }, - child: Container( - width: 55, - height: 55, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.71, -0.70), - end: const Alignment(-0.71, 0.7), - colors: [ - Colors.white.withOpacity( - 0.07999999821186066), - Colors.white.withOpacity( - 0.12999999523162842) - ], - ), - shape: const OvalBorder( - side: BorderSide( - width: 0.50, - color: Color(0xFF434A53)), - ), - image: const DecorationImage( - image: AssetImage( - 'assets/images/png/login4.png'))), - ), - ), + text14400white('Don’t have account ? '), + sizedBoxWidth(5.w), + text14700white('Sign up') ], ), ), - ), - // sizedBoxHeight(100) - ], + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 160, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + strokeAlign: BorderSide.strokeAlignCenter, + color: Color(0xFF434A53), + ), + ), + ), + ), + sizedBoxWidth(6.w), + text14400white('Or'), + sizedBoxWidth(6.w), + Container( + width: 160, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + strokeAlign: BorderSide.strokeAlignCenter, + color: Color(0xFF434A53), + ), + ), + ), + ), + ], + ), + sizedBoxHeight(20.h), + Center( + child: SizedBox( + width: 220.w, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + if (Platform.isIOS) + GestureDetector( + onTap: () { + _loginWithApple(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment(0.71, -0.70), + end: const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login2.png'))), + ), + ), + // const Spacer(), + if (Platform.isAndroid) + GestureDetector( + onTap: () { + _loginWithGoogle(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment(0.71, -0.70), + end: const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login3.png'))), + ), + ), + // const Spacer(), + GestureDetector( + onTap: () async { + _checkIfisLoggedIn(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment(0.71, -0.70), + end: const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login4.png'))), + ), + ), + ], + ), + ), + ), + // sizedBoxHeight(100) + ], + ), ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ); } diff --git a/lib/Utils/Common/CommonDropdown.dart b/lib/Utils/Common/CommonDropdown.dart index 432fbc9..2f5d637 100644 --- a/lib/Utils/Common/CommonDropdown.dart +++ b/lib/Utils/Common/CommonDropdown.dart @@ -662,7 +662,7 @@ class _CustomDropDownRadioState extends State { }, child: Container( width: double.infinity, - height: 50.h, + height: 52.h, padding: EdgeInsets.only( top: 14.0, bottom: 14.0, right: 22.w, left: 12.w), decoration: BoxDecoration( diff --git a/lib/Utils/Common/CustomTextformfield.dart b/lib/Utils/Common/CustomTextformfield.dart index 474c76c..f932031 100644 --- a/lib/Utils/Common/CustomTextformfield.dart +++ b/lib/Utils/Common/CustomTextformfield.dart @@ -129,7 +129,8 @@ class _CustomTextFormFieldState extends State { prefixIcon: widget.leadingIcon == null ? null : Padding( - padding: const EdgeInsets.symmetric(horizontal: 10), + padding: EdgeInsets.symmetric( + horizontal: 10.w, vertical: 13.h), child: widget.leadingIcon!, ), suffixIcon: widget.isInputPassword @@ -164,7 +165,7 @@ class _CustomTextFormFieldState extends State { : widget.suffixIcon!, border: InputBorder.none, contentPadding: - const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + EdgeInsets.symmetric(horizontal: 20.h, vertical: 13.w), ), keyboardType: widget.texttype, inputFormatters: widget.inputFormatters, diff --git a/pubspec.lock b/pubspec.lock index 3002590..875b850 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -105,6 +105,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" + url: "https://pub.dev" + source: hosted + version: "0.17.3" cupertino_icons: dependency: "direct main" description: @@ -310,6 +318,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + sha256: "02ad69e813ecfc0728a455e4bf892b9379983e050722b1dce00192ee2e41d1ee" + url: "https://pub.dev" + source: hosted + version: "3.0.0-beta.2" flutter_lints: dependency: "direct dev" description: @@ -528,6 +544,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.4+1" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" http: dependency: transitive description: @@ -688,6 +712,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + list_counter: + dependency: transitive + description: + name: list_counter + sha256: c447ae3dfcd1c55f0152867090e67e219d42fe6d4f2807db4bbe8b8d69912237 + url: "https://pub.dev" + source: hosted + version: "1.0.2" logger: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 32408a2..81d2ac8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -75,6 +75,7 @@ dependencies: logger: ^2.3.0 sign_in_with_apple: any timer_button: ^2.1.1 + flutter_html: ^3.0.0-beta.2