|
|
|
|
@ -23,6 +23,46 @@ class AppMenuDialog extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
|
|
|
|
|
|
|
|
|
|
Widget _operationButtons = Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
menuOptions("assets/icons/new/bookmark.svg", isPortrait).onPress(() {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pushNamed(context, BookmarkScreen.routeName);
|
|
|
|
|
}),
|
|
|
|
|
14.width,
|
|
|
|
|
menuOptions("assets/icons/new/zoom_in.svg", isPortrait).onPress(onFontIncrease),
|
|
|
|
|
14.width,
|
|
|
|
|
menuOptions("assets/icons/new/zoom_out.svg", isPortrait).onPress(onFontDecrease),
|
|
|
|
|
14.width,
|
|
|
|
|
menuOptions("assets/icons/new/user_acount.svg", isPortrait).onPress(() {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
if (AppState().isUserLogin) {
|
|
|
|
|
Navigator.pushNamed(context, UserProfileScreen.routeName);
|
|
|
|
|
} else
|
|
|
|
|
Navigator.pushNamed(context, LoginScreen.routeName);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Widget _pdfButton = Container(
|
|
|
|
|
height: 26,
|
|
|
|
|
padding: EdgeInsets.only(right: 16, left: 12),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(32.0),
|
|
|
|
|
color: ColorConsts.brownLightColor,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(Icons.play_arrow_outlined, size: 20, color: Colors.white),
|
|
|
|
|
"تصفح وتحميل الموسوعة".toText(isPortrait ? 13 : 16),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
goToIndex(5);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
|
|
|
|
|
child: Dialog(
|
|
|
|
|
@ -38,86 +78,71 @@ class AppMenuDialog extends StatelessWidget {
|
|
|
|
|
color: Colors.white.withOpacity(.91),
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
isPortrait ? 58.height : 24.height,
|
|
|
|
|
menuItem("الرئيسية", "assets/icons/new/home.svg", 0),
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
menuItem("عن الموسوعة", "assets/icons/new/intro.svg", 1),
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
menuItem("اللجنة الإشرافية", "assets/icons/new/members.svg", 4),
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
menuItem("قراءة القرآن الكريم", "assets/icons/new/quran.svg", 2),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
menuOptions("assets/icons/new/bookmark.svg").onPress(() {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pushNamed(context, BookmarkScreen.routeName);
|
|
|
|
|
}),
|
|
|
|
|
14.width,
|
|
|
|
|
menuOptions("assets/icons/new/zoom_in.svg").onPress(onFontIncrease),
|
|
|
|
|
14.width,
|
|
|
|
|
menuOptions("assets/icons/new/zoom_out.svg").onPress(onFontDecrease),
|
|
|
|
|
14.width,
|
|
|
|
|
menuOptions("assets/icons/new/user_acount.svg").onPress(() {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
if (AppState().isUserLogin) {
|
|
|
|
|
Navigator.pushNamed(context, UserProfileScreen.routeName);
|
|
|
|
|
} else
|
|
|
|
|
Navigator.pushNamed(context, LoginScreen.routeName);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(top: 32, bottom: 32),
|
|
|
|
|
Container(
|
|
|
|
|
height: 26,
|
|
|
|
|
padding: EdgeInsets.only(right: 16, left: 12),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(32.0),
|
|
|
|
|
color: ColorConsts.brownLightColor,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
child: isPortrait
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(Icons.play_arrow_outlined, size: 20, color: Colors.white),
|
|
|
|
|
"تصفح وتحميل الموسوعة".toText(13),
|
|
|
|
|
isPortrait ? 58.height : 24.height,
|
|
|
|
|
menuItem("الرئيسية", "assets/icons/new/home.svg", 0, isPortrait),
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
menuItem("عن الموسوعة", "assets/icons/new/intro.svg", 1, isPortrait),
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
menuItem("اللجنة الإشرافية", "assets/icons/new/members.svg", 4, isPortrait),
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.greyB5Color).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
menuItem("قراءة القرآن الكريم", "assets/icons/new/quran.svg", 2, isPortrait),
|
|
|
|
|
_operationButtons.paddingOnly(top: 32, bottom: 32),
|
|
|
|
|
_pdfButton
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
goToIndex(5);
|
|
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
_operationButtons.paddingOnly(top: 20, bottom: 32),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
menuItem("الرئيسية", "assets/icons/new/home.svg", 0, isPortrait),
|
|
|
|
|
Container(width: 1, height: 50, color: ColorConsts.greyB5Color).paddingOnly(left: 20, right: 20),
|
|
|
|
|
menuItem("عن الموسوعة", "assets/icons/new/intro.svg", 1, isPortrait),
|
|
|
|
|
Container(width: 1, height: 50, color: ColorConsts.greyB5Color).paddingOnly(left: 20, right: 20),
|
|
|
|
|
menuItem("اللجنة الإشرافية", "assets/icons/new/members.svg", 4, isPortrait),
|
|
|
|
|
Container(width: 1, height: 50, color: ColorConsts.greyB5Color).paddingOnly(left: 20, right: 20),
|
|
|
|
|
menuItem("قراءة القرآن الكريم", "assets/icons/new/quran.svg", 2, isPortrait),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
32.height,
|
|
|
|
|
_pdfButton
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(12),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget menuOptions(String icon) {
|
|
|
|
|
Widget menuOptions(String icon, bool isPortrait) {
|
|
|
|
|
return SvgPicture.asset(
|
|
|
|
|
icon,
|
|
|
|
|
width: 25,
|
|
|
|
|
height: 25,
|
|
|
|
|
width: isPortrait ? 25 : 30,
|
|
|
|
|
height: isPortrait ? 25 : 30,
|
|
|
|
|
color: ColorConsts.greyBAColor,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget menuItem(String title, String icon, int index) {
|
|
|
|
|
Widget menuItem(String title, String icon, int index, bool isPortrait) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
icon,
|
|
|
|
|
width: 25,
|
|
|
|
|
height: 25,
|
|
|
|
|
width: isPortrait ? 25 : 30,
|
|
|
|
|
height: isPortrait ? 25 : 30,
|
|
|
|
|
color: ColorConsts.darkText,
|
|
|
|
|
),
|
|
|
|
|
6.height,
|
|
|
|
|
title.toText(13, color: ColorConsts.darkText)
|
|
|
|
|
isPortrait ? 6.height : 12.height,
|
|
|
|
|
title.toText(isPortrait ? 13 : 16, color: ColorConsts.darkText)
|
|
|
|
|
],
|
|
|
|
|
).onPress(() => goToIndex(index));
|
|
|
|
|
}
|
|
|
|
|
|