diff --git a/android/app/build.gradle b/android/app/build.gradle index c0dde8f..5b954fa 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -53,23 +53,23 @@ android { multiDexEnabled true } - signingConfigs { - release { - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null - storePassword keystoreProperties['storePassword'] - } - } +// signingConfigs { +// release { +// keyAlias keystoreProperties['keyAlias'] +// keyPassword keystoreProperties['keyPassword'] +// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null +// storePassword keystoreProperties['storePassword'] +// } +// } buildTypes { debug { signingConfig signingConfigs.debug } - release { - minifyEnabled true - shrinkResources true - signingConfig signingConfigs.release - } +// release { +// minifyEnabled true +// shrinkResources true +// signingConfig signingConfigs.release +// } } } diff --git a/assets/fonts/Helvetica-Neue-W23-for-SKY-Bold.ttf b/assets/fonts/Helvetica-Neue-W23-for-SKY-Bold.ttf new file mode 100644 index 0000000..8106bd0 Binary files /dev/null and b/assets/fonts/Helvetica-Neue-W23-for-SKY-Bold.ttf differ diff --git a/assets/fonts/Helvetica-Neue-W23-for-SKY-Regular.ttf b/assets/fonts/Helvetica-Neue-W23-for-SKY-Regular.ttf new file mode 100644 index 0000000..afdf570 Binary files /dev/null and b/assets/fonts/Helvetica-Neue-W23-for-SKY-Regular.ttf differ diff --git a/assets/fonts/Montserrat-Bold.ttf b/assets/fonts/Montserrat-Bold.ttf new file mode 100644 index 0000000..efddc83 Binary files /dev/null and b/assets/fonts/Montserrat-Bold.ttf differ diff --git a/assets/fonts/Montserrat-Regular.ttf b/assets/fonts/Montserrat-Regular.ttf new file mode 100644 index 0000000..aa9033a Binary files /dev/null and b/assets/fonts/Montserrat-Regular.ttf differ diff --git a/assets/icons/new/Tangeem-logo-W.png b/assets/icons/new/Tangeem-logo-W.png new file mode 100644 index 0000000..5e7b723 Binary files /dev/null and b/assets/icons/new/Tangeem-logo-W.png differ diff --git a/assets/icons/new/Tangeem-logo.png b/assets/icons/new/Tangeem-logo.png new file mode 100644 index 0000000..ceaae55 Binary files /dev/null and b/assets/icons/new/Tangeem-logo.png differ diff --git a/assets/icons/new/about_bg.jpg b/assets/icons/new/about_bg.jpg new file mode 100644 index 0000000..f2f0447 Binary files /dev/null and b/assets/icons/new/about_bg.jpg differ diff --git a/assets/icons/new/commette_bg.jpg b/assets/icons/new/commette_bg.jpg new file mode 100644 index 0000000..d6e6a54 Binary files /dev/null and b/assets/icons/new/commette_bg.jpg differ diff --git a/assets/icons/new/contact_bg.jpg b/assets/icons/new/contact_bg.jpg new file mode 100644 index 0000000..262d9f8 Binary files /dev/null and b/assets/icons/new/contact_bg.jpg differ diff --git a/assets/icons/new/contact_us.svg b/assets/icons/new/contact_us.svg new file mode 100644 index 0000000..ae4bbb4 --- /dev/null +++ b/assets/icons/new/contact_us.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/assets/icons/new/download_pdf.svg b/assets/icons/new/download_pdf.svg new file mode 100644 index 0000000..0a5c0af --- /dev/null +++ b/assets/icons/new/download_pdf.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/icons/new/home.svg b/assets/icons/new/home.svg new file mode 100644 index 0000000..2f0cf49 --- /dev/null +++ b/assets/icons/new/home.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/assets/icons/new/home_dark.jpg b/assets/icons/new/home_dark.jpg new file mode 100644 index 0000000..da44513 Binary files /dev/null and b/assets/icons/new/home_dark.jpg differ diff --git a/assets/icons/new/home_light.jpg b/assets/icons/new/home_light.jpg new file mode 100644 index 0000000..2428744 Binary files /dev/null and b/assets/icons/new/home_light.jpg differ diff --git a/assets/icons/new/intro.svg b/assets/icons/new/intro.svg new file mode 100644 index 0000000..c84db91 --- /dev/null +++ b/assets/icons/new/intro.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/assets/icons/new/pdf_bg.jpg b/assets/icons/new/pdf_bg.jpg new file mode 100644 index 0000000..90d646a Binary files /dev/null and b/assets/icons/new/pdf_bg.jpg differ diff --git a/assets/icons/new/pdf_bg1.jpg b/assets/icons/new/pdf_bg1.jpg new file mode 100644 index 0000000..ede2101 Binary files /dev/null and b/assets/icons/new/pdf_bg1.jpg differ diff --git a/assets/icons/new/quran.svg b/assets/icons/new/quran.svg new file mode 100644 index 0000000..7cffd3e --- /dev/null +++ b/assets/icons/new/quran.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/assets/icons/new/quran_bg.jpg b/assets/icons/new/quran_bg.jpg new file mode 100644 index 0000000..fc2be1b Binary files /dev/null and b/assets/icons/new/quran_bg.jpg differ diff --git a/assets/icons/new/search.svg b/assets/icons/new/search.svg new file mode 100644 index 0000000..7fd5de5 --- /dev/null +++ b/assets/icons/new/search.svg @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/assets/icons/new/surah_left.svg b/assets/icons/new/surah_left.svg new file mode 100644 index 0000000..ba6133b --- /dev/null +++ b/assets/icons/new/surah_left.svg @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/assets/icons/new/surah_right.svg b/assets/icons/new/surah_right.svg new file mode 100644 index 0000000..45134d7 --- /dev/null +++ b/assets/icons/new/surah_right.svg @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 7a3c3e4..80f6d0c 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -1,6 +1,7 @@ import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:tangheem/models/authentication_user_model.dart'; import 'package:tangheem/models/content_info_model.dart'; +import 'package:tangheem/models/member_model.dart'; import 'package:tangheem/models/navigation_model.dart'; import 'package:tangheem/models/surah_model.dart'; @@ -64,4 +65,10 @@ class AppState { void setAnalytics(FirebaseAnalytics _analytics) { this._analytics = _analytics; } + + List membersList; + List haqooqAlMosasa; + List tareefAlMosasa; + + } diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index e6dad2e..62b4a7f 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -20,4 +20,22 @@ class ColorConsts { static const Color textHintGrey = Color(0xffcccccc); static const Color sliderBackground = Color(0xffdfdfdf); + + + static const Color darkText = Color(0xff416A6C); + static const Color borderDarkText = Color(0xff03A67B); + static const Color borderDark2Text = Color(0xff2CB9B0); + static const Color borderColor = Color(0xffDDDDDD); + static const Color brownColor = Color(0xffDAE8646); + static const Color brownLightColor = Color(0xffAE8646); + 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 greyF8Color = Color(0xffF8F8F8); + static const Color greyC4Color = Color(0xffC4C4C4); + static const Color redLightColor = Color(0xffED9696); + + + } diff --git a/lib/extensions/int_extensions.dart b/lib/extensions/int_extensions.dart new file mode 100644 index 0000000..556959d --- /dev/null +++ b/lib/extensions/int_extensions.dart @@ -0,0 +1,14 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +extension IntExtensions on int { + Widget get height => SizedBox(height: toDouble()); + + Widget get width => SizedBox(width: toDouble()); + + //Widget get divider => Divider(height: toDouble(), thickness: toDouble(), color: MyColors.lightGreyEFColor); + + Widget get makeItSquare => SizedBox(width: toDouble(), height: toDouble()); + + +} diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index a565faa..98902be 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -1,6 +1,7 @@ +import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -extension EmailValidator on String { +extension StringExtension on String { bool isValidEmail() { return RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(this); } @@ -40,4 +41,21 @@ extension EmailValidator on String { return "December"; } } + + Widget toText(double fontSize, {Color color, bool isBold = false, int maxLines, FontStyle fontStyle, TextAlign textAlign}) { + double heightVal = (fontSize == 13) ? 16 : ((fontSize == 18) ? 22 : 14); + return Text( + this, + maxLines: maxLines, + textAlign: textAlign, + style: TextStyle( + fontSize: fontSize ?? 14, + fontStyle: fontStyle ?? FontStyle.normal, + fontWeight: isBold ? FontWeight.bold : FontWeight.w400, + color: color ?? Colors.white, + fontFamily: "Montserrat", + height: heightVal / fontSize, + ), + ); + } } diff --git a/lib/extensions/widget_extensions.dart b/lib/extensions/widget_extensions.dart new file mode 100644 index 0000000..df4ced6 --- /dev/null +++ b/lib/extensions/widget_extensions.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +extension WidgetExtensions on Widget { + Widget onPress(VoidCallback onTap) => InkWell(onTap: onTap, child: this); + + Widget get expanded => Expanded(child: this); + + Widget get center => Center(child: this); + + Widget circle(double _value) => ClipRRect(borderRadius: BorderRadius.circular(_value), child: this); + + Widget paddingAll(double _value) => Padding(padding: EdgeInsets.all(_value), child: this); + + Widget paddingOnly({double left = 0.0, double right = 0.0, double top = 0.0, double bottom = 0.0}) => + Padding(padding: EdgeInsets.only(left: left, right: right, top: top, bottom: bottom), child: this); + + Widget toExpanded({int flex = 1}) => Expanded(flex: flex, child: this); + + // Widget toShimmer({bool isShow = true}) => isShow + // ? Shimmer.fromColors( + // baseColor: Color(0xffe8eff0), + // highlightColor: Colors.white, + // child: Container( + // color: Colors.white, + // child: this, + // ), + // ) + // : Container( + // child: this, + // ); + + + +} diff --git a/lib/main.dart b/lib/main.dart index 7775eed..752969e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,7 @@ import 'package:firebase_analytics/observer.dart'; import 'package:firebase_core/firebase_core.dart'; 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/contact_us_screen.dart'; import 'package:tangheem/ui/screens/content_info_screen.dart'; @@ -14,7 +15,7 @@ import 'package:tangheem/ui/screens/pdf_viewer_screen.dart'; import 'classes/colors.dart'; import 'ui/common_appbar.dart'; import 'ui/screens/forgot_password_screen.dart'; -import 'ui/screens/home_screen.dart'; +import 'new_ui/screens/home_screen.dart'; import 'ui/screens/login_screen.dart'; import 'ui/screens/quran_screen.dart'; @@ -53,7 +54,7 @@ class Application extends StatelessWidget { className = CommonAppbar(child: ForgotPasswordScreen()); break; case HomeScreen.routeName: - className = CommonAppbar(showDrawer: true, child: HomeScreen(analytics)); + className = CommonHomeParent(); break; case ContactUsScreen.routeName: className = CommonAppbar(child: ContactUsScreen()); @@ -124,7 +125,7 @@ class Application extends StatelessWidget { ThemeData lightTheme() { return ThemeData( - fontFamily: 'DroidKufi', + fontFamily: 'HelveticaNeue', brightness: Brightness.light, backgroundColor: ColorConsts.secondaryWhite, primarySwatch: Colors.blue, diff --git a/lib/new_ui/common_home_parent.dart b/lib/new_ui/common_home_parent.dart new file mode 100644 index 0000000..820c430 --- /dev/null +++ b/lib/new_ui/common_home_parent.dart @@ -0,0 +1,690 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:tangheem/api/tangheem_user_api_client.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/string_extensions.dart'; +import 'package:tangheem/extensions/widget_extensions.dart'; +import 'package:tangheem/models/authentication_user_model.dart'; +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/change_password_dialog.dart'; +import 'package:tangheem/ui/dialogs/general_dialog.dart'; +import 'package:tangheem/ui/screens/bookmark_screen.dart'; +import 'package:tangheem/ui/screens/content_info_screen.dart'; +import 'package:tangheem/new_ui/screens/home_screen.dart'; +import 'package:tangheem/ui/screens/login_screen.dart'; +import 'package:tangheem/ui/screens/member_screen.dart'; +import 'package:tangheem/ui/screens/pdf_viewer_screen.dart'; +import 'package:tangheem/ui/screens/quran_screen.dart'; +import 'package:tangheem/widgets/video_player_widget.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class CommonHomeParent extends StatefulWidget { + CommonHomeParent({Key key}) : super(key: key); + + @override + _CommonHomeParentState createState() { + return _CommonHomeParentState(); + } +} + +class _CommonHomeParentState extends State { + int index = 0; + SharedPreferences prefs; + + List screens = [ + HomeScreen(), + AboutScreen(), + QuranScreen(), + ContentInfoScreen(contentId: 2), + MemberScreen(), + PdfListScreen(), + ]; + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + void checkScreenMode() { + WidgetsBinding.instance.addPostFrameCallback((_) async { + if (MediaQuery.of(context).orientation == Orientation.portrait) { + await showDialog( + context: context, + barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8), + builder: (BuildContext context) => GeneralDialog(), + ); + } + showWelcomeVideoDialog(); + }); + } + + void showWelcomeVideoDialog() async { + prefs = await SharedPreferences.getInstance(); + String permLink = "-PqP0BCiTlE"; + String link = prefs.getString(GlobalConsts.welcomeVideoUrl) ?? permLink; + if (permLink == link) { + await prefs.setString(GlobalConsts.welcomeVideoUrl, permLink); + bool showDialog = prefs.getBool(GlobalConsts.doNotShowWelcomeVideo) ?? false; + if (showDialog) { + return; + } + } else { + await prefs.setString(GlobalConsts.welcomeVideoUrl, permLink); + } + await prefs.setBool(GlobalConsts.doNotShowWelcomeVideo, false); + showDialog( + context: context, + barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8), + builder: (BuildContext context) => VideoPlayerWidget(permLink), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color(0xffF4F4F4), + body: SafeArea( + bottom: true, + left: false, + top: false, + right: false, + child: Stack( + children: [ + screens[index], + Align( + alignment: Alignment.bottomCenter, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + height: 58, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(29.0), + color: Colors.white, + border: Border.all(color: ColorConsts.borderColor, width: 1), + ), + padding: EdgeInsets.only(left: 30, right: 30), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [for (int i = 0; i < icons.length; i++) getBottomNavigationItem(i)], + ), + ), + Container( + height: 26, + margin: EdgeInsets.only(top: 16), + padding: EdgeInsets.only(right: 16, left: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(29.0), + color: ColorConsts.brownLightColor, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon(Icons.play_arrow_outlined, size: 20, color: Colors.white), + "تصفح وتحميل الموسوعة".toText(13), + ], + ), + ).onPress(() { + if (index != 5) + setState(() { + index = 5; + }); + }), + ], + ).paddingOnly(left: 16, right: 16, bottom: 16), + ), + ], + ), + ), + ); + } + + List icons = [ + "assets/icons/new/home.svg", + "assets/icons/new/intro.svg", + "assets/icons/new/quran.svg", + "assets/icons/new/search.svg", + "assets/icons/new/search.svg", + ]; + List sizes = [26, 26, 36, 26, 26]; + + Widget getBottomNavigationItem(int _index) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset( + icons[_index], + width: sizes[_index], + height: sizes[_index], + color: index == _index ? ColorConsts.brownColor : ColorConsts.darkText, + ).expanded, + if (index == _index) + Container( + height: 3, + color: ColorConsts.brownColor, + width: sizes[_index], + ), + ], + ).onPress(() { + 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 { +// // final GlobalKey _scaffoldKey = new GlobalKey(); +// // List quickLinks = []; +// // List 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 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( +// 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), +// ], +// ), +// ), +// ); +// } +// } diff --git a/lib/new_ui/screens/about_screen.dart b/lib/new_ui/screens/about_screen.dart new file mode 100644 index 0000000..38875c8 --- /dev/null +++ b/lib/new_ui/screens/about_screen.dart @@ -0,0 +1,89 @@ +import 'package:flutter/material.dart'; +import 'package:tangheem/api/tangheem_user_api_client.dart'; +import 'package:tangheem/app_state/app_state.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/content_info_model.dart'; +import 'package:tangheem/widgets/new/CommonHeader.dart'; + +class AboutScreen extends StatefulWidget { + AboutScreen({Key key}) : super(key: key); + + @override + _AboutScreenState createState() { + return _AboutScreenState(); + } +} + +class _AboutScreenState extends State { + List haqooqAlMosasa; + List tareefAlMosasa; + + @override + void initState() { + super.initState(); + haqooqAlMosasa = AppState().haqooqAlMosasa; + tareefAlMosasa = AppState().tareefAlMosasa; + getContents(); + } + + void getContents() async { + Utils.showLoading(context); + try { + if (haqooqAlMosasa == null && tareefAlMosasa == null) { + List responseList = await Future.wait([TangheemUserApiClient().getContentInfo(2), if (haqooqAlMosasa == null) TangheemUserApiClient().getContentInfo(1)]); + tareefAlMosasa = responseList[0].data ?? []; + AppState().tareefAlMosasa = tareefAlMosasa; + if (haqooqAlMosasa == null) { + haqooqAlMosasa = responseList[1].data ?? []; + AppState().haqooqAlMosasa = haqooqAlMosasa; + } + } else { + await Future.delayed(Duration(milliseconds: 500)); + } + } catch (ex) { + haqooqAlMosasa = []; + tareefAlMosasa = []; + if (mounted) Utils.handleException(ex, null); + } finally { + Utils.hideLoading(context); + } + setState(() {}); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return SizedBox( + height: double.infinity, + child: SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: Column( + children: [ + CommonHeader("عن الموسوعة", "assets/icons/new/about_bg.jpg", Color(0xffAE8646)), + Column( + children: [ + if ((tareefAlMosasa?.length ?? 0) > 0) + for (ContentInfoDataModel text in tareefAlMosasa) text.content.toText(13, color: ColorConsts.darkText, textAlign: TextAlign.center), + if ((haqooqAlMosasa?.length ?? 0) > 0) + Column( + children: [ + "حقوق الموسوعة".toText(13, color: ColorConsts.greyLightColor), + for (ContentInfoDataModel text in haqooqAlMosasa) text.content.toText(13, color: ColorConsts.greyLightColor, textAlign: TextAlign.center) + ], + ).paddingOnly(top: 24) + ], + ).paddingOnly(top: 70, left: 35, right: 35, bottom: 125), + ], + ), + ), + ); + } +} diff --git a/lib/new_ui/screens/home_screen.dart b/lib/new_ui/screens/home_screen.dart new file mode 100644 index 0000000..0bca7f6 --- /dev/null +++ b/lib/new_ui/screens/home_screen.dart @@ -0,0 +1,342 @@ +import 'package:firebase_analytics/firebase_analytics.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:tangheem/api/tangheem_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/models/aya_tangheem_type.dart'; +import 'package:tangheem/models/content_info_model.dart'; +import 'package:tangheem/models/surah_model.dart'; +import 'package:tangheem/models/tangheem_type_model.dart'; +import 'package:tangheem/ui/dialogs/general_dialog.dart'; +import 'package:tangheem/ui/screens/tangheem_screen.dart'; +import 'package:tangheem/widgets/common_dropdown_button.dart'; +import 'package:tangheem/widgets/video_player_widget.dart'; + +class HomeScreen extends StatefulWidget { + static const String routeName = "/"; + + HomeScreen({Key key}) : super(key: key); + + @override + _HomeScreenState createState() { + return _HomeScreenState(); + } +} + +class _HomeScreenState extends State { + TextEditingController _searchController = TextEditingController(); + FocusNode _searchFocusNode = FocusNode(); + + ValueNotifier> _tangheemListNotifier = ValueNotifier([]); + + List _surahList = []; + int _selectedSurah = -1; + int _selectedTangheemType = -1; + + SurahModel _surahModel; + TangheemType _tangheemType; + ContentInfoModel _contentInfoModel; + + @override + void initState() { + super.initState(); + SystemChannels.textInput.invokeMethod('TextInput.hide'); + getSurahAndTangheemTypes(); + } + + void getSurahAndTangheemTypes() async { + Utils.showLoading(context); + try { + _contentInfoModel = await TangheemUserApiClient().getContentInfo(4); + _surahModel = await TangheemUserApiClient().getSurahs(); + AppState().setSurahModel(_surahModel); + _surahList = _surahModel.data.map((element) => element.nameAR).toList(); + await getTangheemTypes(); + TangheemUserApiClient().addStatistics(1); + // AppState().setAnalytics(widget.analytics); + // await widget.analytics.setAnalyticsCollectionEnabled(true); + // await widget.analytics.setCurrentScreen(screenName: "home"); + setState(() {}); + Utils.hideLoading(context); + } catch (ex) { + Utils.hideLoading(context); + if (mounted) Utils.handleException(ex, null); + } + // checkScreenMode(); + } + + void filterTangheemTypesListBySurah(int surahNo, {bool showLoading = true}) async { + if (showLoading) Utils.showLoading(context); + try { + AyaTangheemType ayaTangheemType = await TangheemUserApiClient().getAyaTangheemType(surahNo, null); + + var tangheemType = _tangheemType?.data?.where((element) => element.isActive)?.toList() ?? []; + var ayaTangheem = ayaTangheemType?.data?.where((element) => element.isActive)?.toList() ?? []; + var result = tangheemType.where((tangheem) => ayaTangheem.any((element) => tangheem.tangheemTypeId == element.tangheemTypeId)).toList() ?? []; + _tangheemListNotifier.value = result?.map((element) => element.tangheemTypeName)?.toList() ?? []; + if (showLoading) Utils.hideLoading(context); + } catch (ex) { + if (showLoading) Utils.hideLoading(context); + if (mounted) Utils.handleException(ex, null); + } + } + + void filterSurahListByTangheemType(String tangheemName) async { + Utils.showLoading(context); + try { + AyaTangheemType ayaTangheemType = await TangheemUserApiClient().getAyaTangheemType(null, tangheemName); + _surahList = _surahModel.data.where((surah) => ayaTangheemType.data.any((element) => surah.id == element.surahNo)).toList().map((element) => element.nameAR).toList(); + setState(() {}); + Utils.hideLoading(context); + } catch (ex) { + Utils.hideLoading(context); + if (mounted) Utils.handleException(ex, null); + } + } + + // void checkScreenMode() { + // WidgetsBinding.instance.addPostFrameCallback((_) async { + // if (MediaQuery.of(context).orientation == Orientation.portrait) { + // await showDialog( + // context: context, + // barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8), + // builder: (BuildContext context) => GeneralDialog(), + // ); + // } + // showWelcomeVideoDialog(); + // }); + // } + // + // SharedPreferences prefs; + // + // void showWelcomeVideoDialog() async { + // prefs = await SharedPreferences.getInstance(); + // String permLink = "-PqP0BCiTlE"; + // String link = prefs.getString(GlobalConsts.welcomeVideoUrl) ?? permLink; + // if (permLink == link) { + // await prefs.setString(GlobalConsts.welcomeVideoUrl, permLink); + // bool showDialog = prefs.getBool(GlobalConsts.doNotShowWelcomeVideo) ?? false; + // if (showDialog) { + // return; + // } + // } else { + // await prefs.setString(GlobalConsts.welcomeVideoUrl, permLink); + // } + // await prefs.setBool(GlobalConsts.doNotShowWelcomeVideo, false); + // showDialog( + // context: context, + // barrierColor: ColorConsts.secondaryWhite.withOpacity(0.8), + // builder: (BuildContext context) => VideoPlayerWidget(permLink), + // ); + // } + + Future getTangheemTypes() async { + try { + _tangheemType = await TangheemUserApiClient().getTangheemType(); + if ((_tangheemType?.data?.length ?? 0) > 0) { + _tangheemType.data.sort((a, b) => a.orderNo.compareTo(b.orderNo)); + } + _tangheemListNotifier.value = _tangheemType?.data?.where((element) => element.isActive)?.toList()?.map((element) => element.tangheemTypeName)?.toList() ?? []; + return; + + // enable these lines if in future need to filter types too + if (_surahModel.data.map((element) => element.nameAR).toList().length == _surahList.length && _selectedSurah >= 0) { + setState(() { + _selectedTangheemType = -1; + }); + // filterTangheemTypesListBySurah(_surahModel.data[_selectedSurah].id, showLoading: false); + } else { + if (_surahModel.data.map((element) => element.nameAR).toList().length != _surahList.length && _selectedSurah >= 0) { + setState(() { + _selectedSurah = -1; + }); + } + _tangheemListNotifier.value = _tangheemType?.data?.where((element) => element.isActive)?.toList()?.map((element) => element.tangheemTypeName)?.toList() ?? []; + } + } catch (ex) {} + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return SizedBox( + width: double.infinity, + child: Stack( + children: [ + Image.asset( + "assets/icons/new/home_light.jpg", + fit: BoxFit.cover, + height: double.infinity, + opacity: const AlwaysStoppedAnimation(.73), + ), + SingleChildScrollView( + padding: EdgeInsets.fromLTRB(45, 138, 45, 138), + physics: BouncingScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset("assets/icons/new/Tangeem-logo.png", width: 126, height: 76), + 30.height, + "موسوعة النبر والتنغيم في الأداء القرآني للأساليب اللغوية".toText(18, color: ColorConsts.darkText, textAlign: TextAlign.center), + 10.height, + "تساعدك موسوعة “تنغيم” على أداء الأساليب اللغوية القرآنية (كالاستفهام والإتمام والشرط والقسم) بما يخدم معنى الآية و قد أشرف عليها متخصصون في اللغة العربية والدراسات القرآنية" + .toText(12, color: ColorConsts.brownColor, textAlign: TextAlign.center), + SizedBox(height: 20), + ValueListenableBuilder( + valueListenable: _tangheemListNotifier, + builder: (context, value, child) { + return CommonDropDownButton(_selectedTangheemType, hintText: "اختر الأسلوب اللغوي", list: value, onSelect: (index) { + if (_selectedTangheemType != index) { + setState(() { + _selectedSurah = -1; + _selectedTangheemType = index; + }); + if (_selectedSurah >= 0) { + return; + } + filterSurahListByTangheemType(_tangheemListNotifier.value[_selectedTangheemType]); + } + }); + }, + ), + 10.height, + Row( + children: [ + iconButton("بحث", "assets/icons/new/search.svg", () async { + // if (_selectedTangheemType < 0) { + // Utils.showToast("الرجائ تعبئة جميع القوائم"); + // return; + // } + if (_selectedSurah < 0) { + Utils.showToast("يرجى اختيار السورة"); + return; + } + _searchFocusNode.unfocus(); + _searchFocusNode.canRequestFocus = false; + var surah = _surahModel.data.firstWhere((surah) => surah.nameAR == _surahList[_selectedSurah], orElse: null); + Map data = {}; + data["surahData"] = surah; + if (_selectedTangheemType >= 0) { + data["tangheemTypeName"] = _tangheemListNotifier.value[_selectedTangheemType].toString(); + } + try { + // await widget.analytics.logEvent( + // name: 'tangheem_by_selection', + // parameters: { + // "tangheemTypeName": _tangheemListNotifier.value[_selectedTangheemType], + // "surahName": _surahModel.data[_selectedSurah].nameAR, + // }, + // ); + } catch (ex) { + print("tangheemTypeName:$ex"); + } + await Navigator.pushNamed(context, TangheemScreen.routeName, arguments: data); + _searchFocusNode.canRequestFocus = true; + await getTangheemTypes(); + }), + 10.width, + Expanded( + child: CommonDropDownButton(_selectedSurah, hintText: "اختر السورة", list: _surahList, onSelect: (index) { + if (_selectedSurah != index) { + setState(() { + _selectedSurah = index; + }); + if (_selectedTangheemType >= 0) { + return; + } + // filterTangheemTypesListBySurah(_surahModel.data[_selectedSurah].id); + } + }), + ) + ], + ), + 20.height, + SizedBox( + height: 48, + child: TextField( + controller: _searchController, + focusNode: _searchFocusNode, + style: TextStyle(color: Colors.white, fontSize: 14), + textAlign: TextAlign.end, + decoration: InputDecoration( + contentPadding: EdgeInsets.fromLTRB(2, 2, 24, 2), + alignLabelWithHint: true, + fillColor: ColorConsts.darkText.withOpacity(.65), + filled: true, + hintStyle: TextStyle(color: Colors.white, fontSize: 14), + hintText: "البحث عن آية", + prefixIconConstraints: BoxConstraints(maxHeight: 20), + prefixIcon: InkWell( + onTap: () async { + _searchFocusNode.unfocus(); + if (_searchController.text.length < 1) { + Utils.showToast("الرجاء ادخال محتوى للبحث"); + return; + } + _searchFocusNode.canRequestFocus = false; + var data = {"tangheemQuery": _searchController.text}; + // await widget.analytics.setAnalyticsCollectionEnabled(true); + // await widget.analytics.logEvent( + // name: 'tangheem_by_search', + // parameters: {"tangheemQuery": _searchController.text}, + // ); + await Navigator.pushNamed(context, TangheemScreen.routeName, arguments: data); + _searchFocusNode.canRequestFocus = true; + await getTangheemTypes(); + }, + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + child: SvgPicture.asset("assets/icons/new/search.svg", width: 20, height: 20, color: Colors.white).paddingOnly(left: 16, right: 8), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide(color: ColorConsts.borderDarkText, width: 0), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide(color: ColorConsts.borderDarkText, width: 0), + ), + ), + ), + ) + ], + ), + ), + ], + ), + ); + } + + Widget iconButton(String title, String icon, VoidCallback callback) { + return InkWell( + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: callback, + child: Container( + height: 48, + width: 70, + decoration: BoxDecoration( + color: callback == null ? ColorConsts.textHintGrey : ColorConsts.brownLightColor.withOpacity(.65), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(14), + child: SvgPicture.asset(icon, width: 20, height: 20, color: Colors.white), + ), + ); + } +} diff --git a/lib/ui/common_appbar.dart b/lib/ui/common_appbar.dart index 9650c22..8e65d35 100644 --- a/lib/ui/common_appbar.dart +++ b/lib/ui/common_appbar.dart @@ -9,6 +9,7 @@ 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/widget_extensions.dart'; import 'package:tangheem/models/authentication_user_model.dart'; import 'package:tangheem/models/content_info_model.dart'; import 'package:tangheem/models/navigation_model.dart'; @@ -128,58 +129,74 @@ class _CommonAppbarState extends State { @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), + // key: widget.showDrawer ? _scaffoldKey : null, + // drawer: widget.showDrawer ? drawerView() : null, + // resizeToAvoidBottomInset: true, + // drawerScrimColor: Colors.black.withOpacity(.3), + body: Stack( + 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, + // ), + // ) + // ], + // ), + // ), + Directionality(textDirection: TextDirection.rtl, child: widget.child), + ElevatedButton( + onPressed: () => Navigator.pop(context), + child: Icon( + Icons.arrow_back_ios, + color: ColorConsts.darkText, + ).paddingOnly(left: 8), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xfff4f4f4), + shape: CircleBorder(), //<-- SEE HERE + padding: EdgeInsets.all(8), ), - ], - ), + ).paddingOnly(left: 8, top: 50), + // IconButton( + // highlightColor: Colors.green, + // icon: Icon(Icons.arrow_back_ios, color: ColorConsts.textGrey), + // padding: EdgeInsets.only(left: 16), + // onPressed: () { + // Navigator.pop(context); + // }, + // ), + ], ), ); } diff --git a/lib/ui/screens/contact_us_screen.dart b/lib/ui/screens/contact_us_screen.dart index a3a567f..6b77547 100644 --- a/lib/ui/screens/contact_us_screen.dart +++ b/lib/ui/screens/contact_us_screen.dart @@ -3,8 +3,11 @@ import 'package:flutter_svg/svg.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/widgets/common_textfield_widget.dart'; +import 'package:tangheem/widgets/new/CommonHeader.dart'; class ContactUsScreen extends StatefulWidget { static const String routeName = "/contact_us"; @@ -50,112 +53,82 @@ class _ContactUsScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: ColorConsts.secondaryWhite, + backgroundColor: ColorConsts.greyF4Color, body: SingleChildScrollView( - padding: EdgeInsets.all(21.0), physics: BouncingScrollPhysics(), - child: Container( - width: MediaQuery.of(context).size.width, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.0), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.only(top: 24, bottom: 24), - child: SvgPicture.asset("assets/logos/tangheem_logo.svg", width: 100, height: 100), - ), - Text( - "اتصل بنا", - style: TextStyle(fontSize: 22, color: ColorConsts.primaryBlue), - ), - Padding( - padding: EdgeInsets.all(8), - child: Text( - "لا تتردد في الاتصال بنا ، يسعدنا أن نسمع منك", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 14, color: ColorConsts.primaryBlue, height: 1), - ), - ), - Container( - margin: EdgeInsets.only(top: 16), - width: double.infinity, - padding: EdgeInsets.all(32.0), - decoration: BoxDecoration( - color: ColorConsts.primaryBlue, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(8), - bottomRight: Radius.circular(8), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: " رقم الاتصال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "التفاصيل", controller: _descriptionController, maxLines: 4), - SizedBox(height: 12), - SizedBox( - width: double.infinity, - height: 50, - child: TextButton( - onPressed: () { - if (_firstNameController.text.length < 1) { - Utils.showToast("يرجى إدخال الاسم الأول"); - return; - } - if (_lastNameController.text.length < 1) { - Utils.showToast("يرجى إدخال الاسم الأخير"); - return; - } - if (_emailController.text.length < 1) { - Utils.showToast("يرجى إدخال البريد الإلكتروني"); - return; - } - if (_mobileNumberController.text.length < 1) { - Utils.showToast("يرجى إدخال رقم الهاتف"); - return; - } - if (_mobileNumberController.text.length != 12) { - Utils.showToast("صيغة الرقم غير صحيحة"); - return; - } - if (_descriptionController.text.length < 1) { - Utils.showToast("يرجى إدخال التفاصيل"); - return; - } - if (_descriptionController.text.trim().length < 1) { - Utils.showToast("يرجى إدخال التفاصيل"); - return; - } - if (!_emailController.text.isValidEmail()) { - Utils.showToast("صيغة البريد الإلكتروني غير صحيحة"); - return; - } - sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: ColorConsts.secondaryPink, - textStyle: TextStyle(fontSize: 16, fontFamily: "DroidKufi"), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6.0), - ), - ), - child: Text("إرسال"), + child: Column( + children: [ + CommonHeader("اتصل بنا", "assets/icons/new/contact_bg.jpg", Color(0xff416A6C)), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + "نسعد بتواصلكم بالمساهمة في تطوير المشروع وطرح المقترحات التي حقق جودته. الرجاء تعبئة البيانات لكي تصل إلينا بشكل مناسب، وسيتم التواصل معكم في أقرب وقت ممكن." + .toText(13, color: ColorConsts.darkText, textAlign: TextAlign.center), + 32.height, + CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController, fillColor: Colors.white, isBorder: true), + 8.height, + CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController, fillColor: Colors.white, isBorder: true), + 8.height, + CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, fillColor: Colors.white, isBorder: true, isEmail: true), + 8.height, + CommonTextFieldWidget(hint: " رقم الاتصال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController, fillColor: Colors.white, isBorder: true), + 8.height, + CommonTextFieldWidget(hint: "التفاصيل", controller: _descriptionController, maxLines: 5, fillColor: Colors.white, isBorder: true), + 22.height, + SizedBox( + width: double.infinity, + height: 50, + child: TextButton( + onPressed: () { + if (_firstNameController.text.length < 1) { + Utils.showToast("يرجى إدخال الاسم الأول"); + return; + } + if (_lastNameController.text.length < 1) { + Utils.showToast("يرجى إدخال الاسم الأخير"); + return; + } + if (_emailController.text.length < 1) { + Utils.showToast("يرجى إدخال البريد الإلكتروني"); + return; + } + if (_mobileNumberController.text.length < 1) { + Utils.showToast("يرجى إدخال رقم الهاتف"); + return; + } + if (_mobileNumberController.text.length != 12) { + Utils.showToast("صيغة الرقم غير صحيحة"); + return; + } + if (_descriptionController.text.length < 1) { + Utils.showToast("يرجى إدخال التفاصيل"); + return; + } + if (_descriptionController.text.trim().length < 1) { + Utils.showToast("يرجى إدخال التفاصيل"); + return; + } + if (!_emailController.text.isValidEmail()) { + Utils.showToast("صيغة البريد الإلكتروني غير صحيحة"); + return; + } + sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text); + }, + style: TextButton.styleFrom( + backgroundColor: ColorConsts.darkText, + foregroundColor: Colors.white, + textStyle: TextStyle(fontSize: 18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.0), ), ), - ], + child: Text("إرسال"), + ), ), - ), - ], - ), + ], + ).paddingAll(35), + ], ), ), ); diff --git a/lib/ui/screens/forgot_password_screen.dart b/lib/ui/screens/forgot_password_screen.dart index 9119c60..b596589 100644 --- a/lib/ui/screens/forgot_password_screen.dart +++ b/lib/ui/screens/forgot_password_screen.dart @@ -3,7 +3,10 @@ import 'package:flutter_svg/svg.dart'; import 'package:tangheem/api/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/ui/screens/contact_us_screen.dart'; import 'package:tangheem/widgets/common_textfield_widget.dart'; class ForgotPasswordScreen extends StatefulWidget { @@ -79,72 +82,69 @@ class _ForgotPasswordScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: ColorConsts.secondaryWhite, + backgroundColor: ColorConsts.greyF8Color, body: SingleChildScrollView( - padding: EdgeInsets.all(21.0), + padding: EdgeInsets.only(top: 100, bottom: 24, left: 24, right: 24), physics: BouncingScrollPhysics(), - child: Container( - width: MediaQuery.of(context).size.width, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.0), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.only(top: 36, bottom: 24), - child: SvgPicture.asset("assets/icons/key.svg", width: 100, height: 100), + child: Column( + children: [ + Image.asset("assets/icons/new/Tangeem-logo.png", width: 116, height: 62), + 30.height, + Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: Colors.white), + margin: EdgeInsets.only(top: 6, bottom: 20), + padding: EdgeInsets.only(top: 50, bottom: 20, left: 11, right: 11), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset("assets/icons/key.svg", width: 100, height: 72), + 25.height, + "استعادة كلمة المرور".toText(18, color: ColorConsts.darkText), + 18.height, + "يمكنك إعادة تعيين كلمة المرور عبر حساب بريدك الإلكتروني".toText(13, color: ColorConsts.grey9FColor, textAlign: TextAlign.center).paddingOnly(left: 77, right: 77), + 25.height, + CommonTextFieldWidget(hint: "البريد الإلكتروني المسجل", controller: _emailController, isEmail: true), + ], ), - Text( - "نسيت كلمة المرور؟", - style: TextStyle(fontSize: 22, color: ColorConsts.primaryBlue), - ), - Container( - margin: EdgeInsets.only(top: 16), - width: double.infinity, - padding: EdgeInsets.all(32.0), - decoration: BoxDecoration( - color: ColorConsts.primaryBlue, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(8), - bottomRight: Radius.circular(8), + ), + SizedBox( + width: double.infinity, + height: 50, + child: TextButton( + onPressed: () { + if (_emailController.text.length < 1) { + Utils.showToast("يرجى إدخال البريد الإلكتروني"); + return; + } else if (!_emailController.text.isValidEmail()) { + Utils.showToast("صيغة البريد الإلكتروني خاطئة"); + return; + } + forgotPassword(_emailController.text); + }, + style: TextButton.styleFrom( + backgroundColor: ColorConsts.darkText, + foregroundColor: Colors.white, + textStyle: TextStyle(fontSize: 18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.0), ), ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox(height: 8), - CommonTextFieldWidget(hint: "البريد الإلكتروني المسجل", controller: _emailController, prefixIcon: "assets/icons/email.svg"), - SizedBox(height: 12), - SizedBox( - width: double.infinity, - height: 50, - child: TextButton( - onPressed: () { - if (_emailController.text.length < 1) { - Utils.showToast("يرجى إدخال البريد الإلكتروني"); - return; - } else if (!_emailController.text.isValidEmail()) { - Utils.showToast("صيغة البريد الإلكتروني خاطئة"); - return; - } - forgotPassword(_emailController.text); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: ColorConsts.secondaryPink, - textStyle: TextStyle(fontSize: 16, fontFamily: "DroidKufi"), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6.0), - ), - ), - child: Text("إعادة تعيين كلمة المرور"), - ), - ), - ], - ), + child: Text("إعادة تعيين كلمة المرور"), ), - ], - ), + ).paddingOnly(left: 11, right: 11, bottom: 28), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset("assets/icons/new/contact_us.svg", width: 26, height: 24, color: ColorConsts.greyC4Color), + 8.height, + "اتصل بنا".toText(14, color: ColorConsts.greyC4Color), + ], + ).onPress(() { + Navigator.pushNamed(context, ContactUsScreen.routeName); + }) + ], ), ), ); diff --git a/lib/ui/screens/member_screen.dart b/lib/ui/screens/member_screen.dart index d6e254d..2ca2278 100644 --- a/lib/ui/screens/member_screen.dart +++ b/lib/ui/screens/member_screen.dart @@ -3,10 +3,15 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:tangheem/api/tangheem_user_api_client.dart'; +import 'package:tangheem/app_state/app_state.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/member_model.dart'; import 'package:tangheem/ui/misc/no_data_ui.dart'; +import 'package:tangheem/widgets/new/CommonHeader.dart'; class MemberScreen extends StatefulWidget { static const String routeName = "/members"; @@ -23,97 +28,104 @@ class _MemberScreenState extends State { @override void initState() { super.initState(); + membersList = AppState().membersList; getMembers(); } void getMembers() async { - Utils.showLoading(context); - try { - var membersData = await TangheemUserApiClient().getMembers(); - membersList = membersData?.data ?? []; - membersList.sort((a, b) => a.orderNo.compareTo(b.orderNo)); - } catch (ex) { - membersList = []; - if (mounted) Utils.handleException(ex, null); - } finally { - Utils.hideLoading(context); + if (membersList == null) { + Utils.showLoading(context); + try { + var membersData = await TangheemUserApiClient().getMembers(); + membersList = membersData?.data ?? []; + membersList.sort((a, b) => a.orderNo.compareTo(b.orderNo)); + AppState().membersList = membersList; + } catch (ex) { + membersList = []; + if (mounted) Utils.handleException(ex, null); + } finally { + Utils.hideLoading(context); + } } setState(() {}); } @override Widget build(BuildContext context) { - return membersList == null - ? SizedBox() - : membersList.isEmpty - ? NoDataUI() - : ListView( - physics: BouncingScrollPhysics(), - padding: EdgeInsets.all(16), - children: [ - Text( - "أعضاء اللجنة الإشرافية", - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1.5), - ), - SizedBox(height: 12), - ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: membersList.length, - separatorBuilder: (context, index) { - return SizedBox(height: 8); - }, - itemBuilder: (context, index) { - String encodedImage = membersList.elementAt(index).picture; - if (encodedImage.contains("data:image/png;base64,")) { - encodedImage = encodedImage.replaceAll("data:image/png;base64,", ""); - } - if (encodedImage.contains("data:image/jpeg;base64,")) { - encodedImage = encodedImage.replaceAll("data:image/jpeg;base64,", ""); - } - var temp = base64Decode(encodedImage); + return SizedBox( + height: double.infinity, + child: SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: Column( + children: [ + CommonHeader("اللجنة الإشرافية", "assets/icons/new/commette_bg.jpg", Color(0xff416A6C)), + membersList == null + ? SizedBox() + : membersList.isEmpty + ? NoDataUI() + : ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: membersList.length, + padding: EdgeInsets.only(left: 25, right: 25, top: 25, bottom: 125), + separatorBuilder: (context, index) { + return Divider(color: Color(0xffC7C7C7), height: 1, thickness: 1); + }, + itemBuilder: (context, index) { + String encodedImage = membersList.elementAt(index).picture; + if (encodedImage.contains("data:image/png;base64,")) { + encodedImage = encodedImage.replaceAll("data:image/png;base64,", ""); + } + if (encodedImage.contains("data:image/jpeg;base64,")) { + encodedImage = encodedImage.replaceAll("data:image/jpeg;base64,", ""); + } + var temp = base64Decode(encodedImage); - return ListTile( - tileColor: Colors.white, - leading: Container( - width: 50.0, - height: 50.0, - decoration: BoxDecoration( - image: membersList.length < 1 - ? null - : DecorationImage( - fit: BoxFit.cover, - image: MemoryImage(temp), - ), - borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - ), - child: membersList.length < 1 - ? ClipRRect( + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.min, + children: [ + (membersList[index].firstName + " " + membersList[index].lastName).toText(13, color: ColorConsts.darkText, textAlign: TextAlign.end), + membersList[index].description.trim().toText(13, color: ColorConsts.grey9FColor, textAlign: TextAlign.end), + ], + ).expanded, + 21.width, + Container( + width: 82.0, + height: 82.0, + decoration: BoxDecoration( + image: membersList.length < 1 + ? null + : DecorationImage( + fit: BoxFit.cover, + image: MemoryImage(temp), + ), borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - child: SvgPicture.asset( - "assets/icons/chat_user.svg", - clipBehavior: Clip.antiAlias, + Radius.circular(10.0), ), - ) - : null, - ), - title: Text( - membersList[index].firstName + " " + membersList[index].lastName, - style: TextStyle(fontSize: 14, color: ColorConsts.primaryBlue, fontWeight: FontWeight.w600), - ), - subtitle: Text( - " ${membersList[index].description.trim()}", - style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue), - ), - isThreeLine: true, - ); - }, - ), - ], - ); + ), + child: membersList.length < 1 + ? ClipRRect( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + child: SvgPicture.asset( + "assets/icons/chat_user.svg", + clipBehavior: Clip.antiAlias, + ), + ) + : null, + ), + ], + ).paddingOnly(top: 25, bottom: 25); + }, + ), + ], + ), + ), + ); } } diff --git a/lib/ui/screens/pdf_viewer_screen.dart b/lib/ui/screens/pdf_viewer_screen.dart index c3bb745..fe31ed9 100644 --- a/lib/ui/screens/pdf_viewer_screen.dart +++ b/lib/ui/screens/pdf_viewer_screen.dart @@ -1,11 +1,19 @@ +import 'dart:ui'; + import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; import 'package:tangheem/api/tangheem_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/models/content_info_model.dart'; import 'package:tangheem/ui/misc/no_data_ui.dart'; +import 'package:tangheem/widgets/new/CommonHeader.dart'; class PdfListScreen extends StatefulWidget { static const String routeName = "/tangheem_pdf"; @@ -20,20 +28,27 @@ class PdfListScreen extends StatefulWidget { class _PdfListScreenState extends State { List contentList; + List haqooqAlMosasa; @override void initState() { super.initState(); + haqooqAlMosasa = AppState().haqooqAlMosasa; getPdfs(); } void getPdfs() async { Utils.showLoading(context); try { - var membersData = await TangheemUserApiClient().getContentInfo(8); - contentList = membersData?.data ?? []; + List responseList = await Future.wait([TangheemUserApiClient().getContentInfo(8), if (haqooqAlMosasa == null) TangheemUserApiClient().getContentInfo(1)]); + contentList = responseList[0].data ?? []; + if (haqooqAlMosasa == null) { + haqooqAlMosasa = responseList[1].data ?? []; + AppState().haqooqAlMosasa = haqooqAlMosasa; + } } catch (ex) { contentList = []; + haqooqAlMosasa = []; if (mounted) Utils.handleException(ex, null); } finally { Utils.hideLoading(context); @@ -48,72 +63,116 @@ class _PdfListScreenState extends State { @override Widget build(BuildContext context) { - return contentList == null - ? SizedBox() - : contentList.isEmpty - ? NoDataUI() - : ListView.separated( - physics: BouncingScrollPhysics(), - padding: EdgeInsets.all(16), - itemCount: contentList.length, - separatorBuilder: (context, index) { - return SizedBox(height: 8); - }, - itemBuilder: (context, index) { - return ListTile( - tileColor: Colors.white, - onTap: () { - Navigator.pushNamed(context, PdfViewerScreen.routeName, arguments: contentList[index]); - }, - title: Text( - contentList[index].fileName?.trim() ?? "", - style: TextStyle(fontSize: 14, color: ColorConsts.primaryBlue), - ), - subtitle: Text( - contentList[index].contentTypeNameAr?.trim() ?? "", - style: TextStyle(fontSize: 12, color: ColorConsts.primaryBlue), - ), - ); - }, - ); + return SizedBox( + height: double.infinity, + child: SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: Column( + children: [ + CommonHeader("التصفح والتحميل", "assets/icons/new/pdf_bg.jpg", Color(0xffAE8646)), + contentList == null + ? SizedBox() + : contentList.isEmpty + ? NoDataUI() + : ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(left: 35, right: 35, top: 35, bottom: 0), + itemCount: contentList.length, + separatorBuilder: (context, index) { + return Divider(color: Color(0xffC7C7C7), height: 1, thickness: 1).paddingOnly(top: 14, bottom: 14); + }, + itemBuilder: (context, index) { + return SizedBox( + height: 50, + child: Row( + children: [ + SvgPicture.asset( + "assets/icons/new/download_pdf.svg", + width: 44, + height: 50, + ), + 7.width, + ClipRRect( + borderRadius: BorderRadius.circular(7), + child: Container( + height: 50, + alignment: Alignment.centerRight, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 44, + height: 50, + alignment: Alignment.center, + decoration: BoxDecoration( + color: ColorConsts.darkText, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.zoom_out_map_rounded, color: Colors.white), + "تصفع".toText(10), + ], + ), + ), + Directionality( + textDirection: TextDirection.rtl, + child: (contentList[index].fileName?.trim() ?? "").toText(18, color: ColorConsts.darkText).paddingOnly(left: 12, right: 12), + ), + ], + ), + ).expanded, + ).onPress(() { + Navigator.pushNamed(context, PdfViewerScreen.routeName, arguments: contentList[index]); + }).expanded, + ], + ), + ); + }, + ), + if ((haqooqAlMosasa?.length ?? 0) > 0) + Column( + children: [ + "حقوق الموسوعة".toText(13, color: ColorConsts.greyLightColor), + for (ContentInfoDataModel text in haqooqAlMosasa) text.content.toText(13, color: ColorConsts.greyLightColor, textAlign: TextAlign.center) + ], + ).paddingOnly(left: 35, right: 35, top: 35), + ], + ), + ), + ); } } -class PdfViewerScreen extends StatefulWidget { +class PdfViewerScreen extends StatelessWidget { static const String routeName = "/tangheem_pdf_view"; final ContentInfoDataModel pdfDetail; PdfViewerScreen(this.pdfDetail, {Key key}) : super(key: key); - @override - _PdfViewerScreenState createState() { - return _PdfViewerScreenState(); - } -} - -class _PdfViewerScreenState extends State { final GlobalKey _pdfViewerKey = GlobalKey(); - @override - void initState() { - super.initState(); - } - - @override - void dispose() { - super.dispose(); - } - @override Widget build(BuildContext context) { - return SfPdfViewer.network( - ApiConsts.baseUrl + widget.pdfDetail.exposeFilePath, - key: _pdfViewerKey, - canShowScrollHead: false, - enableTextSelection: false, - enableDocumentLinkAnnotation: false, - canShowPaginationDialog: false, - canShowScrollStatus: false, + return Column( + children: [ + CommonHeader(pdfDetail.fileName, "assets/icons/new/pdf_bg.jpg", Color(0xffAE8646)), + SfPdfViewer.network( + ApiConsts.baseUrl + pdfDetail.exposeFilePath, + key: _pdfViewerKey, + canShowScrollHead: false, + enableTextSelection: false, + enableDocumentLinkAnnotation: false, + canShowPaginationDialog: false, + canShowScrollStatus: false, + pageSpacing: 0, + // pageLayoutMode:PdfPageLayoutMode.single + ).expanded, + ], ); } } diff --git a/lib/ui/screens/registration_screen.dart b/lib/ui/screens/registration_screen.dart index 2b4e5ad..1571b66 100644 --- a/lib/ui/screens/registration_screen.dart +++ b/lib/ui/screens/registration_screen.dart @@ -4,11 +4,14 @@ import 'package:flutter_svg/svg.dart'; import 'package:tangheem/api/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/country_model.dart'; import 'package:tangheem/models/general_response_model.dart'; import 'package:tangheem/ui/bottom_sheets/country_selection_bottom_sheet.dart'; import 'package:tangheem/ui/dialogs/general_dialog.dart'; +import 'package:tangheem/ui/screens/contact_us_screen.dart'; import 'package:tangheem/widgets/common_textfield_widget.dart'; class RegistrationScreen extends StatefulWidget { @@ -86,166 +89,157 @@ class _RegistrationScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: ColorConsts.secondaryWhite, + backgroundColor: ColorConsts.greyF8Color, body: SingleChildScrollView( - padding: EdgeInsets.all(21.0), + padding: EdgeInsets.only(top: 100, bottom: 24), physics: BouncingScrollPhysics(), - child: Container( - width: MediaQuery.of(context).size.width, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.0), color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.only(top: 24, bottom: 24), - child: SvgPicture.asset("assets/logos/tangheem_logo.svg", width: 100, height: 100), - ), - Text( - "انشاء حساب جديد", - style: TextStyle(fontSize: 22, color: ColorConsts.primaryBlue), - ), - Padding( - padding: EdgeInsets.all(8), - child: Text( - "قم بتعبئة بيانات طلب انشاء الحساب و ستصلك رسالة تأكيد, ومن ثم يمكنك الدخول لحسابك الجديد", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 14, color: ColorConsts.primaryBlue, height: 1), - ), - ), - Container( - margin: EdgeInsets.only(top: 16), - width: double.infinity, - padding: EdgeInsets.all(32.0), - decoration: BoxDecoration( - color: ColorConsts.primaryBlue, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(8), - bottomRight: Radius.circular(8), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset("assets/icons/new/Tangeem-logo.png", width: 116, height: 62), + 30.height, + Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: Colors.white), + margin: EdgeInsets.only(left: 24, right: 24, top: 24, bottom: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.only(top: 35, bottom: 24), + child: SvgPicture.asset("assets/logos/tangheem_logo.svg", width: 72, height: 72), ), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController), - SizedBox(height: 8), - CommonTextFieldWidget( - hint: _selectedCountry?.countryNameAr ?? "الدولة", - controller: null, - suffixWidget: Icon(Icons.keyboard_arrow_down, size: 18, color: ColorConsts.secondaryOrange), - onTap: () { - _selectCountry(context); - }, - ), - SizedBox(height: 8), - CommonTextFieldWidget( - hint: " رقم الجوال (اختياري)${" (" + (_selectedCountry?.countryCode ?? "+9xx") + " xxxxxxxxx)"}", - controller: _mobileNumberController, - suffixWidget: Text(_selectedCountry?.countryCode ?? "", textDirection: TextDirection.ltr), - ), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "تعيين كلمة المرور", controller: _passwordController), - SizedBox(height: 8), - CommonTextFieldWidget(hint: "تأكيد كلمة المرور", controller: _confirmPasswordController), - SizedBox(height: 8), - Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - setState(() { - _isAccept = !_isAccept; - }); - }, - child: SvgPicture.asset(_isAccept ? "assets/icons/checkOn.svg" : "assets/icons/checkOff.svg", width: 16, height: 16), - ), - SizedBox(width: 8), - Expanded( - child: Text( - "أقر بأن جميع البيانات المدخلة أعلاه صحيحة", - style: TextStyle(color: Colors.white, fontSize: 13), + "انشاء حساب جديد".toText(18, color: ColorConsts.darkText), + "قم بتعبئة بيانات طلب انشاء الحساب و ستصلك رسالة تأكيد, ومن ثم يمكنك الدخول لحسابك الجديد" + .toText(13, color: ColorConsts.grey9FColor, textAlign: TextAlign.center) + .paddingOnly(left: 24, right: 24, top: 18, bottom: 18), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, isEmail: true), + SizedBox(height: 8), + CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController), + SizedBox(height: 8), + CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController), + SizedBox(height: 8), + CommonTextFieldWidget( + hint: _selectedCountry?.countryNameAr ?? "الدولة", + controller: null, + suffixWidget: Icon(Icons.keyboard_arrow_down, size: 18, color: ColorConsts.secondaryOrange), + onTap: () { + _selectCountry(context); + }, + ), + SizedBox(height: 8), + CommonTextFieldWidget( + hint: " رقم الجوال (اختياري)${" (" + (_selectedCountry?.countryCode ?? "+9xx") + " xxxxxxxxx)"}", + controller: _mobileNumberController, + suffixWidget: Text(_selectedCountry?.countryCode ?? "", textDirection: TextDirection.ltr), + ), + SizedBox(height: 8), + CommonTextFieldWidget(hint: "تعيين كلمة المرور", controller: _passwordController), + SizedBox(height: 8), + CommonTextFieldWidget(hint: "تأكيد كلمة المرور", controller: _confirmPasswordController), + Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + setState(() { + _isAccept = !_isAccept; + }); + }, + child: Icon(_isAccept ? Icons.check_box_rounded : Icons.check_box_outline_blank_rounded, color: ColorConsts.borderDark2Text, size: 17), + //child: SvgPicture.asset(_isAccept ? "assets/icons/checkOn.svg" : "assets/icons/checkOff.svg", width: 16, height: 16,color: ColorConsts.borderDarkText), ), - ), - ], - ), - SizedBox(height: 12), - SizedBox( - width: double.infinity, - height: 50, - child: TextButton( - onPressed: () { - if (_emailController.text.length < 1) { - Utils.showToast("يرجى إدخال البريد الإلكتروني"); - return; - } - if (_firstNameController.text.length < 1) { - Utils.showToast("يرجى إدخال الاسم الأول"); - return; - } - if (_lastNameController.text.length < 1) { - Utils.showToast("يرجى إدخال الاسم الأخير"); - return; - } - if (_selectedCountry?.countryCode == null) { - Utils.showToast("يرجى اختيار الدولة"); - return; - } - // if (_mobileNumberController.text.length < 1) { - // Utils.showToast("يرجى إدخال رقم الجوال"); - // return; - // } else + SizedBox(width: 8), + "جميع البيانات صحيحة ضمن اتفاقية الاستخدام".toText(14, color: ColorConsts.darkText).expanded, + ], + ).paddingOnly(left: 30, right: 30, top: 30, bottom: 26), + ], + ).paddingOnly(left: 12, right: 12), + ], + ), + ), + SizedBox( + width: double.infinity, + height: 50, + child: TextButton( + onPressed: () { + if (_emailController.text.length < 1) { + Utils.showToast("يرجى إدخال البريد الإلكتروني"); + return; + } + if (_firstNameController.text.length < 1) { + Utils.showToast("يرجى إدخال الاسم الأول"); + return; + } + if (_lastNameController.text.length < 1) { + Utils.showToast("يرجى إدخال الاسم الأخير"); + return; + } + if (_selectedCountry?.countryCode == null) { + Utils.showToast("يرجى اختيار الدولة"); + return; + } + // if (_mobileNumberController.text.length < 1) { + // Utils.showToast("يرجى إدخال رقم الجوال"); + // return; + // } else - if (_mobileNumberController.text.isNotEmpty && (_mobileNumberController.text.length < 8 || _mobileNumberController.text.length > 12)) { - Utils.showToast("رقم الهاتف غير صحيح"); - return; - } - if (_passwordController.text.length < 1) { - Utils.showToast("يرجى إدخال كلمة المرور"); - return; - } - if (_confirmPasswordController.text.length < 1) { - Utils.showToast("يرجى تأكيد كلمة المرور"); - return; - } + if (_mobileNumberController.text.isNotEmpty && (_mobileNumberController.text.length < 8 || _mobileNumberController.text.length > 12)) { + Utils.showToast("رقم الهاتف غير صحيح"); + return; + } + if (_passwordController.text.length < 1) { + Utils.showToast("يرجى إدخال كلمة المرور"); + return; + } + if (_confirmPasswordController.text.length < 1) { + Utils.showToast("يرجى تأكيد كلمة المرور"); + return; + } - if (!_emailController.text.isValidEmail()) { - Utils.showToast("صيغة البريد الإلكتروني خاطئة"); - return; - } + if (!_emailController.text.isValidEmail()) { + Utils.showToast("صيغة البريد الإلكتروني خاطئة"); + return; + } - if (_passwordController.text != _confirmPasswordController.text) { - Utils.showToast("كلمة المرور غير متطابقة"); - return; - } + if (_passwordController.text != _confirmPasswordController.text) { + Utils.showToast("كلمة المرور غير متطابقة"); + return; + } - if (!_isAccept) { - Utils.showToast("الرجاء الموافقة على سياسة الخصوصية"); - return; - } - registerUser( - _firstNameController.text, _lastNameController.text, _emailController.text, _passwordController.text, _selectedCountry?.countryCode, _mobileNumberController.text); - }, - style: TextButton.styleFrom( - backgroundColor: ColorConsts.secondaryPink, - foregroundColor: Colors.white, - textStyle: TextStyle(fontSize: 16, fontFamily: "DroidKufi"), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6.0), - ), - ), - child: Text("انشئ حسابك"), - ), - ), - ], + if (!_isAccept) { + Utils.showToast("الرجاء الموافقة على سياسة الخصوصية"); + return; + } + registerUser(_firstNameController.text, _lastNameController.text, _emailController.text, _passwordController.text, _selectedCountry?.countryCode, _mobileNumberController.text); + }, + style: TextButton.styleFrom( + backgroundColor: ColorConsts.darkText, + foregroundColor: Colors.white, + textStyle: TextStyle(fontSize: 18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.0), + ), ), + child: Text("انشئ حسابك"), ), - ], - ), + ).paddingOnly(left: 35, right: 35, bottom: 35), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset("assets/icons/new/contact_us.svg", width: 26, height: 24, color: ColorConsts.greyC4Color), + 8.height, + "اتصل بنا".toText(14, color: ColorConsts.greyC4Color), + ], + ).onPress(() { + Navigator.pushNamed(context, ContactUsScreen.routeName); + }) + ], ), ), ); diff --git a/lib/widgets/common_dropdown_button.dart b/lib/widgets/common_dropdown_button.dart index 33f5c18..d0ddbbb 100644 --- a/lib/widgets/common_dropdown_button.dart +++ b/lib/widgets/common_dropdown_button.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; +import 'dart:math' as math; import 'package:tangheem/classes/colors.dart'; class CommonDropDownButton extends StatelessWidget { @@ -24,27 +24,37 @@ class CommonDropDownButton extends StatelessWidget { highlightColor: Colors.transparent, onTap: onPressed, child: Container( - height: 40, - decoration: BoxDecoration( - color: color ?? ColorConsts.primaryBlue, - borderRadius: BorderRadius.circular(6), - ), - padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + height: 48, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10), border: Border.all(color: ColorConsts.brownColor, width: .5)), + padding: EdgeInsets.fromLTRB(24, 15, 24, 15), child: DropdownButtonHideUnderline( child: DropdownButton( isExpanded: isDropDown, dropdownColor: ColorConsts.secondaryWhite, - icon: SvgPicture.asset( - icon ?? "assets/icons/drop_menu.svg", - width: widthHeight ?? 10, - height: widthHeight ?? 5, - color: iconColor ?? ColorConsts.secondaryOrange, - ), - hint: Text( - (list.isEmpty || index < 0) ? hintText : list[index], - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 12, color: Colors.white), + iconSize: 0, + // icon: + hint: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Transform( + alignment: Alignment.center, + transform: Matrix4.rotationY(math.pi), + child: Icon(Icons.play_arrow_rounded, color: ColorConsts.brownColor, size: 14), + ), + + // SvgPicture.asset( + // icon ?? "assets/icons/drop_menu.svg", + // width: widthHeight ?? 10, + // height: widthHeight ?? 5, + // color: iconColor ?? ColorConsts.brownColor, + // ), + Text( + (list.isEmpty || index < 0) ? hintText : list[index], + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 14, color: ColorConsts.brownColor), + ), + ], ), focusColor: Colors.white, style: TextStyle(color: Colors.white), diff --git a/lib/widgets/common_textfield_widget.dart b/lib/widgets/common_textfield_widget.dart index c886ab3..55dee4b 100644 --- a/lib/widgets/common_textfield_widget.dart +++ b/lib/widgets/common_textfield_widget.dart @@ -1,58 +1,137 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:tangheem/classes/colors.dart'; +import 'package:tangheem/extensions/string_extensions.dart'; +import 'package:tangheem/extensions/widget_extensions.dart'; -class CommonTextFieldWidget extends StatelessWidget { +class CommonTextFieldWidget extends StatefulWidget { final String hint; final TextEditingController controller; final bool isPassword; + final bool isEmail; final String prefixIcon; final Widget suffixWidget; final Function onTap; final int maxLines; final FocusNode focusNode; + final bool validate; + final Color fillColor; + final bool isBorder; - CommonTextFieldWidget({Key key, @required this.hint, @required this.controller, this.maxLines = 1, this.focusNode, this.isPassword = false, this.prefixIcon, this.suffixWidget, this.onTap}) + CommonTextFieldWidget( + {Key key, + @required this.hint, + @required this.controller, + this.maxLines = 1, + this.focusNode, + this.isPassword = false, + this.isEmail = false, + this.prefixIcon, + this.suffixWidget, + this.onTap, + this.fillColor, + this.isBorder = false, + this.validate = false}) : super(key: key); + @override + _CommonTextFieldWidgetState createState() { + return _CommonTextFieldWidgetState(); + } +} + +class _CommonTextFieldWidgetState extends State { + bool _formValidate = false; + + @override + void initState() { + super.initState(); + if (widget.controller != null) { + widget.controller.addListener(() { + if (widget.isEmail) { + if (_formValidate != widget.controller.text.isValidEmail()) { + _formValidate = widget.controller.text.isValidEmail(); + setState(() {}); + } + } else if (_formValidate != widget.controller.text.isNotEmpty) { + _formValidate = widget.controller.text.isNotEmpty; + setState(() {}); + } + }); + } + } + + @override + void dispose() { + super.dispose(); + } + @override Widget build(BuildContext context) { - return SizedBox( - child: TextField( - textAlignVertical: TextAlignVertical.center, - controller: controller, - obscureText: isPassword, - textInputAction: TextInputAction.next, - style: TextStyle(color: ColorConsts.primaryBlack, fontSize: 14), - cursorColor: ColorConsts.primaryBlue, - readOnly: onTap != null, - maxLines: maxLines, - onTap: onTap, - focusNode: focusNode, - scrollPhysics: BouncingScrollPhysics(), - decoration: InputDecoration( - contentPadding: EdgeInsets.fromLTRB(4, 4, 8, 4), - alignLabelWithHint: true, - fillColor: Colors.white, - filled: true, - hintStyle: TextStyle(color: ColorConsts.textGrey2, fontSize: 14), - hintText: hint, - suffixIcon: suffixWidget == null - ? null - : Padding( - padding: EdgeInsets.only(left: 8, right: 0), - child: suffixWidget, - ), - suffixIconConstraints: suffixWidget == null ? null : BoxConstraints(maxHeight: 30), - prefixIconConstraints: prefixIcon == null ? prefixIcon : BoxConstraints(maxHeight: 18), - prefixIcon: prefixIcon == null - ? prefixIcon - : Padding( - padding: EdgeInsets.only(left: 4, right: 0), - child: SvgPicture.asset(prefixIcon, color: ColorConsts.textGrey2), - ), - border: OutlineInputBorder(borderRadius: BorderRadius.circular(6), borderSide: BorderSide.none), - ), + return Container( + decoration: BoxDecoration( + color: widget.fillColor ?? Color(0xffF8F7FB), + borderRadius: BorderRadius.circular(30), + border: Border.all(color: widget.isBorder ? Color(0xddddDDdd) : Colors.transparent, width: 1), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + textAlignVertical: TextAlignVertical.center, + controller: widget.controller, + obscureText: widget.isPassword, + textInputAction: TextInputAction.next, + style: TextStyle(color: ColorConsts.darkText, fontSize: 14, fontFamily: "Montserrat"), + cursorColor: ColorConsts.primaryBlue, + readOnly: widget.onTap != null, + maxLines: widget.maxLines, + onTap: widget.onTap, + focusNode: widget.focusNode, + scrollPhysics: BouncingScrollPhysics(), + decoration: InputDecoration( + contentPadding: EdgeInsets.fromLTRB(4, 16, 24, 16), + alignLabelWithHint: true, + fillColor: widget.fillColor ?? Color(0xffF8F7FB), + filled: true, + hintStyle: TextStyle(color: ColorConsts.greyHintColor, fontSize: 14, fontFamily: "Montserrat"), + hintText: widget.hint, + // suffixIcon: widget.suffixWidget == null + // ? Container( + // color: Colors.green, + // child: Stack( + // alignment: Alignment.topCenter, + // children: [ + // (Icon(Icons.check_circle_outline_rounded, color: (widget.controller != null && _formValidate) ? ColorConsts.borderDark2Text : ColorConsts.redLightColor, size: 20)), + // ], + // ), + // ) + // : Padding( + // padding: EdgeInsets.only(left: 24, right: 0), + // child: widget.suffixWidget, + // ), + // suffixIconConstraints: widget.suffixWidget == null ? null : BoxConstraints(maxHeight: 30), + // prefixIconConstraints: widget.prefixIcon == null ? widget.prefixIcon : BoxConstraints(maxHeight: 18), + // prefixIcon: widget.prefixIcon == null + // ? widget.prefixIcon + // : Padding( + // padding: EdgeInsets.only(left: 4, right: 0), + // child: SvgPicture.asset(widget.prefixIcon, color: ColorConsts.textGrey2), + // ), + // border: InputBorder.none, + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(30), + borderSide: BorderSide(color: Colors.transparent, width: 1), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(30), + borderSide: BorderSide(color: Colors.transparent, width: 1), + ), + ), + ).expanded, + (Icon(Icons.check_circle_outline_rounded, color: (widget.controller != null && _formValidate) ? ColorConsts.borderDark2Text : ColorConsts.redLightColor, size: 20)) + .paddingOnly(top: 14, left: 16), + ], ), ); } diff --git a/lib/widgets/new/CommonHeader.dart b/lib/widgets/new/CommonHeader.dart new file mode 100644 index 0000000..8f50eed --- /dev/null +++ b/lib/widgets/new/CommonHeader.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:tangheem/extensions/int_extensions.dart'; +import 'package:tangheem/extensions/string_extensions.dart'; + +class CommonHeader extends StatelessWidget { + final String title; + final Color gradiantColor; + final String assetImage; + + CommonHeader(this.title, this.assetImage, this.gradiantColor, {Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return AspectRatio( + aspectRatio: 469 / 313, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.transparent, + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage(assetImage), + ), + ), + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + gradient: LinearGradient( + begin: FractionalOffset.bottomLeft, + end: FractionalOffset.topRight, + colors: [ + Color(0x00FFFFFF), + gradiantColor.withOpacity(.75), + gradiantColor, + ], + stops: [0.0, 0.45, 1.0], + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 50), + 26.height, + title.toText(30), + ], + ), + ], + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 7809575..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,833 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - audio_session: - dependency: transitive - description: - name: audio_session - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.10" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.5" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.16.0" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.4" - firebase_analytics: - dependency: "direct main" - description: - name: firebase_analytics - url: "https://pub.dartlang.org" - source: hosted - version: "9.3.6" - firebase_analytics_platform_interface: - dependency: transitive - description: - name: firebase_analytics_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.3.5" - firebase_analytics_web: - dependency: transitive - description: - name: firebase_analytics_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+5" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "1.23.0" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.5.1" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.2" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - flutter_inappwebview: - dependency: "direct overridden" - description: - path: "." - ref: HEAD - resolved-ref: "252d836d52bff32870ed1b72231e428b0009e89e" - url: "https://github.com/CodeEagle/flutter_inappwebview" - source: git - version: "5.4.3+7" - flutter_layout_grid: - dependency: transitive - description: - name: flutter_layout_grid - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_slidable: - dependency: "direct main" - description: - name: flutter_slidable - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.0" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.23.0+1" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - fluttertoast: - dependency: "direct main" - description: - name: fluttertoast - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.8" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.0" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.5" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - image_gallery_saver: - dependency: "direct main" - description: - name: image_gallery_saver - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.1" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.4" - just_audio: - dependency: "direct main" - description: - name: just_audio - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.29" - just_audio_platform_interface: - dependency: transitive - description: - name: just_audio_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.0" - just_audio_web: - dependency: transitive - description: - name: just_audio_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.7" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - numerus: - dependency: transitive - description: - name: numerus - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.1+1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" - path_provider: - dependency: "direct main" - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.20" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.3" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.4" - provider: - dependency: transitive - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.3" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - record_mp3: - dependency: "direct main" - description: - name: record_mp3 - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.27.5" - share: - dependency: "direct main" - description: - name: share - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.15" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - shared_preferences_ios: - dependency: transitive - description: - name: shared_preferences_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.2" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - syncfusion_flutter_core: - dependency: transitive - description: - name: syncfusion_flutter_core - url: "https://pub.dartlang.org" - source: hosted - version: "19.4.56" - syncfusion_flutter_pdf: - dependency: transitive - description: - name: syncfusion_flutter_pdf - url: "https://pub.dartlang.org" - source: hosted - version: "19.4.56-beta" - syncfusion_flutter_pdfviewer: - dependency: "direct main" - description: - name: syncfusion_flutter_pdfviewer - url: "https://pub.dartlang.org" - source: hosted - version: "19.4.56-beta" - syncfusion_flutter_pdfviewer_macos: - dependency: transitive - description: - name: syncfusion_flutter_pdfviewer_macos - url: "https://pub.dartlang.org" - source: hosted - version: "19.4.56-beta" - syncfusion_flutter_pdfviewer_platform_interface: - dependency: transitive - description: - name: syncfusion_flutter_pdfviewer_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "19.4.56-beta" - syncfusion_flutter_pdfviewer_web: - dependency: transitive - description: - name: syncfusion_flutter_pdfviewer_web - url: "https://pub.dartlang.org" - source: hosted - version: "19.4.56-beta" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9" - tuple: - dependency: transitive - description: - name: tuple - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.5" - url_launcher_android: - dependency: transitive - description: - name: url_launcher_android - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.19" - url_launcher_ios: - dependency: transitive - description: - name: url_launcher_ios - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.17" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.6" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.7" - video_player_android: - dependency: transitive - description: - name: video_player_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.9" - video_player_avfoundation: - dependency: transitive - description: - name: video_player_avfoundation - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.5" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.4" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.12" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.2" - wakelock_macos: - dependency: transitive - description: - name: wakelock_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - wakelock_platform_interface: - dependency: transitive - description: - name: wakelock_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - wakelock_web: - dependency: transitive - description: - name: wakelock_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - wakelock_windows: - dependency: transitive - description: - name: wakelock_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.0" - webview_flutter_android: - dependency: transitive - description: - name: webview_flutter_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.10.2" - webview_flutter_platform_interface: - dependency: transitive - description: - name: webview_flutter_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - webview_flutter_wkwebview: - dependency: transitive - description: - name: webview_flutter_wkwebview - url: "https://pub.dartlang.org" - source: hosted - version: "2.9.4" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+2" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "5.4.1" - youtube_player_flutter: - dependency: "direct main" - description: - name: youtube_player_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.0" -sdks: - dart: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 35925d3..d482312 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,6 +72,7 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/icons/ + - assets/icons/new/ - assets/logos/ - assets/files/ @@ -87,6 +88,16 @@ flutter: # list giving the asset and other descriptors for the font. For # example: fonts: + - family: HelveticaNeue + fonts: + - asset: assets/fonts/Helvetica-Neue-W23-for-SKY-Regular.ttf + - asset: assets/fonts/Helvetica-Neue-W23-for-SKY-Bold.ttf + weight: 700 + - family: Montserrat + fonts: + - asset: assets/fonts/Montserrat-Regular.ttf + - asset: assets/fonts/Montserrat-Bold.ttf + weight: 700 - family: DroidKufi fonts: - asset: assets/fonts/DroidKufi-Regular.ttf