Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wocdev #127

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bhagavad_gita/flutter_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions bhagavad_gita/lib/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"unlikeModernWriting": "A practical guide to life,\n leading you towards ultimate joy.",
"gitaStory": "Bhagavad Gita, also known as the Gita - \"The Song of The Lord\" is a practical guide to one's life that guides one to re-organise their life, achieve inner peace and approach the Supreme Lord (the Ultimate Reality). It is a 700-verse text in Sanskrit which comprises chapters 23 through 40 in the Bhishma-Parva section of the Mahabharata.",
"story": "STORY",
"InformationSources": "INFORMATION SOURCES",
"gitaStoryDetail": "The Bhagavad Gita is a dialogue between Arjuna, a supernaturally gifted warrior and his guide and charioteer Lord Krishna on the battlefield of Kurukshetra. As both armies stand ready for the battle, the mighty warrior Arjuna, on observing the warriors on both sides becomes overwhelmed with grief and compassion due to the fear of losing his relatives and friends and the consequent sins attributed to killing his own relatives. So, he surrenders to Lord Krishna, seeking a solution. Thus, follows the wisdom of the Bhagavad Gita.",
"conclusion": "CONCLUSION",
"conclusionDetail": "Over 18 chapters, Gita packs an intense analysis of life, emotions and ambitions, discussion of various types of yoga, including Jnana, Bhakti, Karma and Raja, the difference between Self and the material body as well as the revelation of the Ultimate Purpose of Life.",
Expand All @@ -59,6 +60,7 @@
"setting": "Settings",
"Language": "LANGUAGE",
"author": "AUTHOR",
"bibliography": "BIBLIOGRAPHY",
"hideShowLanguage": "Show/hide these options for the verses.",
"varseTranslationLanguage": "Verse Transliteration Language",
"verseTanslationSource": "Verse Translation Source",
Expand Down
1 change: 1 addition & 0 deletions bhagavad_gita/lib/lang/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"Language": "भाषा",
"setting": "सेटिंग्स",
"author": "लेखक",
"bibliography": "ग्रंथ सूची",
"hideShowLanguage": "छंदों के लिए इन विकल्पों को दिखाएँ/छिपाएँ।",
"varseTranslationLanguage": "श्लोक लिप्यंतरण भाषा",
"verseTanslationSource": "श्लोक अनुवाद स्रोत",
Expand Down
10 changes: 6 additions & 4 deletions bhagavad_gita/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const AndroidNotificationChannel channel = AndroidNotificationChannel(
'android.intent.category.DEFAULT',
importance: Importance.high,
);

IOSNotificationDetails _iosNotificationDetails = IOSNotificationDetails(
// Changed from IOSNotificationDetails to DarwinNotificationDetails
DarwinNotificationDetails _iosNotificationDetails = DarwinNotificationDetails(
presentAlert: false,
presentBadge: false,
presentSound: true,
Expand Down Expand Up @@ -129,7 +129,8 @@ class _MyAppState extends State<MyApp> {
//// firebase forground notification

final AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings('@mipmap/ic_notification');
var iOSSettings = IOSInitializationSettings(
// Changed from IOSInitializationSettings to DarwinInitializationSettings
var iOSSettings = DarwinInitializationSettings(
requestSoundPermission: false,
requestBadgePermission: false,
requestAlertPermission: false,
Expand All @@ -138,7 +139,8 @@ final AndroidInitializationSettings initializationSettingsAndroid = AndroidIniti
final InitializationSettings initializationSettings =
InitializationSettings(android: initializationSettingsAndroid, iOS: iOSSettings);
flutterLocalNotificationsPlugin.initialize(initializationSettings,
onSelectNotification: (message) async {
// Changed from onSelectNotification to onDidReceiveNotificationResponse
onDidReceiveNotificationResponse: (message) async {
print("message-----$message");
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
Expand Down
206 changes: 206 additions & 0 deletions bhagavad_gita/lib/screens/setting_screens/bibliography.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
import 'dart:io' show Platform;
import 'package:bhagavad_gita/Constant/app_colors.dart';
import 'package:bhagavad_gita/Constant/app_size_config.dart';
import 'package:bhagavad_gita/localization/demo_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:bhagavad_gita/screens/setting_screens/open_setting_screen.dart';
import 'package:url_launcher/url_launcher.dart';


class BibliographyScreen extends StatefulWidget {

@override
State<BibliographyScreen> createState() => _BibliographyScreenState();
}

class _BibliographyScreenState extends State<BibliographyScreen> {
@override
Widget build(BuildContext context) {
height = MediaQuery.of(context).size.height;
width = MediaQuery.of(context).size.width;

Future _launchURLApp({
required String url,
}) async {
var a = Uri.parse(url);

if (await canLaunchUrl(a)) {
await launchUrl(a);
} else {
throw 'Could not launch $url';
}
}

return SafeArea(
child: Scaffold(
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(left:8.0, top:27.0, bottom:8.0, right:8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/icons/icon_left_rtansection.svg"),
SizedBox(width: kDefaultPadding),
Text(
DemoLocalization.of(context)!
.getTranslatedValue('InformationSources')
.toString(),
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize:
(Localizations.localeOf(context).languageCode ==
'hi')
? 15
: 13,
fontWeight: FontWeight.w600,
),
),
SizedBox(width: kDefaultPadding),
SvgPicture.asset("assets/icons/icon_right_translation.svg")
],
),
),
SizedBox(height: kDefaultPadding),

Padding(
padding: EdgeInsets.all(kDefaultPadding),
child: Container(
height: 40,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(width: 0.5, color: textLightGreyColor),
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
_launchURL();
},
child: Padding(
padding: EdgeInsets.only(
left: kPadding * 2, right: kDefaultPadding),
child: Align(
alignment: Alignment.center,
child: Row(
children: [
Align(
alignment: Alignment.center,
child: Text("Text")),
Spacer(),
],
),
),
),
),
),
),
),
),

Padding(
padding: EdgeInsets.all(kDefaultPadding),
child: GestureDetector(
onTap: _launchURL1,
child: Container(
height: 40,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(width: 0.5, color: textLightGreyColor),
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
_launchURL1();
},
child: Padding(
padding: EdgeInsets.only(
left: kPadding * 2, right: kDefaultPadding),
child: Row(
children: [
Text("Audio"),
Spacer(),
],
),
),
),
),
),
),
),
),

Padding(
padding: EdgeInsets.all(kDefaultPadding),
child: GestureDetector(
onTap: _launchURL1,
child: Container(
height: 90,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(width: 0.5, color: textLightGreyColor),
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
_launchURLApp(url: 'mailto:[email protected]');
},
child: Padding(
padding: EdgeInsets.only(
left: kPadding * 2, right: kDefaultPadding),
child: Row(
children: [
Text(
"Email us at [email protected] \n to report copyright voilations"),
Spacer(),
],
),
),
),
),
),
),
),
),
],
),
),
),
),
);
}

_launchURL() async {
const url = 'https://www.gitasupersite.iitk.ac.in/';
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
throw 'Could not launch $url';
}
}

_launchURL1() async {
const url = 'https://www.bhagavad-gita.org/';
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
throw 'Could not launch $url';
}
}
}
122 changes: 122 additions & 0 deletions bhagavad_gita/lib/screens/setting_screens/open_setting_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:bhagavad_gita/Constant/app_size_config.dart';
import 'package:bhagavad_gita/Constant/static_model.dart';
import 'package:bhagavad_gita/Constant/string_constant.dart';
import 'package:bhagavad_gita/localization/demo_localization.dart';
import 'package:bhagavad_gita/screens/setting_screens/bibliography.dart';
import 'package:bhagavad_gita/screens/setting_screens/language_setting.dart';
import 'package:bhagavad_gita/screens/setting_screens/verse_commentary_screen.dart';
import 'package:bhagavad_gita/screens/setting_screens/verse_translation_screen.dart';
Expand Down Expand Up @@ -386,6 +387,127 @@ class _SettingScreenState extends State<SettingScreen> {
),
),
),

// Code for Bibliography Page

Divider(
indent: kPadding * 2,
endIndent: kPadding * 2,
),
Container(
height: kPadding * 3,
width: double.infinity,
color: Colors.orange[50],
child: Row(
children: [
SizedBox(width: kDefaultPadding),
Text(
DemoLocalization.of(context)!
.getTranslatedValue('bibliography')
.toString(),
style: Theme.of(context).textTheme.headline1!.copyWith(
color: settingColor,
fontSize: 12,
letterSpacing: 1,
),
),
],
),
),
Padding(
padding: EdgeInsets.all(kDefaultPadding),
child: Container(
height: 40,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(width: 0.5, color: textLightGreyColor),
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BibliographyScreen(),
),
);
setDefaultVar();
},
child: Padding(
padding: EdgeInsets.only(
left: kPadding * 2, right: kDefaultPadding),
child: Row(
children: [
// Text(langauge.toUpperCase().replaceAll("\"", "")),
Text("SOURCES"),
Spacer(),
SvgPicture.asset(
'assets/icons/icn_arrow_forward.svg')
],
),
),
),
),
),
),
),
// AnimatedContainer(
// height: isCommentarySource ? 70 : 0,
// duration: Duration(milliseconds: 300),
// child: Padding(
// padding: EdgeInsets.all(kPadding * 1.5),
// child: Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// border: Border.all(width: 0.5, color: textLightGreyColor),
// ),
// child: ClipRRect(
// borderRadius: BorderRadius.all(Radius.circular(10)),
// child: Material(
// color: Colors.transparent,
// child: InkWell(
// onTap: () async {
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => BibliographyScreen(),
// ),
// );
// setDefaultVar();
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: kPadding * 1.5, right: kPadding * 1.5),
// child: Row(
// children: [
// Expanded(
// child: Text(
// savedVerseCommentary.title!,
// style: Theme.of(context)
// .textTheme
// .subtitle1!
// .copyWith(fontSize: 13),
// overflow: TextOverflow.fade,
// maxLines: 1,
// softWrap: false,
// ),
// ),
// SizedBox(width: 4),
// SvgPicture.asset(
// 'assets/icons/icn_arrow_forward.svg')
// ],
// ),
// ),
// ),
// ),
// ),
// ),
// ),
// ),
/*Container(
height: kPadding * 3,
width: double.infinity,
Expand Down
Loading