|
|
|
|
@ -31,7 +31,6 @@ class _CommonAppbarState extends State<CommonAppbar> {
|
|
|
|
|
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
|
|
|
|
List<QuickLinksData> quickLinks = [];
|
|
|
|
|
List<NavigationDataModel> navigationList = [];
|
|
|
|
|
ContentInfoDataModel _copyRight;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -153,136 +152,142 @@ class _CommonAppbarState extends State<CommonAppbar> {
|
|
|
|
|
elevation: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
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;
|
|
|
|
|
child: SafeArea(
|
|
|
|
|
bottom: true,
|
|
|
|
|
top: false,
|
|
|
|
|
right: false,
|
|
|
|
|
left: false,
|
|
|
|
|
maintainBottomViewPadding: true,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(left: 24, right: 24),
|
|
|
|
|
itemCount: navigationList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg";
|
|
|
|
|
if (navigationList[index].parentId == 1) {
|
|
|
|
|
return 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);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: myListItem(icon, navigationList[index].navigationText, false, onTap: () {
|
|
|
|
|
String url = navigationList[index]?.mobileNavigationUrl ?? "";
|
|
|
|
|
if (url.isEmpty) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var contentId;
|
|
|
|
|
if (navigationList[index].mobileNavigationUrl == "/introduction") {
|
|
|
|
|
url = ContentInfoScreen.routeName;
|
|
|
|
|
contentId = 2;
|
|
|
|
|
} else if (navigationList[index].mobileNavigationUrl == "/encyclopedia") {
|
|
|
|
|
url = ContentInfoScreen.routeName;
|
|
|
|
|
contentId = 1;
|
|
|
|
|
}
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
})),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 16, bottom: 12),
|
|
|
|
|
padding: EdgeInsets.only(left: 32, right: 32),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
for (QuickLinksData _quickLink in quickLinks)
|
|
|
|
|
commonIconButton(_quickLink.exposeFilePath, () {
|
|
|
|
|
_launchURL(_quickLink.imageUrl);
|
|
|
|
|
}, size: 35, isAsset: false),
|
|
|
|
|
],
|
|
|
|
|
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 (_copyRight != null)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 32, right: 32, bottom: 8),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(left: 24, right: 24),
|
|
|
|
|
itemCount: navigationList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg";
|
|
|
|
|
if (navigationList[index].parentId == 1) {
|
|
|
|
|
return 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);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: myListItem(icon, navigationList[index].navigationText, false, onTap: () {
|
|
|
|
|
String url = navigationList[index]?.mobileNavigationUrl ?? "";
|
|
|
|
|
if (url.isEmpty) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var contentId;
|
|
|
|
|
if (navigationList[index].mobileNavigationUrl == "/introduction") {
|
|
|
|
|
url = ContentInfoScreen.routeName;
|
|
|
|
|
contentId = 2;
|
|
|
|
|
} else if (navigationList[index].mobileNavigationUrl == "/encyclopedia") {
|
|
|
|
|
url = ContentInfoScreen.routeName;
|
|
|
|
|
contentId = 1;
|
|
|
|
|
}
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
})),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 16, bottom: 12),
|
|
|
|
|
padding: EdgeInsets.only(left: 32, right: 32),
|
|
|
|
|
child: 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)
|
|
|
|
|
for (QuickLinksData _quickLink in quickLinks)
|
|
|
|
|
commonIconButton(_quickLink.exposeFilePath, () {
|
|
|
|
|
_launchURL(_quickLink.imageUrl);
|
|
|
|
|
}, size: 35, isAsset: false),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 32, right: 32, bottom: 8),
|
|
|
|
|
child: 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)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|