tangheem detail improvements

development-design-2.0
Sikander Saleem 3 years ago
parent 0253eef6b1
commit 9647dca24e

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 12C3 4.5885 4.5885 3 12 3C19.4115 3 21 4.5885 21 12C21 19.4115 19.4115 21 12 21C4.5885 21 3 19.4115 3 12Z" stroke="#323232" stroke-width="2"/>
<path d="M12 8L12 16" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15 11L12.087 8.08704V8.08704C12.039 8.03897 11.961 8.03897 11.913 8.08704V8.08704L9 11" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 673 B

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.75 20.75C17.5974 20.747 17.4487 20.702 17.32 20.62L12 16.91L6.68 20.62C6.56249 20.6915 6.42757 20.7294 6.29 20.7294C6.15243 20.7294 6.01751 20.6915 5.9 20.62C5.78491 20.5607 5.68741 20.4722 5.61722 20.3634C5.54703 20.2546 5.50661 20.1293 5.5 20V6C5.5 5.27065 5.78973 4.57118 6.30546 4.05546C6.82118 3.53973 7.52065 3.25 8.25 3.25H15.75C16.4793 3.25 17.1788 3.53973 17.6945 4.05546C18.2103 4.57118 18.5 5.27065 18.5 6V20C18.5005 20.1362 18.4634 20.2698 18.3929 20.3863C18.3223 20.5027 18.2209 20.5974 18.1 20.66C17.9927 20.7189 17.8724 20.7498 17.75 20.75ZM12 15.25C12.1532 15.2484 12.3033 15.2938 12.43 15.38L17 18.56V6C17 5.66848 16.8683 5.35054 16.6339 5.11612C16.3995 4.8817 16.0815 4.75 15.75 4.75H8.25C7.91848 4.75 7.60054 4.8817 7.36612 5.11612C7.1317 5.35054 7 5.66848 7 6V18.56L11.57 15.38C11.6967 15.2938 11.8468 15.2484 12 15.25Z" fill="#000000"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 76 76" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"
enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#000000" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round"
d="M 57,45L 57,39.1667L 51,45L 51,40L 25,40L 25,45L 19,39.1666L 19,44.9999L 16,44.9999L 16,30.9999L 19,30.9999L 19,36.8333L 25,31L 25,36L 51,36L 51,31L 57,36.8334L 57,31L 60,31L 60,45L 57,45 Z " />
</svg>

After

Width:  |  Height:  |  Size: 750 B

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 27.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32"
style="enable-background:new 0 0 32 32;" xml:space="preserve">
<g id="Protection">
<g>
<path style="fill:#40696C" class="st0" d="M15.6,31.9C7.4,28.7,2,20.9,2,12.1V11c0-0.6,0.4-1,1-1s1,0.4,1,1v1.1c0,7.8,4.8,14.9,12,17.9
c7.2-3,12-10,12-17.9V7.6L16,2.1L3.4,7.9c-0.5,0.2-1.1,0-1.3-0.5s0-1.1,0.5-1.3l13-6c0.3-0.1,0.6-0.1,0.8,0l13,6
C29.8,6.3,30,6.6,30,7v5.1c0,8.8-5.4,16.7-13.6,19.9C16.1,32,15.9,32,15.6,31.9z" />
<path style="fill:#40696C" class="st0" d="M15.6,27.6C9.8,25.2,6,19.6,6,13.3V10c0-0.4,0.2-0.7,0.6-0.9l9-4.6c0.3-0.1,0.6-0.1,0.9,0l9,4.6
C25.8,9.3,26,9.6,26,10v3.3c0,6.3-3.8,12-9.6,14.4C16.1,27.7,15.9,27.7,15.6,27.6z M8,10.6v2.7c0,5.3,3.1,10.2,8,12.4
c4.9-2.2,8-7,8-12.4v-2.6l-8-4.1L8,10.6z" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="9" y="2" width="6" height="12" rx="3" stroke="#000000" stroke-width="1.5"/>
<path d="M5 3V5M1 2V6M19 3V5M23 2V6" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5 10V11C5 14.866 8.13401 18 12 18V18V18C15.866 18 19 14.866 19 11V10" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12 18V22M12 22H9M12 22H15" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 721 B

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M20 5.75a3.25 3.25 0 0 1-5.532 2.314L9.31 10.906a3.245 3.245 0 0 1-.001 2.192l5.156 2.84a3.25 3.25 0 1 1-.922 1.775l-5.478-3.017a3.25 3.25 0 1 1 .004-5.389l5.474-3.018A3.25 3.25 0 1 1 20 5.75z" fill="#000000"/></svg>

After

Width:  |  Height:  |  Size: 486 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM7.07 18.28C7.5 17.38 10.12 16.5 12 16.5C13.88 16.5 16.51 17.38 16.93 18.28C15.57 19.36 13.86 20 12 20C10.14 20 8.43 19.36 7.07 18.28ZM12 14.5C13.46 14.5 16.93 15.09 18.36 16.83C19.38 15.49 20 13.82 20 12C20 7.59 16.41 4 12 4C7.59 4 4 7.59 4 12C4 13.82 4.62 15.49 5.64 16.83C7.07 15.09 10.54 14.5 12 14.5ZM12 6C10.06 6 8.5 7.56 8.5 9.5C8.5 11.44 10.06 13 12 13C13.94 13 15.5 11.44 15.5 9.5C15.5 7.56 13.94 6 12 6ZM10.5 9.5C10.5 10.33 11.17 11 12 11C12.83 11 13.5 10.33 13.5 9.5C13.5 8.67 12.83 8 12 8C11.17 8 10.5 8.67 10.5 9.5Z" fill="#000000"/>
</svg>

After

Width:  |  Height:  |  Size: 917 B

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11ZM11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C13.125 20 15.078 19.2635 16.6177 18.0319L20.2929 21.7071C20.6834 22.0976 21.3166 22.0976 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L18.0319 16.6177C19.2635 15.078 20 13.125 20 11C20 6.02944 15.9706 2 11 2Z" fill="#000000"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 14C10 14.5523 10.4477 15 11 15C11.5523 15 12 14.5523 12 14V12H14C14.5523 12 15 11.5523 15 11C15 10.4477 14.5523 10 14 10H12V8C12 7.44772 11.5523 7 11 7C10.4477 7 10 7.44772 10 8V10H8C7.44772 10 7 10.4477 7 11C7 11.5523 7.44772 12 8 12H10V14Z" fill="#000000"/>
</svg>

After

Width:  |  Height:  |  Size: 1004 B

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11ZM11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C13.125 20 15.078 19.2635 16.6177 18.0319L20.2929 21.7071C20.6834 22.0976 21.3166 22.0976 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L18.0319 16.6177C19.2635 15.078 20 13.125 20 11C20 6.02944 15.9706 2 11 2Z" fill="#000000"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 11C7 10.4477 7.44772 10 8 10H14C14.5523 10 15 10.4477 15 11C15 11.5523 14.5523 12 14 12H8C7.44772 12 7 11.5523 7 11Z" fill="#000000"/>
</svg>

After

Width:  |  Height:  |  Size: 878 B

@ -46,6 +46,8 @@ class AppState {
String get userEmail => _authenticationUser?.result?.data?.email;
String get userName => _authenticationUser?.result?.data?.userName;
void setAuthenticationModel(AuthenticationUserModel _authenticationUser) {
this._authenticationUser = _authenticationUser;
}
@ -70,5 +72,5 @@ class AppState {
List<ContentInfoDataModel> haqooqAlMosasa;
List<ContentInfoDataModel> tareefAlMosasa;
String tangheemDiscription;
}

@ -23,18 +23,29 @@ class ColorConsts {
static const Color darkText = Color(0xff416A6C);
static const Color dark2Text = Color(0xff2B484A);
static const Color dark99Text = Color(0xff99C5C7);
static const Color borderDarkText = Color(0xff03A67B);
static const Color borderDark2Text = Color(0xff2CB9B0);
static const Color borderColor = Color(0xffDDDDDD);
static const Color greyE0Color = Color(0xffE0E0E0);
static const Color greenLightColor = Color(0xff9BB195);
static const Color brownColor = Color(0xffDAE8646);
static const Color brownLightColor = Color(0xffAE8646);
static const Color brownLightECColor = Color(0xffECE9DB);
static const Color brownB7CColor = Color(0xffB78438);
static const Color brownB1CColor = Color(0xffB1A995);
static const Color brownB6CColor = Color(0xffB68439);
static const Color greyLightColor = Color(0xffB7B7B7);
static const Color greyHintColor = Color(0xffD1D1D1);
static const Color grey9FColor = Color(0xff9F9F9F);
static const Color greyF4Color = Color(0xffF4F4F4);
static const Color greyB5Color = Color(0xffB5B5B5);
static const Color greyBAColor = Color(0xffBABABA);
static const Color greyF8Color = Color(0xffF8F8F8);
static const Color greyC4Color = Color(0xffC4C4C4);
static const Color redLightColor = Color(0xffED9696);
static const Color greyA7Color = Color(0xffA7A7A7);

@ -42,8 +42,8 @@ extension StringExtension on String {
}
}
Widget toText(double fontSize, {Color color, bool isBold = false, int maxLines, FontStyle fontStyle, TextAlign textAlign}) {
double heightVal = (fontSize == 13) ? 16 : ((fontSize == 18) ? 22 : 14);
Widget toText(double fontSize, {Color color, bool isBold = false, int maxLines, FontStyle fontStyle, TextAlign textAlign, double height}) {
double heightVal = height ?? ((fontSize == 13) ? 16 : ((fontSize == 18 || fontSize == 30) ? 22 : 14));
return Text(
this,
maxLines: maxLines,

@ -7,10 +7,12 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:tangheem/new_ui/common_home_parent.dart';
import 'package:tangheem/ui/screens/bookmark_screen.dart';
import 'package:tangheem/ui/screens/change_password_screen.dart';
import 'package:tangheem/ui/screens/contact_us_screen.dart';
import 'package:tangheem/ui/screens/content_info_screen.dart';
import 'package:tangheem/ui/screens/member_screen.dart';
import 'package:tangheem/ui/screens/pdf_viewer_screen.dart';
import 'package:tangheem/ui/screens/user_profile_screen.dart';
import 'classes/colors.dart';
import 'ui/common_appbar.dart';
@ -44,9 +46,15 @@ class Application extends StatelessWidget {
onGenerateRoute: (settings) {
var className;
switch (settings.name) {
case UserProfileScreen.routeName:
className = CommonAppbar(child: UserProfileScreen());
break;
case LoginScreen.routeName:
className = CommonAppbar(child: LoginScreen());
break;
case ChangePasswordScreen.routeName:
className = CommonAppbar(child: ChangePasswordScreen());
break;
case RegistrationScreen.routeName:
className = CommonAppbar(child: RegistrationScreen());
break;

@ -16,6 +16,7 @@ import 'package:tangheem/models/content_info_model.dart';
import 'package:tangheem/models/navigation_model.dart';
import 'package:tangheem/models/quick_links_model.dart';
import 'package:tangheem/new_ui/screens/about_screen.dart';
import 'package:tangheem/ui/dialogs/app_menu_dialog.dart';
import 'package:tangheem/ui/dialogs/change_password_dialog.dart';
import 'package:tangheem/ui/dialogs/general_dialog.dart';
import 'package:tangheem/ui/screens/bookmark_screen.dart';
@ -53,6 +54,20 @@ class _CommonHomeParentState extends State<CommonHomeParent> {
@override
void initState() {
super.initState();
checkScreenMode();
getPrefs();
}
int fontSize;
void getPrefs() async {
prefs = await SharedPreferences.getInstance();
fontSize = prefs.getInt(GlobalConsts.fontZoomSize) ?? 18;
String userAuth = prefs.getString(GlobalConsts.userAuthData);
if (userAuth != null) {
AuthenticationUserModel authenticationUserModel = AuthenticationUserModel.fromJson(jsonDecode(userAuth));
AppState().setAuthenticationModel(authenticationUserModel);
}
}
@override
@ -65,7 +80,7 @@ class _CommonHomeParentState extends State<CommonHomeParent> {
if (MediaQuery.of(context).orientation == Orientation.portrait) {
await showDialog(
context: context,
barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
barrierColor: Colors.white.withOpacity(0.2),
builder: (BuildContext context) => GeneralDialog(),
);
}
@ -89,7 +104,7 @@ class _CommonHomeParentState extends State<CommonHomeParent> {
await prefs.setBool(GlobalConsts.doNotShowWelcomeVideo, false);
showDialog(
context: context,
barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
barrierColor: Colors.white.withOpacity(0.2),
builder: (BuildContext context) => VideoPlayerWidget(permLink),
);
}
@ -159,7 +174,7 @@ class _CommonHomeParentState extends State<CommonHomeParent> {
"assets/icons/new/intro.svg",
"assets/icons/new/quran.svg",
"assets/icons/new/search.svg",
"assets/icons/new/search.svg",
"assets/icons/new/members.svg",
];
List<double> sizes = [26, 26, 36, 26, 26];
@ -181,510 +196,48 @@ class _CommonHomeParentState extends State<CommonHomeParent> {
),
],
).onPress(() {
if (_index == 3) {
showMenu();
return;
}
if (index != _index)
setState(() {
index = _index;
});
});
}
}
//
// class CommonHomeParent extends StatefulWidget {
// final bool showDrawer;
// final Widget child;
// final bool isFirst;
//
// CommonHomeParent({Key key, this.showDrawer = false, @required this.child, this.isFirst = false}) : super(key: key);
//
// @override
// _CommonHomeParentState createState() {
// return _CommonHomeParentState();
// }
// }
//
// class _CommonHomeParentState extends State<CommonHomeParent> {
// // final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
// // List<QuickLinksData> quickLinks = [];
// // List<NavigationDataModel> navigationList = [];
// // ContentInfoDataModel _userCopyRight;
//
// @override
// void initState() {
// super.initState();
// // getPrefs();
// // getNavigation();
// // getQuickLinks();
// // getCopyRight();
// }
//
// // void getCopyRight() async {
// // if (AppState().getCopyRightContentInfoModel == null) {
// // try {
// // ContentInfoModel _userCopyRight = await TangheemUserApiClient().getContentInfo(3);
// // this._userCopyRight = _userCopyRight.data.first;
// // AppState().setCopyRightContentInfoModel(this._userCopyRight);
// // } catch (ex) {}
// // } else {
// // _userCopyRight = AppState().getCopyRightContentInfoModel;
// // }
// // setState(() {});
// // }
// //
// // void getNavigation() async {
// // if (AppState().getNavigationModel?.data == null) {
// // try {
// // var model = await TangheemUserApiClient().getNavigation();
// // navigationList = model?.data ?? [];
// // navigationList.removeWhere((element) => element.navigationId == 9); // this is for temporary, to release app on app store as file size are about 100 mbs
// // navigationList.sort((a, b) => a.orderNo.compareTo(b.orderNo));
// // AppState().setNavigationModel(model);
// // } catch (ex) {}
// // } else {
// // navigationList = AppState().getNavigationModel.data;
// // }
// // setState(() {});
// // }
// //
// // void getQuickLinks() async {
// // if (widget.showDrawer) {
// // try {
// // quickLinks = (await TangheemUserApiClient().quickLinks())?.data ?? [];
// // quickLinks = quickLinks.where((element) => element.position == "down").toList();
// // quickLinks.sort((a, b) => a.orderNo.compareTo(b.orderNo));
// // } catch (ex) {}
// // setState(() {});
// // }
// // }
// //
// // int fontSize;
// // SharedPreferences prefs;
// //
// // void getPrefs() async {
// // prefs = await SharedPreferences.getInstance();
// // fontSize = prefs.getInt(GlobalConsts.fontZoomSize) ?? 18;
// // String userAuth = prefs.getString(GlobalConsts.userAuthData);
// // if (userAuth != null) {
// // AuthenticationUserModel authenticationUserModel = AuthenticationUserModel.fromJson(jsonDecode(userAuth));
// // AppState().setAuthenticationModel(authenticationUserModel);
// // }
// // }
//
// // void deleteUserAccount() async {
// // Utils.showLoading(context);
// // try {
// // await UserApiClient().deleteAccount(AppState().userId);
// // SharedPreferences prefs = await SharedPreferences.getInstance();
// // await prefs.remove(GlobalConsts.userAuthData);
// // AppState().setAuthenticationModel(null);
// // Utils.showToast("تم حذف الحساب");
// // Navigator.pop(context);
// // Utils.hideLoading(context);
// // } catch (ex) {
// // if (mounted) {
// // Utils.hideLoading(context);
// // Utils.handleException(ex, null);
// // }
// // }
// // }
//
// @override
// void dispose() {
// super.dispose();
// }
//
// @override
// Widget build(BuildContext context) {
//
// return Scaffold(
// key: widget.showDrawer ? _scaffoldKey : null,
// drawer: widget.showDrawer ? drawerView() : null,
// resizeToAvoidBottomInset: true,
// drawerScrimColor: Colors.black.withOpacity(.3),
// body: SafeArea(
// child: Column(
// children: [
// Container(
// color: Colors.white,
// height: 100,
// padding: EdgeInsets.only(top: 8, bottom: 8, right: 16),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// if (!widget.isFirst)
// IconButton(
// icon: Icon(widget.showDrawer ? Icons.menu : Icons.arrow_back_ios, color: ColorConsts.textGrey),
// padding: EdgeInsets.only(left: 16),
// onPressed: () {
// if (widget.showDrawer) {
// _scaffoldKey.currentState.openDrawer();
// } else {
// Navigator.pop(context);
// }
// },
// ),
// if (!widget.showDrawer)
// IconButton(
// icon: Icon(Icons.home, color: ColorConsts.textGrey),
// padding: EdgeInsets.only(left: 16),
// onPressed: () {
// Navigator.popUntil(context, ModalRoute.withName(HomeScreen.routeName));
// },
// ),
// Expanded(child: SizedBox()),
// Hero(
// tag: "logo",
// child: SvgPicture.asset(
// "assets/logos/tangheem_logo.svg",
// height: 100,
// width: 100,
// alignment: Alignment.centerRight,
// ),
// )
// ],
// ),
// ),
// Expanded(
// child: Directionality(textDirection: TextDirection.rtl, child: widget.child),
// ),
// ],
// ),
// ),
// );
// }
//
// void updatePassword(String email, String oldPassword, String password) async {
// Utils.showLoading(context);
// try {
// await UserApiClient().updatePassword(email, oldPassword, password);
// } catch (ex) {
// if (mounted) Utils.handleException(ex, null);
// Utils.hideLoading(context);
// return;
// } finally {
// Utils.hideLoading(context);
// }
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.remove(GlobalConsts.userAuthData);
// AppState().setAuthenticationModel(null);
// await showDialog(
// context: context,
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
// builder: (BuildContext context) => GeneralDialog(message: "تم تغيير كلمة المرور بنجاح , الرجاء إعادة تسجيل الدخول من خلال الرابط المرسل إلى بريدك الإلكتروني"),
// );
// Navigator.pop(context);
// }
//
// Widget drawerView() {
// var height = MediaQuery.of(context).padding.top;
// return Drawer(
// elevation: 0,
// child: Container(
// color: Colors.white,
// child: SafeArea(
// bottom: true,
// top: false,
// right: false,
// left: false,
// maintainBottomViewPadding: true,
// child: Builder(
// builder: (context) {
// bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
// Widget listContents = ListView.builder(
// shrinkWrap: true,
// physics: BouncingScrollPhysics(),
// padding: EdgeInsets.only(left: 24, right: 24),
// itemCount: navigationList.length,
// itemBuilder: (context, index) {
// String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg";
// var subList = navigationList.where((element) => element.parentId == navigationList[index].navigationId).toList();
// return Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// if (navigationList[index].parentId == 1)
// myListItem(icon, navigationList[index].navigationText, navigationList[index].orderNo == 1 ? true : false, onTap: () {
// String url = navigationList[index]?.mobileNavigationUrl ?? "";
// if (url.isEmpty || url.length < 2) {
// return;
// }
// Navigator.pushNamed(context, url, arguments: null);
// }),
// for (var subItem in subList)
// Container(
// width: double.infinity,
// child: Row(
// children: [
// Expanded(
// child: myListItem("assets/icons/${subItem.mobileFontIcon}.svg", subItem.navigationText, false, onTap: () {
// String url = subItem.mobileNavigationUrl ?? "";
// if (url.isEmpty) {
// return;
// }
// var contentId;
// if (subItem.mobileNavigationUrl == "/introduction") {
// url = ContentInfoScreen.routeName;
// contentId = 2;
// } else if (subItem.mobileNavigationUrl == "/encyclopedia") {
// url = ContentInfoScreen.routeName;
// contentId = 1;
// } else if (subItem.mobileNavigationUrl == "/tangheempdf") {
// url = PdfListScreen.routeName;
// contentId = 8;
// }
// Navigator.pushNamed(context, url, arguments: contentId);
// }),
// ),
// Container(
// height: 40,
// margin: EdgeInsets.only(right: 17, left: 10),
// child: VerticalDivider(color: ColorConsts.primaryBlack, thickness: .7, width: 1),
// ),
// ],
// ),
// )
// ],
// );
// });
// if (isPortrait) {
// listContents = Expanded(child: listContents);
// }
// List<Widget> list = [
// Container(
// height: 100 + height,
// padding: EdgeInsets.only(left: 0, top: height),
// alignment: Alignment.centerLeft,
// child: IconButton(
// icon: Icon(Icons.clear, color: ColorConsts.textGrey),
// onPressed: () {
// if (_scaffoldKey.currentState.isDrawerOpen) {
// Navigator.pop(context);
// }
// },
// ),
// ),
// Container(
// margin: EdgeInsets.only(top: 8, bottom: 16),
// padding: EdgeInsets.only(left: 16, right: 16),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// commonIconButton("assets/icons/bookmark.svg", () {
// Navigator.pushNamed(context, BookmarkScreen.routeName);
// }),
// commonIconButton("assets/icons/increase_size.svg", () {
// if (fontSize >= 36) {
// Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
// return;
// }
// fontSize += 2;
// prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
// Utils.showToast("زيادة حجم الخط");
// }),
// commonIconButton("assets/icons/reduce_size.svg", () {
// if (fontSize <= 12) {
// Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
// return;
// }
// fontSize -= 2;
// prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
// Utils.showToast("تم تقليل حجم الخط");
// }),
// commonIconButton("assets/icons/user_logged.svg", () {
// if (AppState().isUserLogin) {
// Utils.showToast("أنت بالفعل تسجيل الدخول");
// return;
// }
// Navigator.pushNamed(context, LoginScreen.routeName);
// }),
// if (AppState().isUserLogin)
// Expanded(
// child: PopupMenuButton(
// padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
// onSelected: (int index) async {
// if (index == 0) {
// Navigator.pop(context);
// Future.delayed(Duration(milliseconds: 200), () {
// showDialog(
// context: context,
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
// builder: (BuildContext context) => ChangePasswordDialog(
// onPassword: (oldPassword, password) => updatePassword(AppState().userEmail, oldPassword, password),
// ),
// );
// });
// } else if (index == 1) {
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.remove(GlobalConsts.userAuthData);
// AppState().setAuthenticationModel(null);
// Utils.showToast("تسجيل خروج المستخدم");
// Navigator.pop(context);
// } else {
// await showDialog(
// context: context,
// barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8),
// builder: (BuildContext context) => GeneralDialog(
// message: 'بحذف حسابك ، ستتم إزالة بياناتك ولن تتمكن من استرداد حسابك. \ n انقر فوق "نعم" لحذف حسابك.',
// onTap: () {
// Navigator.pop(context);
// deleteUserAccount();
// },
// showCancelButton: true,
// ),
// );
// }
// },
// icon: SvgPicture.asset("assets/icons/fa_key.svg", height: 25, width: 30, color: ColorConsts.textGrey1),
// itemBuilder: (_) => <PopupMenuItem<int>>[
// PopupMenuItem(
// value: 0,
// padding: EdgeInsets.fromLTRB(4, 0, 4, 0),
// height: 36,
// child: Center(
// child: Text(
// 'تغيير كلمة المرور',
// style: TextStyle(color: ColorConsts.primaryBlack, fontSize: 16),
// ),
// ),
// ),
// PopupMenuItem(
// value: 1,
// padding: EdgeInsets.fromLTRB(4, 0, 4, 0),
// height: 36,
// child: Center(
// child: Text(
// 'تسجيل خروج',
// style: TextStyle(color: ColorConsts.primaryBlack, fontSize: 16),
// ),
// ),
// ),
// PopupMenuItem(
// value: 2,
// padding: EdgeInsets.fromLTRB(4, 0, 4, 0),
// height: 36,
// child: Center(
// child: Text(
// 'حذف الحساب',
// style: TextStyle(color: ColorConsts.primaryBlack, fontSize: 16),
// ),
// ),
// ),
// ]),
// ),
// ],
// ),
// ),
// listContents,
// Container(
// margin: EdgeInsets.only(top: 16, bottom: 12),
// padding: EdgeInsets.only(left: 32, right: 32),
// child: Row(
// children: [
// for (QuickLinksData _quickLink in quickLinks)
// commonIconButton(ApiConsts.baseUrl + _quickLink.exposeFilePath, () {
// //for live production server
// // commonIconButton( _quickLink.exposeFilePath, () {
// _launchURL(_quickLink.imageUrl);
// }, size: 35, isAsset: false),
// ],
// ),
// ),
// Padding(
// padding: EdgeInsets.only(left: 32, right: 32, bottom: 8),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// if (_userCopyRight != null) ...[
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// _userCopyRight.content,
// maxLines: 1,
// textAlign: TextAlign.right,
// style: TextStyle(fontSize: 12, color: Colors.black87),
// ),
// SizedBox(width: 8),
// Image.network(ApiConsts.baseUrl + _userCopyRight.exposeFilePath, height: 25, width: 30)
// ],
// ),
// SizedBox(height: 8),
// ],
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// "Powered by Cloud Solutions",
// maxLines: 1,
// textAlign: TextAlign.right,
// style: TextStyle(fontSize: 14, color: Colors.black87),
// ),
// SizedBox(width: 8),
// SvgPicture.asset("assets/logos/cloud_logo.svg", width: 30, height: 30)
// ],
// ),
// ],
// ),
// )
// ];
// return isPortrait ? Column(children: list) : ListView(children: list);
// },
// ),
// ),
// ),
// );
// }
//
// void _launchURL(String _url) async => await canLaunch(_url) ? await launch(_url) : throw 'Could not launch $_url';
//
// Widget commonIconButton(String icon, VoidCallback onPressed, {double size, bool isAsset = true}) {
// return Expanded(
// child: IconButton(
// padding: EdgeInsets.zero,
// icon: isAsset ? SvgPicture.asset(icon, height: size ?? 25, width: size ?? 30) : Image.network(icon, height: size ?? 25, width: size ?? 30),
// onPressed: () {
// Navigator.pop(context);
// Future.delayed(Duration(milliseconds: 200), () => onPressed());
// }),
// );
// }
//
// Widget myListItem(String icon, String title, bool isSelected, {VoidCallback onTap}) {
// return InkWell(
// onTap: () {
// Navigator.pop(context);
// if (onTap != null) {
// Future.delayed(Duration(milliseconds: 200), () => onTap());
// }
// },
// child: Container(
// height: 40,
// padding: EdgeInsets.only(left: 8, right: 8),
// alignment: Alignment.centerRight,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(6),
// gradient: isSelected
// ? LinearGradient(
// stops: [0.0, 0.5],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [ColorConsts.gradientPink, ColorConsts.gradientOrange],
// )
// : null,
// ),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// title,
// style: TextStyle(fontSize: 14, color: isSelected ? Colors.white : ColorConsts.textGrey),
// ),
// SizedBox(width: 8),
// SvgPicture.asset(icon, height: 20, width: 20, color: isSelected ? Colors.white : ColorConsts.textGrey),
// ],
// ),
// ),
// );
// }
// }
void showMenu() {
showDialog(
context: context,
barrierColor: Colors.white.withOpacity(0.2),
builder: (BuildContext context) => AppMenuDialog(
onFontDecrease: () {
if (fontSize <= 12) {
Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
return;
}
fontSize -= 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Utils.showToast("تم تقليل حجم الخط");
},
onFontIncrease: () {
if (fontSize >= 36) {
Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
return;
}
fontSize += 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Utils.showToast("زيادة حجم الخط");
},
goToIndex: (_index) {
Navigator.pop(context);
if (index != _index)
setState(() {
index = _index;
});
},
),
);
}
}

@ -45,7 +45,7 @@ class _HomeScreenState extends State<HomeScreen> {
SurahModel _surahModel;
TangheemType _tangheemType;
ContentInfoModel _contentInfoModel;
String _tangheemDiscription;
@override
void initState() {
@ -57,9 +57,21 @@ class _HomeScreenState extends State<HomeScreen> {
void getSurahAndTangheemTypes() async {
Utils.showLoading(context);
try {
_contentInfoModel = await TangheemUserApiClient().getContentInfo(4);
_surahModel = await TangheemUserApiClient().getSurahs();
AppState().setSurahModel(_surahModel);
if (AppState().tangheemDiscription == null) {
ContentInfoModel _contentInfoModel = await TangheemUserApiClient().getContentInfo(4);
_tangheemDiscription = _contentInfoModel.data.first.content;
AppState().tangheemDiscription = _tangheemDiscription;
} else {
_tangheemDiscription = AppState().tangheemDiscription;
}
if (AppState().getSurahModel == null) {
_surahModel = await TangheemUserApiClient().getSurahs();
AppState().setSurahModel(_surahModel);
} else {
_surahModel = AppState().getSurahModel;
}
_surahList = _surahModel.data.map((element) => element.nameAR).toList();
await getTangheemTypes();
TangheemUserApiClient().addStatistics(1);
@ -194,8 +206,7 @@ class _HomeScreenState extends State<HomeScreen> {
30.height,
"موسوعة النبر والتنغيم في الأداء القرآني للأساليب اللغوية".toText(18, color: ColorConsts.darkText, textAlign: TextAlign.center),
10.height,
"تساعدك موسوعة “تنغيم” على أداء الأساليب اللغوية القرآنية (كالاستفهام والإتمام والشرط والقسم) بما يخدم معنى الآية و قد أشرف عليها متخصصون في اللغة العربية والدراسات القرآنية"
.toText(12, color: ColorConsts.brownColor, textAlign: TextAlign.center),
(_tangheemDiscription ?? "").toText(12, color: ColorConsts.brownColor, textAlign: TextAlign.center),
SizedBox(height: 20),
ValueListenableBuilder(
valueListenable: _tangheemListNotifier,

@ -133,6 +133,7 @@ class _CommonAppbarState extends State<CommonAppbar> {
// drawer: widget.showDrawer ? drawerView() : null,
// resizeToAvoidBottomInset: true,
// drawerScrimColor: Colors.black.withOpacity(.3),
backgroundColor: ColorConsts.greyF4Color,
body: Stack(
children: [
// Container(

@ -0,0 +1,119 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:tangheem/app_state/app_state.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/ui/screens/bookmark_screen.dart';
import 'package:tangheem/ui/screens/login_screen.dart';
import 'package:tangheem/ui/screens/user_profile_screen.dart';
class AppMenuDialog extends StatelessWidget {
final VoidCallback onTap;
final Function(int) goToIndex;
final VoidCallback onFontIncrease;
final VoidCallback onFontDecrease;
AppMenuDialog({Key key, this.onTap, this.goToIndex, this.onFontIncrease, this.onFontDecrease}) : super(key: key);
@override
Widget build(BuildContext context) {
return BackdropFilter(
filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
child: Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 60.0, vertical: 24.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
elevation: 0,
backgroundColor: Colors.transparent,
child: Container(
width: MediaQuery.of(context).size.width * 245 / 375,
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.white.withOpacity(.91),
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
58.height,
menuItem("الرئيسية", "assets/icons/new/home.svg", 0),
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
menuItem("عن الموسوعة", "assets/icons/new/intro.svg", 1),
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
menuItem("اللجنة الإشرافية", "assets/icons/new/members.svg", 4),
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
menuItem("قراءة القرآن الكريم", "assets/icons/new/quran.svg", 2),
Row(
mainAxisSize: MainAxisSize.min,
children: [
menuOptions("assets/icons/new/bookmark.svg").onPress(() {
Navigator.pop(context);
Navigator.pushNamed(context, BookmarkScreen.routeName);
}),
14.width,
menuOptions("assets/icons/new/zoom_in.svg").onPress(onFontIncrease),
14.width,
menuOptions("assets/icons/new/zoom_out.svg").onPress(onFontDecrease),
14.width,
menuOptions("assets/icons/new/user_acount.svg").onPress(() {
Navigator.pop(context);
if (AppState().isUserLogin) {
Navigator.pushNamed(context, UserProfileScreen.routeName);
} else
Navigator.pushNamed(context, LoginScreen.routeName);
}),
],
).paddingOnly(top: 32, bottom: 32),
Container(
height: 26,
padding: EdgeInsets.only(right: 16, left: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32.0),
color: ColorConsts.brownLightColor,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Icon(Icons.play_arrow_outlined, size: 20, color: Colors.white),
"تصفح وتحميل الموسوعة".toText(13),
],
),
).onPress(() {
goToIndex(5);
})
],
),
),
),
);
}
Widget menuOptions(String icon) {
return SvgPicture.asset(
icon,
width: 25,
height: 25,
color: ColorConsts.greyBAColor,
);
}
Widget menuItem(String title, String icon, int index) {
return Column(
children: [
SvgPicture.asset(
icon,
width: 25,
height: 25,
color: ColorConsts.darkText,
),
6.height,
title.toText(13, color: ColorConsts.darkText)
],
).onPress(() => goToIndex(index));
}
}

@ -1,82 +1,102 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
class GeneralDialog extends StatelessWidget {
final String message;
final String buttonTitle;
final VoidCallback onTap;
final bool showCancelButton;
final Color backgroundColor;
final Color buttonBorderColor;
GeneralDialog({Key key, this.message, this.onTap, this.showCancelButton = false}) : super(key: key);
GeneralDialog({Key key, this.message, this.buttonTitle, this.onTap, this.showCancelButton = false, this.backgroundColor,this.buttonBorderColor}) : super(key: key);
@override
Widget build(BuildContext context) {
return Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 60.0, vertical: 24.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
elevation: 0,
backgroundColor: Colors.transparent,
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: ColorConsts.primaryBlue,
borderRadius: BorderRadius.circular(16),
return BackdropFilter(
filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
child: Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 60.0, vertical: 24.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
padding: EdgeInsets.symmetric(vertical: 32, horizontal: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
elevation: 0,
backgroundColor: Colors.transparent,
child: Stack(
children: [
Text(
message ?? "للحصول على تجربة أفضل ، يرجى إمالة هاتفك واستخدام التطبيق في الوضع الأفقي",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
SizedBox(height: 32),
Row(
children: [
if (showCancelButton)
Expanded(
child: SizedBox(
width: double.infinity,
height: 40,
child: TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
primary: Colors.black87,
padding: EdgeInsets.all(2),
backgroundColor: ColorConsts.textHintGrey,
textStyle: TextStyle(fontSize: 14, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0),
Container(
width: MediaQuery.of(context).size.width * 239 / 375,
decoration: BoxDecoration(
color: backgroundColor ?? ColorConsts.brownLightColor.withOpacity(0.60),
borderRadius: BorderRadius.circular(16),
),
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 16),
margin: EdgeInsets.only(top: 11),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
(message ?? "للحصول على تجربة أفضل ، يرجى إمالة هاتفك واستخدام التطبيق في الوضع الأفقي").toText(17, textAlign: TextAlign.center, height: 22),
18.height,
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (showCancelButton)
Expanded(
child: SizedBox(
width: double.infinity,
height: 36,
child: TextButton(
onPressed: () => Navigator.pop(context),
style: TextButton.styleFrom(
primary: Colors.black87,
padding: EdgeInsets.all(2),
backgroundColor: ColorConsts.textHintGrey,
textStyle: TextStyle(fontSize: 14, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0),
),
),
child: Text("لا"),
),
),
),
child: Text("لا"),
),
),
),
if (showCancelButton) SizedBox(width: 16),
Expanded(
child: SizedBox(
width: double.infinity,
height: 40,
child: TextButton(
onPressed: onTap ?? () => Navigator.pop(context),
style: TextButton.styleFrom(
primary: Colors.white,
padding: EdgeInsets.all(2),
backgroundColor: ColorConsts.secondaryPink,
textStyle: TextStyle(fontSize: 14, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0),
if (showCancelButton) SizedBox(width: 16),
SizedBox(
width: double.infinity,
height: 36,
child: TextButton(
onPressed: onTap ?? () => Navigator.pop(context),
style: TextButton.styleFrom(
// primary: Colors.white,
padding: EdgeInsets.all(0),
backgroundColor: Colors.transparent,
textStyle: TextStyle(fontSize: 14, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25.0), side: BorderSide(color: buttonBorderColor ?? Colors.white, width: 2)),
),
child: (buttonTitle ?? "تأكيد").toText(14),
),
),
child: Text("نعم"),
),
).paddingOnly(left: 50, right: 50).expanded,
],
),
),
],
],
),
),
Container(
height: 22,
width: 22,
margin: EdgeInsets.only(left: 16),
decoration: BoxDecoration(shape: BoxShape.circle, color: ColorConsts.brownLightColor),
child: Icon(
Icons.clear,
size: 16,
color: Colors.white,
),
).onPress(() => Navigator.pop(context)),
],
),
),

@ -3,6 +3,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/models/bookmark_model.dart';
import 'package:tangheem/models/surah_model.dart';
import 'package:tangheem/ui/misc/no_data_ui.dart';
@ -55,67 +58,95 @@ class _BookmarkScreenState extends State<BookmarkScreen> {
@override
Widget build(BuildContext context) {
return _bookMarkList.isEmpty
? NoDataUI()
: ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(16),
itemCount: _bookMarkList.length,
separatorBuilder: (context, index) {
return SizedBox(height: 8);
},
itemBuilder: (context, index) {
return Slidable(
controller: _slidableController,
actionPane: SlidableBehindActionPane(),
secondaryActions: <Widget>[
IconSlideAction(
color: Colors.redAccent,
icon: Icons.delete,
closeOnTap: true,
onTap: () {
_bookMarkList.removeAt(index);
BookMarkModel.saveToPrefs(_bookMarkList);
Utils.showToast("تم حذف المرجع");
setState(() {});
},
),
],
child: ListTile(
tileColor: Colors.white,
contentPadding: EdgeInsets.fromLTRB(12, 8, 12, 8),
onTap: () {
Navigator.pushNamed(context, QuranScreen.routeName, arguments: _bookMarkList[index]);
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
title: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
_bookMarkList[index].surahNameAR + ":",
style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue),
),
Text(
" ${_bookMarkList[index].numberInSurah}",
style: TextStyle(fontSize: 14, fontFamily: "BArabics", color: ColorConsts.secondaryOrange),
return Stack(
children: [
Stack(
alignment: Alignment.center,
children: [
AspectRatio(
aspectRatio: 375 / 215,
child: Image.asset("assets/icons/new/quran_bg.jpg", fit: BoxFit.cover, alignment: Alignment(-0.3, 0.5)),
),
Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 50),
26.height,
"المرجعية".toText(30),
],
).paddingOnly(top: 16),
],
),
_bookMarkList.isEmpty
? NoDataUI().paddingOnly(top: 215)
: ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 24, right: 24, top: 215, bottom: 24),
itemCount: _bookMarkList.length,
separatorBuilder: (context, index) {
return SizedBox(height: 8);
},
itemBuilder: (context, index) {
return Slidable(
controller: _slidableController,
actionPane: SlidableBehindActionPane(),
secondaryActions: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: IconSlideAction(
color: Colors.redAccent,
icon: Icons.delete,
closeOnTap: true,
onTap: () {
_bookMarkList.removeAt(index);
BookMarkModel.saveToPrefs(_bookMarkList);
Utils.showToast("تم حذف المرجع");
setState(() {});
},
),
),
],
),
subtitle: Text(
_bookMarkList[index].reverseAyatNumber(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: "UthmanicHafs",
fontSize: 16,
color: ColorConsts.primaryBlue,
fontWeight: FontWeight.bold,
),
),
),
);
},
);
child: Container(
width: double.infinity,
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: ColorConsts.greyE0Color, width: 1),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
(_bookMarkList[index].surahNameAR + ":").toText(12, color: ColorConsts.primaryBlue),
Text(
" ${_bookMarkList[index].numberInSurah}",
style: TextStyle(fontSize: 14, fontFamily: "BArabics", color: ColorConsts.secondaryOrange),
),
],
),
Text(
_bookMarkList[index].reverseAyatNumber(),
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: "UthmanicHafs",
fontSize: 16,
color: ColorConsts.primaryBlue,
fontWeight: FontWeight.bold,
),
),
],
),
).onPress(() {
Navigator.pushNamed(context, QuranScreen.routeName, arguments: _bookMarkList[index]);
}),
);
},
),
],
);
}
}

@ -0,0 +1,143 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tangheem/api/user_api_client.dart';
import 'package:tangheem/app_state/app_state.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/ui/dialogs/general_dialog.dart';
import 'package:tangheem/widgets/login_textfield_widget.dart';
class ChangePasswordScreen extends StatefulWidget {
static const String routeName = "/changePassword";
ChangePasswordScreen({Key key}) : super(key: key);
@override
_ChangePasswordScreenState createState() {
return _ChangePasswordScreenState();
}
}
class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
final TextEditingController _currentPasswordController = TextEditingController();
final TextEditingController _passwordController = TextEditingController();
final TextEditingController _confirmPasswordController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
void updatePassword(String email, String oldPassword, String password) async {
Utils.showLoading(context);
try {
await UserApiClient().updatePassword(email, oldPassword, password);
} catch (ex) {
if (mounted) Utils.handleException(ex, null);
Utils.hideLoading(context);
return;
} finally {
Utils.hideLoading(context);
}
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove(GlobalConsts.userAuthData);
AppState().setAuthenticationModel(null);
await showDialog(
context: context,
barrierColor: Colors.white.withOpacity(0.2),
builder: (BuildContext context) => GeneralDialog(
message: "تم تغيير كلمة المرور بنجاح , الرجاء إعادة تسجيل الدخول من خلال الرابط المرسل إلى بريدك الإلكتروني",
backgroundColor: Color(0xff598A8D),
),
);
Navigator.pop(context);
}
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
child: Stack(
alignment: Alignment.topCenter,
children: [
Image.asset(
"assets/icons/new/home_dark.jpg",
fit: BoxFit.cover,
height: double.infinity,
opacity: const AlwaysStoppedAnimation(1),
),
Container(color: ColorConsts.darkText.withOpacity(0.8)),
Column(
mainAxisSize: MainAxisSize.min,
children: [
100.height,
Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 50),
100.height,
Container(
width: 54,
height: 54,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: ColorConsts.dark2Text,
),
child: SvgPicture.asset(
"assets/icons/new/user_acount.svg",
color: Colors.white,
),
),
14.height,
(AppState().userName ?? "").toText(18),
50.height,
"تغيير كلمة المرور".toText(20),
24.height,
LoginTextFieldWidget(hint: "كلمة المرور الحالية", controller: _currentPasswordController, iconData: Icons.lock_rounded, isPassword: true, isForChangePassword: true),
10.height,
LoginTextFieldWidget(hint: "كلمة المرور الجديدة", controller: _passwordController, iconData: Icons.lock_rounded, isForChangePassword: true),
10.height,
LoginTextFieldWidget(hint: "تأكيد كلمة المرور الجديدة", controller: _confirmPasswordController, iconData: Icons.lock_rounded, isPassword: true, isForChangePassword: true),
16.height,
Container(
height: 45,
// width: 165,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32),
border: Border.all(color: ColorConsts.brownLightColor, width: 2),
),
child: "إعادة تعيين كلمة لمرور".toText(13),
).onPress(() {
if (_currentPasswordController.text.length < 1) {
Utils.showToast("يرجى إاخال كلمة المرور");
return;
}
if (_passwordController.text.length < 1) {
Utils.showToast("يرجى إاخال كلمة المرور");
return;
}
if (_confirmPasswordController.text.length < 1) {
Utils.showToast("يرجى تأكيد كلمة المرور");
return;
}
if (_passwordController.text != _confirmPasswordController.text) {
Utils.showToast("خطأ في تطابق كلمات المرور");
return;
}
updatePassword(AppState().userEmail, _currentPasswordController.text, _passwordController.text);
})
],
).paddingOnly(left: 65, right: 65),
],
),
);
}
}

@ -9,11 +9,15 @@ import 'package:tangheem/app_state/app_state.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/models/aya_model.dart';
import 'package:tangheem/models/aya_tangheem_type_mapped.dart';
import 'package:tangheem/models/bookmark_model.dart';
import 'package:tangheem/models/surah_model.dart';
import 'package:tangheem/widgets/common_dropdown_button.dart';
import 'package:tangheem/widgets/new/CommonHeader.dart';
import 'tangheem_detail_screen.dart';
@ -191,7 +195,6 @@ class _QuranScreenState extends State<QuranScreen> {
_currentSurahIndex = index;
}
String _surahAya = "";
_ayaModel?.data?.forEach((element) {
var temp = element.numberInSurah == 1
? getBismillahWithSurahName(element.surahID, element.surahNameAR, element.surahID != 1, _surahAya.length <= 1) + element.reverseAyatNumber()
@ -200,108 +203,76 @@ class _QuranScreenState extends State<QuranScreen> {
});
_surahAya = _surahAya + "\n" + "$_currentPage";
// _surahAya = _surahAya + "\n" + "$_currentPage";
List<Widget> widList = [
Text(
"اقرأ القرآن الكريم",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1),
),
SizedBox(height: 4),
Text(
"قراءة وسماع آيات القرآن الكريم",
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16, color: ColorConsts.primaryBlue),
),
SizedBox(height: 4),
Text(
"اضغط الآية المرغوبة لمزيد من التفاصيل",
style: TextStyle(
fontSize: 12,
color: ColorConsts.primaryBlue,
),
),
SizedBox(height: 16),
"اقرأ القرآن الكريم".toText(30),
8.height,
"اختر السورة والآيات التي تريد قراءتها".toText(14),
16.height,
CommonDropDownButton(
index: _selectedSurah,
hintText: "اختر السورة",
list: _surahList,
onSelect: (index) {
if (_selectedSurah != index) {
_selectedSurah = index;
_selectedToAya = -1;
_selectedFromAya = -1;
_toAyaList = [];
filterData();
}
}).paddingOnly(left: 41, right: 41),
10.height,
Row(
children: [
Expanded(
child: CommonDropDownButton(_selectedSurah, hintText: "اختر السورة", list: _surahList, onSelect: (index) {
if (_selectedSurah != index) {
_selectedSurah = index;
_selectedToAya = -1;
_selectedFromAya = -1;
_toAyaList = [];
filterData();
}
}),
child: CommonDropDownButton(
index: _selectedToAya,
hintText: "إلى الآية",
list: _toAyaList.map((e) => "إلى الآية" + " $e").toList(),
onSelect: (index) {
if (_selectedToAya != index) {
_selectedToAya = index;
setState(() {});
}
}),
),
SizedBox(width: 4),
12.width,
Expanded(
child: CommonDropDownButton(_selectedFromAya, hintText: "من الآية", list: _fromAyaList.map((e) => "من الآية" + " $e").toList(), onSelect: (index) {
if (_selectedFromAya != index) {
_selectedFromAya = index;
_selectedToAya = -1;
filteredAyahList.indexOf(_selectedFromAya);
_toAyaList = filteredAyahList.getRange(_selectedFromAya + 1, filteredAyahList.length)?.toList() ?? [];
setState(() {});
}
}),
),
SizedBox(width: 4),
Expanded(
child: CommonDropDownButton(_selectedToAya, hintText: "إلى الآية", list: _toAyaList.map((e) => "إلى الآية" + " $e").toList(), onSelect: (index) {
if (_selectedToAya != index) {
_selectedToAya = index;
setState(() {});
}
}),
child: CommonDropDownButton(
index: _selectedFromAya,
hintText: "من الآية",
list: _fromAyaList.map((e) => "من الآية" + " $e").toList(),
onSelect: (index) {
if (_selectedFromAya != index) {
_selectedFromAya = index;
_selectedToAya = -1;
filteredAyahList.indexOf(_selectedFromAya);
_toAyaList = filteredAyahList.getRange(_selectedFromAya + 1, filteredAyahList.length)?.toList() ?? [];
setState(() {});
}
}),
),
],
),
SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
commonIconButton("عرض", "assets/icons/go_forward.svg", () {
if (_selectedSurah < 0) {
Utils.showToast("يرجى اختيار السورة");
return;
} else {
if (_selectedFromAya < 0 && _selectedToAya < 0) {
_currentPage = _surahModel?.data[_selectedSurah]?.startPageNo;
getQuranByPageNo();
return;
}
if (_selectedFromAya >= 0 && _selectedToAya >= 0) {
getAyaByRange();
return;
}
}
}),
Row(
mainAxisSize: MainAxisSize.min,
children: [
zoomButtons("assets/icons/reduce_size.svg", () {
if (fontSize <= 12) {
Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
return;
}
fontSize -= 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
setState(() {});
}),
zoomButtons("assets/icons/increase_size.svg", () {
if (fontSize >= 36) {
Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
return;
}
fontSize += 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
setState(() {});
}),
],
)
],
),
SizedBox(height: 16),
).paddingOnly(left: 41, right: 41),
10.height,
commonIconButton(() {
if (_selectedSurah < 0) {
Utils.showToast("يرجى اختيار السورة");
return;
} else {
if (_selectedFromAya < 0 && _selectedToAya < 0) {
_currentPage = _surahModel?.data[_selectedSurah]?.startPageNo;
getQuranByPageNo();
return;
}
if (_selectedFromAya >= 0 && _selectedToAya >= 0) {
getAyaByRange();
return;
}
}
}).paddingOnly(left: 41, right: 41),
];
Widget quranTextView = SingleChildScrollView(
@ -311,16 +282,17 @@ class _QuranScreenState extends State<QuranScreen> {
child: quranText(),
),
);
if (MediaQuery.of(context).orientation == Orientation.portrait) {
quranTextView = Expanded(child: quranTextView);
}
// if (MediaQuery.of(context).orientation == Orientation.portrait) {
// quranTextView = Expanded(child: quranTextView);
// }
Widget quranView = Container(
margin: EdgeInsets.only(top: 4, bottom: 4),
padding: EdgeInsets.only(top: 16, bottom: 4, right: 16, left: 16),
margin: EdgeInsets.only(top: 28, bottom: 14),
padding: EdgeInsets.only(top: 16, bottom: 12, right: 16, left: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
color: ColorConsts.brownLightECColor,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: ColorConsts.brownB7CColor, width: 0.35),
),
child: Column(
mainAxisSize: MainAxisSize.min,
@ -328,17 +300,8 @@ class _QuranScreenState extends State<QuranScreen> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
nextOptionButton(
"assets/icons/prev.svg",
_currentSurahIndex <= 0 ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex - 1) ?? "",
_currentSurahIndex <= 0
? null
: (value) {
_currentPage = _surahModel?.data?.elementAt(_surahList.indexOf(value))?.startPageNo ?? _currentPage;
_clearFilterAndRefreshData();
}),
previousOptionButton(
"assets/icons/next.svg",
Icons.arrow_back_ios_rounded,
_currentSurahIndex >= (_surahList.isNotEmpty ? (_surahList.length - 1) : 0) ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex + 1) ?? "",
_currentSurahIndex >= (_surahList.isNotEmpty ? (_surahList.length - 1) : 0)
? null
@ -346,93 +309,156 @@ class _QuranScreenState extends State<QuranScreen> {
_currentPage = _surahModel?.data?.singleWhere((element) => element.nameAR == value)?.startPageNo ?? _currentPage;
_clearFilterAndRefreshData();
}),
nextOptionButton(
Icons.arrow_forward_ios_rounded,
_currentSurahIndex <= 0 ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex - 1) ?? "",
_currentSurahIndex <= 0
? null
: (value) {
_currentPage = _surahModel?.data?.elementAt(_surahList.indexOf(value))?.startPageNo ?? _currentPage;
_clearFilterAndRefreshData();
}),
],
),
quranTextView,
SizedBox(height: 4),
if (_selectedFromAya == -1 && _selectedToAya == -1)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
nextOptionButton(
"assets/icons/prev_single.svg",
"الصفحة السابقة",
_currentPage <= 1
? null
: (value) {
_currentPage = _currentPage - 1;
_clearFilterAndRefreshData();
}),
previousOptionButton(
"assets/icons/next_single.svg",
"الصفحة التالية",
_currentPage == 604
? null
: (value) {
_currentPage = _currentPage + 1;
_clearFilterAndRefreshData();
}),
],
),
quranText(),
Row(
children: [
Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset("assets/icons/new/dimension.svg", width: 12, color: ColorConsts.brownLightColor),
"ت".toText(12, color: ColorConsts.brownLightColor),
],
).onPress(() {
if (fontSize <= 12) {
Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
return;
}
fontSize -= 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
setState(() {});
}),
12.width,
Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset("assets/icons/new/dimension.svg", width: 16, color: ColorConsts.brownLightColor),
"ت".toText(16, color: ColorConsts.brownLightColor),
],
).onPress(() {
if (fontSize >= 36) {
Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
return;
}
fontSize += 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
setState(() {});
})
],
)
// quranTextView,
],
),
);
if (MediaQuery.of(context).orientation == Orientation.portrait) {
quranView = Expanded(child: quranView);
}
List<Widget> finalViewList = <Widget>[] + widList + [if (_surahAya.isNotEmpty) quranView];
// if (MediaQuery.of(context).orientation == Orientation.portrait) {
// quranView = Expanded(child: quranView);
// }
List<Widget> finalViewList = <Widget>[] +
widList +
[
if (_surahAya.isNotEmpty && _surahAya.length > 2) ...[
quranView,
if (_selectedFromAya == -1 && _selectedToAya == -1)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
previousOptionButton(
Icons.arrow_back_ios_rounded,
"الصفحة التالية",
_currentPage == 604
? null
: (value) {
_currentPage = _currentPage + 1;
_clearFilterAndRefreshData();
}),
nextOptionButton(
Icons.arrow_forward_ios_rounded,
"الصفحة السابقة",
_currentPage <= 1
? null
: (value) {
_currentPage = _currentPage - 1;
_clearFilterAndRefreshData();
}),
],
),
]
];
var multiModeView;
if (MediaQuery.of(context).orientation == Orientation.portrait) {
multiModeView = Padding(
padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: finalViewList,
),
);
} else {
multiModeView = ListView(
padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
physics: BouncingScrollPhysics(),
children: finalViewList,
);
}
return SizedBox(width: double.infinity, child: multiModeView);
// if (MediaQuery.of(context).orientation != Orientation.portrait) {
// multiModeView = Padding(
// padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: finalViewList,
// ),
// );
// } else {
// multiModeView = ListView(
// padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
// physics: BouncingScrollPhysics(),
// children: finalViewList,
// );
// }
multiModeView = SingleChildScrollView(
padding: EdgeInsets.fromLTRB(24, 96, 24, 140),
physics: BouncingScrollPhysics(),
child: Column(children: finalViewList),
);
return SizedBox(
width: double.infinity,
child: Stack(
children: [
AspectRatio(
aspectRatio: 375 / 345,
child: Image.asset("assets/icons/new/quran_bg.jpg", fit: BoxFit.cover, alignment: Alignment(-0.7, 0.5)),
),
multiModeView
],
),
);
}
Widget commonIconButton(String title, String iconString, VoidCallback callback) {
Widget commonIconButton(VoidCallback callback) {
return InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: callback,
child: Container(
height: 36,
alignment: Alignment.center,
decoration: BoxDecoration(
color: callback == null ? ColorConsts.secondaryPink.withOpacity(.5) : ColorConsts.secondaryPink,
borderRadius: BorderRadius.circular(6),
color: callback == null ? ColorConsts.brownLightColor.withOpacity(.5) : ColorConsts.brownLightColor.withOpacity(.5),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
maxLines: 1,
style: TextStyle(fontSize: 12, color: Colors.white),
),
SizedBox(width: 12),
SvgPicture.asset(iconString, width: 20, height: 20, color: Colors.white),
Transform.rotate(angle: 1, child: Icon(Icons.play_arrow_outlined, size: 20, color: ColorConsts.brownLightColor)),
8.width,
"البحث".toText(14, color: ColorConsts.brownLightColor),
],
),
),
);
}
Widget nextOptionButton(String icon, String text, Function(String) onPressed) {
Widget nextOptionButton(IconData icon, String text, Function(String) onPressed) {
return InkWell(
onTap: () => onPressed(text),
child: onPressed == null
@ -441,12 +467,8 @@ class _QuranScreenState extends State<QuranScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(icon, height: 12, width: 12),
SizedBox(width: 4),
Text(
text,
style: TextStyle(color: ColorConsts.textGrey),
),
text.toText(10, color: ColorConsts.greyA7Color),
Icon(icon, color: ColorConsts.greyA7Color, size: 10),
],
),
);
@ -486,7 +508,7 @@ class _QuranScreenState extends State<QuranScreen> {
);
}
Widget previousOptionButton(String icon, String text, Function(String) onPressed) {
Widget previousOptionButton(IconData icon, String text, Function(String) onPressed) {
return InkWell(
onTap: () => onPressed(text),
child: onPressed == null
@ -495,12 +517,8 @@ class _QuranScreenState extends State<QuranScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Text(
text,
style: TextStyle(color: ColorConsts.textGrey),
),
SizedBox(width: 4),
SvgPicture.asset(icon, height: 12, width: 12),
Icon(icon, color: ColorConsts.greyA7Color, size: 10),
text.toText(10, color: ColorConsts.greyA7Color),
],
),
);
@ -521,7 +539,7 @@ class _QuranScreenState extends State<QuranScreen> {
backgroundColor: _selectedAyaForBookmark?.ayahID == element.ayahID ? ColorConsts.secondaryOrange.withOpacity(.4) : Colors.transparent,
fontFamily: "UthmanicHafs",
fontSize: fontSize.toDouble(),
color: ColorConsts.primaryBlue,
color: ColorConsts.brownB6CColor,
fontWeight: FontWeight.bold,
),
recognizer: TapGestureRecognizer()
@ -540,17 +558,17 @@ class _QuranScreenState extends State<QuranScreen> {
_surahAya = _surahAya + temp + " ";
});
textSpanList.add(
TextSpan(
text: "\n" + "$_currentPage",
style: TextStyle(
fontFamily: "BArabics",
fontSize: fontSize.toDouble(),
color: ColorConsts.primaryBlue,
fontWeight: FontWeight.bold,
),
),
);
// textSpanList.add( // comment fot test
// TextSpan(
// text: "\n" + "$_currentPage",
// style: TextStyle(
// fontFamily: "BArabics",
// fontSize: fontSize.toDouble(),
// color: ColorConsts.primaryBlue,
// fontWeight: FontWeight.bold,
// ),
// ),
// );
_surahAya = _surahAya + "\n" + "$_currentPage";
@ -639,6 +657,65 @@ class _QuranScreenState extends State<QuranScreen> {
onPressed: onPressed,
);
}
Widget CommonDropDownButton(
{int index = 0, String hintText = "", String icon, Color iconColor, Color color, bool isDropDown = true, VoidCallback onPressed, Function(int) onSelect, double widthHeight, List<String> list}) {
return InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: onPressed,
child: Container(
height: 34,
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: ColorConsts.borderDarkText, width: .75),
),
padding: EdgeInsets.only(left: 17, right: 17),
child: DropdownButtonHideUnderline(
child: DropdownButton<int>(
isExpanded: isDropDown,
dropdownColor: ColorConsts.secondaryWhite,
iconSize: 0,
hint: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Icon(Icons.arrow_drop_down_sharp, color: ColorConsts.borderDarkText),
Text(
(list.isEmpty || index < 0) ? hintText : list[index],
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
style: TextStyle(fontSize: 14, color: ColorConsts.brownColor),
).expanded,
],
),
focusColor: Colors.white,
style: TextStyle(color: Colors.white),
items: !isDropDown
? []
: [
for (int i = 0; i < list.length; i++)
DropdownMenuItem<int>(
value: i,
child: SizedBox(
width: double.infinity,
child: Text(
list[i],
maxLines: 1,
textDirection: TextDirection.rtl,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 14, color: ColorConsts.primaryBlack),
),
),
)
],
onChanged: onSelect,
),
),
),
);
}
}
class TangheemTemp {

@ -16,7 +16,9 @@ import 'package:tangheem/app_state/app_state.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/models/aya_tangheem_type_mapped.dart';
import 'package:tangheem/models/discussion_model.dart';
import 'package:tangheem/ui/dialogs/discussion_input_dialog.dart';
@ -431,43 +433,40 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
),
),
),
SizedBox(height: 8),
discussionView(_discussionModel?.data ?? []),
if (_dataList.isNotEmpty)
Container(
margin: EdgeInsets.only(top: 8),
padding: EdgeInsets.only(bottom: 20),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
Container(
height: 60,
width: double.infinity,
margin: EdgeInsets.only(bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(
color: ColorConsts.primaryBlue,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
Column(
children: [
16.height,
Container(
height: 38,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ColorConsts.brownB1CColor,
borderRadius: BorderRadius.only(
topRight: Radius.circular(20.0),
topLeft: Radius.circular(20.0),
),
child: Text(
"قائمة الأساليب اللغوية في هذه الآية",
style: TextStyle(fontSize: 16, color: Colors.white),
),
child: "قائمة الأساليب اللغوية في هذه الآية".toText(16),
),
Container(
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(width: 1, color: ColorConsts.greyE0Color),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
ListView.separated(
padding: EdgeInsets.fromLTRB(4, 8, 4, 4),
child: ListView.separated(
padding: EdgeInsets.all(16),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: _dataList.length,
separatorBuilder: (context, index) => SizedBox(height: 16),
separatorBuilder: (context, index) => Divider(height: 1, thickness: 1, color: ColorConsts.greyE0Color).paddingOnly(top: 12, bottom: 12),
itemBuilder: (context, index) {
print(index);
return InkWell(
onTap: () {
List<AyatTangheemTypeMappedData> list = _dataList;
@ -486,11 +485,13 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
);
},
),
],
),
),
],
),
SizedBox(height: 16),
AyaRecordWidget()
AyaRecordWidget(),
SizedBox(height: 16),
discussionView(_discussionModel?.data ?? []),
],
),
),
@ -762,80 +763,80 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
children: [
Container(
margin: EdgeInsets.only(top: 4, bottom: 25),
padding: EdgeInsets.all(8),
padding: EdgeInsets.all(0),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
color: Colors.transparent,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: ColorConsts.greyE0Color, width: 1),
),
child: _discussionList.length > 0
? ListView.separated(
padding: EdgeInsets.only(top: 4, bottom: 24),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: _discussionList.length,
separatorBuilder: (context, index) => SizedBox(height: 16),
itemBuilder: (context, index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 38,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ColorConsts.brownB1CColor,
borderRadius: BorderRadius.only(
topRight: Radius.circular(20.0),
topLeft: Radius.circular(20.0),
),
),
child: "التعليقات".toText(16),
),
_discussionList.isNotEmpty
? ListView.separated(
padding: EdgeInsets.only(top: 4, bottom: 24, left: 8, right: 8),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: _discussionList.length,
separatorBuilder: (context, index) => Divider(height: 1, thickness: 1, color: ColorConsts.greyE0Color).paddingOnly(top: 12, bottom: 12),
itemBuilder: (context, index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
"assets/icons/chat_user.svg",
width: 60,
height: 60,
Row(
children: [
SvgPicture.asset(
"assets/icons/chat_user.svg",
width: 60,
height: 60,
),
SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
"تعليق على الآية ${_ayatTangheemTypeMappedFirstData.ayatNumberInSurahs}".toText(16, color: ColorConsts.primaryBlue, isBold: true),
SizedBox(height: 4),
Directionality(
textDirection: TextDirection.ltr,
child: _discussionList[index].date.toFormattedDate().toText(12, color: ColorConsts.textGrey),
),
],
),
],
),
SizedBox(width: 8),
SizedBox(height: 4),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"تعليق على الآية ${_ayatTangheemTypeMappedFirstData.ayatNumberInSurahs}",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: ColorConsts.primaryBlue, height: 1.5),
),
SizedBox(height: 4),
Directionality(
textDirection: TextDirection.ltr,
child: Text(
_discussionList[index].date.toFormattedDate(),
style: TextStyle(fontSize: 12, color: ColorConsts.textGrey, height: 1),
),
),
("تعليق من: " + _discussionList[index].userName).toText(14, isBold: true, color: ColorConsts.primaryBlue),
_discussionList[index].discussionText.toText(14, color: ColorConsts.textGrey),
if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty) SizedBox(height: 4),
if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty) ("رد من المسؤول: " + _discussionList[index].adminResponse).toText(14, color: ColorConsts.textGrey),
],
)
],
),
SizedBox(height: 4),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"تعليق من: " + _discussionList[index].userName,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: ColorConsts.primaryBlue, height: 1.5),
),
Text(
_discussionList[index].discussionText,
style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1.4),
),
if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty) SizedBox(height: 4),
if ((_discussionList[index]?.adminResponse ?? "").isNotEmpty)
Text(
"رد من المسؤول: " + _discussionList[index].adminResponse,
style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1.4),
),
],
)
],
);
},
)
: Text(
"لا يوجد تعليقات",
style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue, height: 1.5),
),
);
},
)
: "لا يوجد تعليقات".toText(14, color: ColorConsts.primaryBlue).paddingOnly(bottom: 24, top: 12),
],
),
),
Positioned(
bottom: 0,
@ -843,7 +844,8 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
borderRadius: BorderRadius.circular(30),
onTap: () async {
if (!AppState().isUserLogin) {
Widget cancelButton = TextButton(style: TextButton.styleFrom(backgroundColor: ColorConsts.sliderBackground,foregroundColor: ColorConsts.primaryBlack),
Widget cancelButton = TextButton(
style: TextButton.styleFrom(backgroundColor: ColorConsts.sliderBackground, foregroundColor: ColorConsts.primaryBlack),
child: Text("أرغب بالتسجيل"),
onPressed: () async {
Navigator.pop(context);
@ -853,7 +855,8 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
}
},
);
Widget continueButton = TextButton(style: TextButton.styleFrom(backgroundColor: ColorConsts.sliderBackground,foregroundColor: ColorConsts.primaryBlack),
Widget continueButton = TextButton(
style: TextButton.styleFrom(backgroundColor: ColorConsts.sliderBackground, foregroundColor: ColorConsts.primaryBlack),
child: Text("استمرار كضيف"),
onPressed: () {
Navigator.pop(context);
@ -862,7 +865,7 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
);
AlertDialog alert = AlertDialog(
content: Text("هذه الخاصية متاحه فقط للأعضاء المسجلين"),
actionsAlignment:MainAxisAlignment.spaceEvenly,
actionsAlignment: MainAxisAlignment.spaceEvenly,
actions: [
cancelButton,
continueButton,
@ -886,24 +889,14 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
);
},
child: Container(
height: 40,
padding: EdgeInsets.only(left: 24, right: 24),
alignment: Alignment.centerRight,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: ColorConsts.gradientPink,
gradient: LinearGradient(
stops: [0.0, 0.5],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [ColorConsts.gradientPink, ColorConsts.gradientOrange],
height: 40,
padding: EdgeInsets.only(left: 28, right: 28),
alignment: Alignment.centerRight,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: ColorConsts.greenLightColor,
),
),
child: Text(
"إضافة تعليق",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Colors.white, height: 1.5),
),
),
child: "إضافة تعليق".toText(14)),
),
),
],

@ -3,10 +3,14 @@ import 'package:flutter/material.dart';
import 'package:tangheem/api/tangheem_user_api_client.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/models/aya_tangheem_type_mapped.dart';
import 'package:tangheem/models/surah_model.dart';
import 'package:tangheem/ui/misc/no_data_ui.dart';
import 'package:tangheem/ui/screens/tangheem_detail_screen.dart';
import 'package:tangheem/widgets/new/CommonHeader.dart';
import 'package:tangheem/widgets/text_highlight_widget.dart';
class TangheemScreen extends StatefulWidget {
@ -108,88 +112,106 @@ class _TangheemScreenState extends State<TangheemScreen> {
Widget build(BuildContext context) {
return _dataList == null
? SizedBox()
: _dataList.isEmpty
? NoDataUI()
: ListView.separated(
controller: _controller,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(16),
itemCount: _dataList.length,
separatorBuilder: (context, index) {
return SizedBox(height: 8);
},
itemBuilder: (context, index) {
return InkWell(
onTap: () {
if (widget.tangheemQuery == null) {
List<AyatTangheemTypeMappedData> list = <AyatTangheemTypeMappedData>[] + _dataList;
var removedData = _dataList[index];
list.remove(removedData);
list.insert(0, removedData);
list = list?.where((element) => (element.ayahNos.contains(removedData.ayahNos)) && (element.tangheemTypeId == removedData.tangheemTypeId))?.toList() ?? [];
TangheemDetailParams tangheem = TangheemDetailParams(selectedTangheemTypeId: removedData.ayaTangheemTypeId, ayatTangheemTypeMappedDataList: list);
Navigator.pushNamed(context, TangheemDetailScreen.routeName, arguments: tangheem);
} else {
var removedData = _dataList[index];
getTangheemDataForTangheem(removedData.surahNo, removedData.ayatNumberInSurahs, removedData.tangheemTypeId, removedData.ayaTangheemTypeId);
}
},
borderRadius: BorderRadius.circular(4),
child: Container(
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
_dataList[index].surahNameAr + ":",
style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue),
),
Text(
" ${_dataList[index].ayatNumberInSurahs}",
style: TextStyle(fontSize: 14, fontFamily: "BArabics", color: ColorConsts.secondaryOrange),
),
SizedBox(width: 4),
Text(
"(${_dataList[index].tangheemTypeName})",
style: TextStyle(fontSize: 12, color: ColorConsts.secondaryOrange),
),
],
: Stack(
children: [
Stack(
alignment: Alignment.center,
children: [
AspectRatio(
aspectRatio: 375 / 215,
child: Image.asset("assets/icons/new/quran_bg.jpg", fit: BoxFit.cover, alignment: Alignment(-0.3, 0.5)),
),
Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 50),
26.height,
widget.tangheemTypeName.toText(30),
8.height,
"${widget.surah.nameAR}".toText(12, color: ColorConsts.brownB6CColor),
],
).paddingOnly(top: 16),
],
),
_dataList.isEmpty
? NoDataUI().paddingOnly(top: 215)
: ListView.separated(
controller: _controller,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 24, right: 24, top: 215, bottom: 138),
itemCount: _dataList.length,
separatorBuilder: (context, index) {
return SizedBox(height: 12);
},
itemBuilder: (context, index) {
return InkWell(
onTap: () {
if (widget.tangheemQuery == null) {
List<AyatTangheemTypeMappedData> list = <AyatTangheemTypeMappedData>[] + _dataList;
var removedData = _dataList[index];
list.remove(removedData);
list.insert(0, removedData);
list = list?.where((element) => (element.ayahNos.contains(removedData.ayahNos)) && (element.tangheemTypeId == removedData.tangheemTypeId))?.toList() ?? [];
TangheemDetailParams tangheem = TangheemDetailParams(selectedTangheemTypeId: removedData.ayaTangheemTypeId, ayatTangheemTypeMappedDataList: list);
Navigator.pushNamed(context, TangheemDetailScreen.routeName, arguments: tangheem);
} else {
var removedData = _dataList[index];
getTangheemDataForTangheem(removedData.surahNo, removedData.ayatNumberInSurahs, removedData.tangheemTypeId, removedData.ayaTangheemTypeId);
}
},
borderRadius: BorderRadius.circular(4),
child: Container(
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: ColorConsts.greyE0Color, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
(_dataList[index].surahNameAr + ":").toText(12, color: ColorConsts.primaryBlue),
Text(
" ${_dataList[index].ayatNumberInSurahs}",
style: TextStyle(fontSize: 14, fontFamily: "BArabics", color: ColorConsts.secondaryOrange),
),
4.width,
"(${_dataList[index].tangheemTypeName})".toText(12, color: ColorConsts.secondaryOrange),
],
),
TextHighLightLengthWidget(
text: _dataList[index].reverseAyatNumber(),
startIndex: _dataList[index].startIndex,
endIndex: _dataList[index].endIndex,
textAlign: TextAlign.start,
highlightAya: _dataList[index].highlightText,
highlightAyaNos: _dataList[index].highlightAyaNos ?? "",
ayahTextList: _dataList[index].ayahTextList,
),
// TextHighLightWidget(
// text: _dataList[index].reverseAyatNumber(),
// valueColor: ColorConsts.secondaryOrange,
// highlights: [_dataList[index].highlightText],
// textAlign: TextAlign.start,
// style: TextStyle(
// fontFamily: "UthmanicHafs",
// fontSize: 16,
// color: ColorConsts.primaryBlue,
// fontWeight: FontWeight.bold,
// ),
// ),
],
),
),
TextHighLightLengthWidget(
text: _dataList[index].reverseAyatNumber(),
startIndex: _dataList[index].startIndex,
endIndex: _dataList[index].endIndex,
textAlign: TextAlign.start,
highlightAya: _dataList[index].highlightText,
highlightAyaNos: _dataList[index].highlightAyaNos ?? "",
ayahTextList: _dataList[index].ayahTextList,
),
// TextHighLightWidget(
// text: _dataList[index].reverseAyatNumber(),
// valueColor: ColorConsts.secondaryOrange,
// highlights: [_dataList[index].highlightText],
// textAlign: TextAlign.start,
// style: TextStyle(
// fontFamily: "UthmanicHafs",
// fontSize: 16,
// color: ColorConsts.primaryBlue,
// fontWeight: FontWeight.bold,
// ),
// ),
],
),
);
},
),
);
},
);
],
);
}
}

@ -0,0 +1,138 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tangheem/api/user_api_client.dart';
import 'package:tangheem/app_state/app_state.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:tangheem/ui/dialogs/change_password_dialog.dart';
import 'package:tangheem/ui/dialogs/general_dialog.dart';
import 'package:tangheem/ui/screens/change_password_screen.dart';
class UserProfileScreen extends StatefulWidget {
static const String routeName = "/profile";
UserProfileScreen({Key key}) : super(key: key);
@override
_UserProfileScreenState createState() {
return _UserProfileScreenState();
}
}
class _UserProfileScreenState extends State<UserProfileScreen> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
void deleteUserAccount() async {
Utils.showLoading(context);
try {
await UserApiClient().deleteAccount(AppState().userId);
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove(GlobalConsts.userAuthData);
AppState().setAuthenticationModel(null);
Utils.showToast("تم حذف الحساب");
Navigator.pop(context);
Utils.hideLoading(context);
} catch (ex) {
if (mounted) {
Utils.hideLoading(context);
Utils.handleException(ex, null);
}
}
}
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
child: Stack(
alignment: Alignment.topCenter,
children: [
Image.asset(
"assets/icons/new/home_dark.jpg",
fit: BoxFit.cover,
height: double.infinity,
opacity: const AlwaysStoppedAnimation(1),
),
Container(color: ColorConsts.darkText.withOpacity(0.8)),
Column(
mainAxisSize: MainAxisSize.min,
children: [
100.height,
Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 50),
100.height,
Container(
width: 78,
height: 78,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: ColorConsts.dark2Text,
),
child: SvgPicture.asset(
"assets/icons/new/user_acount.svg",
color: Colors.white,
),
),
14.height,
(AppState().userName ?? "").toText(25),
50.height,
button("تغيير كلمة المرور").onPress(() {
Navigator.pushNamed(context, ChangePasswordScreen.routeName);
}),
Container(width: 50, height: 1, color: ColorConsts.dark99Text).paddingOnly(top: 15, bottom: 15),
button("تسجيل الخروج").onPress(() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove(GlobalConsts.userAuthData);
AppState().setAuthenticationModel(null);
Utils.showToast("تسجيل خروج المستخدم");
Navigator.pop(context);
}),
Container(width: 50, height: 1, color: ColorConsts.dark99Text).paddingOnly(top: 15, bottom: 15),
button("حذف الحساب").onPress(() {
showDialog(
context: context,
barrierColor: Colors.white.withOpacity(0.2),
builder: (BuildContext context) => GeneralDialog(
message: "هل تود حذف حسابك عبر تطبيق تنغيم؟",
backgroundColor: Color(0xff598A8D),
buttonTitle: "تأكيد الحذف",
buttonBorderColor: ColorConsts.brownLightColor,
onTap: () {
Navigator.pop(context);
deleteUserAccount();
},
),
);
}),
],
),
],
),
);
}
Widget button(String title) {
return Container(
height: 36,
width: 165,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32),
border: Border.all(color: Colors.white, width: 1),
),
child: title.toText(13),
);
}
}

@ -8,6 +8,8 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:record_mp3/record_mp3.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
class AyaRecordWidget extends StatefulWidget {
AyaRecordWidget({Key key}) : super(key: key);
@ -100,179 +102,172 @@ class _AyaRecordWidgetState extends State<AyaRecordWidget> {
@override
Widget build(BuildContext context) {
return Stack(
alignment: Alignment.bottomCenter,
return Column(
children: [
Container(
margin: EdgeInsets.only(top: 4, bottom: 20),
padding: EdgeInsets.only(bottom: 20),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
Container(
height: 60,
width: double.infinity,
margin: EdgeInsets.only(bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(
color: ColorConsts.primaryBlue,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
height: 38,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: ColorConsts.brownB1CColor,
borderRadius: BorderRadius.only(
topRight: Radius.circular(20.0),
topLeft: Radius.circular(20.0),
),
),
child: "سجل الآية بصوتك".toText(16)),
Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
margin: EdgeInsets.only(bottom: 35),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 16, right: 16),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(width: 1, color: ColorConsts.greyE0Color),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
"assets/icons/mic_icon.svg",
width: 25,
height: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
// if (!(recordFilePath != null && File(recordFilePath).existsSync())) SizedBox(height: 16),
if (recordFilePath != null && File(recordFilePath).existsSync())
Container(
height: 50,
margin: EdgeInsets.only(bottom: 14),
padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
Expanded(
child: StreamBuilder<Duration>(
stream: _audioPlayer.positionStream,
builder: (context, snapshot) {
final state = snapshot.data;
return SliderTheme(
data: SliderTheme.of(context).copyWith(
inactiveTrackColor: ColorConsts.sliderBackground,
activeTrackColor: ColorConsts.secondaryOrange,
trackHeight: 3.0,
thumbColor: ColorConsts.primaryBlack,
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 6.0),
overlayColor: ColorConsts.primaryBlack.withAlpha(32),
overlayShape: RoundSliderOverlayShape(overlayRadius: 6.0),
),
child: Directionality(
textDirection: TextDirection.ltr,
child: Slider(
value: (state?.inSeconds ?? 0) + 0.0,
min: 0,
max: (_audioPlayer?.duration?.inSeconds ?? 0) + 0.0,
onChanged: (value) {},
),
),
);
},
),
),
SizedBox(width: 8),
StreamBuilder<Duration>(
stream: _audioPlayer.positionStream,
builder: (context, snapshot) {
final state = snapshot.data;
return Text(
_durationTime(state) ?? "",
style: TextStyle(color: ColorConsts.textGrey1, height: 1.1, fontFamily: "Roboto", fontSize: 16),
);
},
),
SizedBox(width: 8),
StreamBuilder<PlayerState>(
stream: _audioPlayer.playerStateStream,
builder: (context, snapshot) {
final state = snapshot.data?.playing ?? false;
if (state) {
if (_audioPlayer?.duration?.inSeconds == _audioPlayer?.position?.inSeconds) {
_audioPlayer.pause();
_audioPlayer.seek(Duration.zero);
}
}
return IconButton(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
constraints: BoxConstraints(),
padding: EdgeInsets.only(right: 0),
icon: SvgPicture.asset(state ? "assets/icons/pause.svg" : "assets/icons/play_aya.svg", height: 16, width: 16),
onPressed: () {
state
? _audioPlayer.pause()
: _isAudioHaveError
? Utils.showToast("خطأ في تحميل ملف الصوت")
: play();
});
},
),
],
),
),
SizedBox(width: 12),
Text(
"سجل الآية بصوتك",
style: TextStyle(fontSize: 18, color: Colors.white),
InkWell(
borderRadius: BorderRadius.circular(20),
onTap: () async {
if (await _requestStoragePermission()) {
if (recordFilePath != null && File(recordFilePath).existsSync()) {
saveToPhoneStorage(recordFilePath);
} else {
Utils.showToast("يجب عليك تسجيل صوتك أولا");
}
} else {
Utils.showToast("يجب أن تمنح الإذن لتنزيل التسجيل");
}
},
child: Container(
height: 31,
width: 125,
padding: EdgeInsets.only(left: 24, right: 24),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: ColorConsts.greenLightColor,
),
child: "تحميل التسجيل".toText(14),
),
],
),
),
],
),
InkWell(
onTap: () {
),
Positioned(
right: 24,
child: Container(
height: 80,
width: 80,
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _isRecording ? Color(0xffe5ced3) : Color(0xffD3E5CE),
border: Border.all(
width: 1,
color: _isRecording ? Color(0xffc6b0ae) : Color(0xffAEC6B5),
),
),
child: SvgPicture.asset("assets/icons/new/mic.svg", color: Colors.white),
).onPress(
() {
if (_isRecording) {
stopRecord();
} else {
startRecord();
}
},
child: SvgPicture.asset(
_isRecording ? "assets/icons/recording_on.svg" : "assets/icons/recording_off.svg",
width: 60,
height: 60,
),
),
if (!(recordFilePath != null && File(recordFilePath).existsSync())) SizedBox(height: 16),
if (recordFilePath != null && File(recordFilePath).existsSync())
Container(
height: 50,
margin: EdgeInsets.all(16),
padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration(
color: ColorConsts.secondaryWhite,
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
Expanded(
child: StreamBuilder<Duration>(
stream: _audioPlayer.positionStream,
builder: (context, snapshot) {
final state = snapshot.data;
return SliderTheme(
data: SliderTheme.of(context).copyWith(
inactiveTrackColor: ColorConsts.sliderBackground,
activeTrackColor: ColorConsts.secondaryOrange,
trackHeight: 3.0,
thumbColor: ColorConsts.primaryBlack,
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 6.0),
overlayColor: ColorConsts.primaryBlack.withAlpha(32),
overlayShape: RoundSliderOverlayShape(overlayRadius: 6.0),
),
child: Directionality(
textDirection: TextDirection.ltr,
child: Slider(
value: (state?.inSeconds ?? 0) + 0.0,
min: 0,
max: (_audioPlayer?.duration?.inSeconds ?? 0) + 0.0,
onChanged: (value) {},
),
),
);
},
),
),
SizedBox(width: 8),
StreamBuilder<Duration>(
stream: _audioPlayer.positionStream,
builder: (context, snapshot) {
final state = snapshot.data;
return Text(
_durationTime(state) ?? "",
style: TextStyle(color: ColorConsts.textGrey1, height: 1.1, fontFamily: "Roboto", fontSize: 16),
);
},
),
SizedBox(width: 8),
StreamBuilder<PlayerState>(
stream: _audioPlayer.playerStateStream,
builder: (context, snapshot) {
final state = snapshot.data?.playing ?? false;
if (state) {
if (_audioPlayer?.duration?.inSeconds == _audioPlayer?.position?.inSeconds) {
_audioPlayer.pause();
_audioPlayer.seek(Duration.zero);
}
}
return IconButton(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
constraints: BoxConstraints(),
padding: EdgeInsets.only(right: 0),
icon: SvgPicture.asset(state ? "assets/icons/pause.svg" : "assets/icons/play_aya.svg", height: 16, width: 16),
onPressed: () {
state
? _audioPlayer.pause()
: _isAudioHaveError
? Utils.showToast("خطأ في تحميل ملف الصوت")
: play();
});
},
),
],
),
)
],
),
),
Positioned(
bottom: 0,
child: InkWell(
borderRadius: BorderRadius.circular(30),
onTap: () async {
if (await _requestStoragePermission()) {
if (recordFilePath != null && File(recordFilePath).existsSync()) {
saveToPhoneStorage(recordFilePath);
} else {
Utils.showToast("يجب عليك تسجيل صوتك أولا");
}
} else {
Utils.showToast("يجب أن تمنح الإذن لتنزيل التسجيل");
}
},
child: Container(
height: 40,
padding: EdgeInsets.only(left: 24, right: 24),
alignment: Alignment.centerRight,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: ColorConsts.gradientPink,
gradient: LinearGradient(
stops: [0.0, 0.5],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [ColorConsts.gradientPink, ColorConsts.gradientOrange],
),
),
child: Text(
"تنزيل التسجيل",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Colors.white, height: 1.5),
),
),
),
],
),
],
);

@ -7,53 +7,102 @@ class LoginTextFieldWidget extends StatelessWidget {
final TextEditingController controller;
final bool isPassword;
final IconData iconData;
final bool isForChangePassword;
LoginTextFieldWidget({@required this.hint, @required this.controller, this.isPassword = false, @required this.iconData, Key key}) : super(key: key);
LoginTextFieldWidget({@required this.hint, @required this.controller, this.isForChangePassword = false, this.isPassword = false, @required this.iconData, Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return TextField(
textAlignVertical: TextAlignVertical.center,
controller: controller,
obscureText: isPassword,
textInputAction: TextInputAction.next,
style: TextStyle(color: Colors.white, fontSize: 14, fontFamily: "Montserrat"),
cursorColor: Colors.white,
maxLines: 1,
scrollPhysics: BouncingScrollPhysics(),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 19, bottom: 19, right: 32, left: 4),
alignLabelWithHint: true,
fillColor: Color(0xff598A8D),
filled: true,
hintStyle: TextStyle(color: Colors.white, fontSize: 14, fontFamily: "Montserrat"),
hintText: hint,
suffixIcon: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 1,
height: 14,
color: Colors.white.withOpacity(.6),
return isForChangePassword
? SizedBox(
height: 45,
child: TextField(
textAlignVertical: TextAlignVertical.center,
controller: controller,
obscureText: isPassword,
textInputAction: TextInputAction.next,
style: TextStyle(color: Colors.white, fontSize: 11, fontFamily: "Montserrat"),
cursorColor: Colors.white,
cursorWidth: 1,
maxLines: 1,
scrollPhysics: BouncingScrollPhysics(),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 15, bottom: 15, right: 17, left: 4),
alignLabelWithHint: true,
fillColor: Color(0xff598A8D),
filled: true,
hintStyle: TextStyle(color: Colors.white, fontSize: 11, fontFamily: "Montserrat"),
hintText: hint,
suffixIcon: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 1,
height: 14,
color: Colors.white.withOpacity(.6),
),
12.width,
Icon(
iconData,
color: Colors.white.withOpacity(0.6),
size: 20,
),
],
).paddingOnly(left: 17),
suffixIconConstraints: BoxConstraints(),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25),
borderSide: BorderSide(color: Colors.transparent, width: 1),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(25),
borderSide: BorderSide(color: Colors.transparent, width: 1),
),
),
),
14.width,
Icon(
iconData,
color: Colors.white.withOpacity(0.6),
size: 20,
)
: TextField(
textAlignVertical: TextAlignVertical.center,
controller: controller,
obscureText: isPassword,
textInputAction: TextInputAction.next,
style: TextStyle(color: Colors.white, fontSize: 14, fontFamily: "Montserrat"),
cursorColor: Colors.white,
maxLines: 1,
scrollPhysics: BouncingScrollPhysics(),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 19, bottom: 19, right: 32, left: 4),
alignLabelWithHint: true,
fillColor: Color(0xff598A8D),
filled: true,
hintStyle: TextStyle(color: Colors.white, fontSize: 14, fontFamily: "Montserrat"),
hintText: hint,
suffixIcon: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 1,
height: 14,
color: Colors.white.withOpacity(.6),
),
14.width,
Icon(
iconData,
color: Colors.white.withOpacity(0.6),
size: 20,
),
],
).paddingOnly(left: 24),
suffixIconConstraints: BoxConstraints(),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.transparent, width: 1),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.transparent, width: 1),
),
),
],
).paddingOnly(left: 24),
suffixIconConstraints: BoxConstraints(),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.transparent, width: 1),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.transparent, width: 1),
),
),
);
);
}
}
}

@ -6,13 +6,14 @@ class CommonHeader extends StatelessWidget {
final String title;
final Color gradiantColor;
final String assetImage;
final double ratio;
CommonHeader(this.title, this.assetImage, this.gradiantColor, {Key key}) : super(key: key);
CommonHeader(this.title, this.assetImage, this.gradiantColor, {Key key,this.ratio}) : super(key: key);
@override
Widget build(BuildContext context) {
return AspectRatio(
aspectRatio: 469 / 313,
aspectRatio: ratio ?? 469 / 313,
child: Stack(
alignment: Alignment.center,
children: [

@ -1,7 +1,12 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/extensions/int_extensions.dart';
import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/extensions/widget_extensions.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
class VideoPlayerWidget extends StatefulWidget {
@ -38,75 +43,64 @@ class _VideoPlayerWidgetState extends State<VideoPlayerWidget> {
@override
Widget build(BuildContext context) {
return Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 24.0, vertical: 24.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
elevation: 0,
backgroundColor: Colors.transparent,
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: ColorConsts.primaryBlue,
borderRadius: BorderRadius.circular(16),
return BackdropFilter(
filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
child: Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 24.0, vertical: 24.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
padding: EdgeInsets.symmetric(vertical: MediaQuery.of(context).orientation == Orientation.portrait ? 32 : 16, horizontal: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
elevation: 0,
backgroundColor: Colors.transparent,
child: Stack(
alignment: Alignment.topCenter,
children: [
MediaQuery.of(context).orientation == Orientation.portrait ? videoPlayer() : Expanded(child: videoPlayer()),
SizedBox(height: 8),
Row(
children: [
Expanded(
child: Text(
"لا تظهر مرة أخرى",
textAlign: TextAlign.right,
style: TextStyle(color: Colors.white),
),
),
SizedBox(width: 16),
SizedBox(
width: 12,
height: 12,
child: Checkbox(
value: doNotShowAgain,
side: BorderSide(color: Colors.white),
activeColor: ColorConsts.secondaryPink,
onChanged: (value) {
setState(() {
doNotShowAgain = value;
});
},
),
),
],
),
SizedBox(height: 16),
SizedBox(
width: double.infinity,
height: 40,
child: TextButton(
onPressed: () async {
if (doNotShowAgain) {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setBool(GlobalConsts.doNotShowWelcomeVideo, doNotShowAgain);
}
Navigator.pop(context);
},
style: TextButton.styleFrom(
primary: Colors.white,
padding: EdgeInsets.all(2),
backgroundColor: ColorConsts.secondaryPink,
textStyle: TextStyle(fontSize: 14, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0),
),
),
child: Text("أغلق"),
Container(
width: MediaQuery.of(context).size.width * 273 / 375,
margin: EdgeInsets.only(top: 11),
decoration: BoxDecoration(
color: ColorConsts.darkText.withOpacity(.60),
borderRadius: BorderRadius.circular(16),
),
padding: EdgeInsets.only(top: 24, bottom: 12),
// padding: EdgeInsets.symmetric(vertical: MediaQuery.of(context).orientation == Orientation.portrait ? 24 : 24, horizontal: 0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
MediaQuery.of(context).orientation == Orientation.portrait ? videoPlayer() : Expanded(child: videoPlayer()),
12.height,
SizedBox(
width: double.infinity,
height: 30,
child: TextButton(
onPressed: () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setBool(GlobalConsts.doNotShowWelcomeVideo, doNotShowAgain);
Navigator.pop(context);
},
style: TextButton.styleFrom(
// primary: Colors.white,
padding: EdgeInsets.all(0),
backgroundColor: Colors.transparent,
textStyle: TextStyle(fontSize: 14, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25.0), side: BorderSide(color: Colors.white, width: 2)),
),
child: "لا تظهر مرة أخرى".toText(14),
),
).paddingOnly(left: 12, right: 12),
],
),
),
Container(
height: 22,
width: 22,
decoration: BoxDecoration(shape: BoxShape.circle, color: ColorConsts.brownLightColor),
child: Icon(
Icons.clear,
size: 16,
color: Colors.white,
),
).onPress(() => Navigator.pop(context)),
],
),
),

Loading…
Cancel
Save