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

[Fix] Bottom OptionBar is blocked when page length is not scrollable #87 FIxed #131

Open
wants to merge 3 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
6 changes: 3 additions & 3 deletions bhagavad_gita/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.8.22'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:7.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
}
Expand All @@ -25,6 +25,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
99 changes: 52 additions & 47 deletions bhagavad_gita/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore_for_file: deprecated_member_use

import 'dart:io';

import 'package:bhagavad_gita/Constant/app_colors.dart';
Expand All @@ -16,13 +14,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart';

// import 'package:flutter/foundation.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';

///// firbase push notification in Background
Future<void> onBackgroundMessage(RemoteMessage message) async {

}
Future<void> onBackgroundMessage(RemoteMessage message) async {}

///// Android notification channel
const AndroidNotificationChannel channel = AndroidNotificationChannel(
Expand All @@ -31,23 +28,20 @@ const AndroidNotificationChannel channel = AndroidNotificationChannel(
importance: Importance.high,
);

IOSNotificationDetails _iosNotificationDetails = IOSNotificationDetails(
IOSNotificationDetails _iosNotificationDetails = IOSNotificationDetails(
presentAlert: false,
presentBadge: false,
presentSound: true,
subtitle: "",
threadIdentifier: ""
);

subtitle: "",
threadIdentifier: "");

enableIOSNotifications() async {
await FirebaseMessaging.instance
.setForegroundNotificationPresentationOptions(
alert: true, // Required to display a heads up notification
badge: true,
sound: true,
);
}
await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
alert: true, // Required to display a heads up notification
badge: true,
sound: true,
);
}

final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
Expand All @@ -57,11 +51,10 @@ Future<void> main() async {

//// firebase initialized
await Firebase.initializeApp();
if(Platform.isIOS){
if (Platform.isIOS) {
await enableIOSNotifications();
}



//// firebase subscribeTopic
await FirebaseMessaging.instance.subscribeToTopic('Bhagavad-gita-app');
FirebaseMessaging.onBackgroundMessage(onBackgroundMessage);
Expand All @@ -70,7 +63,7 @@ Future<void> main() async {
AndroidFlutterLocalNotificationsPlugin>()
?.createNotificationChannel(channel);

await flutterLocalNotificationsPlugin
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
Expand Down Expand Up @@ -111,35 +104,37 @@ class _MyAppState extends State<MyApp> {
});

void requestIOSPermissions(
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) {
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
}
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) {
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
}
}

@override
void initState() {
super.initState();
//// firebase forground notification

final AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings('@mipmap/ic_notification');
final AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('@mipmap/ic_notification');
var iOSSettings = IOSInitializationSettings(
requestSoundPermission: false,
requestBadgePermission: false,
requestAlertPermission: false,
);

final InitializationSettings initializationSettings =
InitializationSettings(android: initializationSettingsAndroid, iOS: iOSSettings);
InitializationSettings(
android: initializationSettingsAndroid, iOS: iOSSettings);
flutterLocalNotificationsPlugin.initialize(initializationSettings,
onSelectNotification: (message) async {
print("message-----$message");
print("message-----$message");
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
RemoteNotification? notification = message.notification;
Expand Down Expand Up @@ -187,32 +182,42 @@ final AndroidInitializationSettings initializationSettingsAndroid = AndroidIniti
return supportedLocales.first;
},
theme: ThemeData(
accentColor: orangeColor,
hintColor: orangeColor,
fontFamily: 'Inter',
textTheme: TextTheme(
headline1: TextStyle(
displayLarge: TextStyle(
color: appBarTitleColor,
fontSize: 26,
fontWeight: FontWeight.w700),
headline2: TextStyle(
displayMedium: TextStyle(
color: appBarTitleColor,
fontSize: 14,
fontWeight: FontWeight.w600),
subtitle1: TextStyle(
titleMedium: TextStyle(
color: appBarTitleColor,
fontSize: 16,
fontWeight: FontWeight.w400),
),
// appBarTheme: AppBarTheme(
// color: Colors.white,
// elevation: 0,
// titleTextStyle: TextStyle(color: appBarTitleColor),
// textTheme: TextTheme(
// headline1: TextStyle(
// color: appBarTitleColor,
// fontSize: 26,
// fontWeight: FontWeight.w700,
// fontFamily: 'Inter'),
// ),
// ),
appBarTheme: AppBarTheme(
color: Colors.white,
elevation: 0,
titleTextStyle: TextStyle(color: appBarTitleColor),
textTheme: TextTheme(
headline1: TextStyle(
color: appBarTitleColor,
fontSize: 26,
fontWeight: FontWeight.w700,
fontFamily: 'Inter'),
backgroundColor: Colors.white,
titleTextStyle: TextStyle(
color: appBarTitleColor,
fontFamily: 'Inter',
fontSize: 26,
fontWeight: FontWeight.w700,
),
),
primaryColor: primaryColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:bhagavad_gita/localization/demo_localization.dart';
import 'package:bhagavad_gita/models/color_selection_model.dart';
import 'package:bhagavad_gita/services/navigator_service.dart';
import 'package:bhagavad_gita/widgets/line_space_widget.dart';
import 'package:flutter/cupertino.dart';
// import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import '../../locator.dart';
Expand Down Expand Up @@ -75,7 +75,7 @@ class _BottomNavigationMenuState extends State<BottomNavigationMenu> {
.toString(),
style: Theme.of(context)
.textTheme
.headline2!
.displayMedium!
.copyWith(height: 1.5, color: greyScalBodyColor),
),
SizedBox(width: 175),
Expand All @@ -85,7 +85,7 @@ class _BottomNavigationMenuState extends State<BottomNavigationMenu> {
.toString(),
style: Theme.of(context)
.textTheme
.headline2!
.displayMedium!
.copyWith(height: 1.5, color: greyScalBodyColor),
),
],
Expand Down Expand Up @@ -173,7 +173,7 @@ class _BottomNavigationMenuState extends State<BottomNavigationMenu> {
fontFamilyName,
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(
fontSize: 18, color: titleLableColor),
),
Expand All @@ -196,7 +196,7 @@ class _BottomNavigationMenuState extends State<BottomNavigationMenu> {
.toString(),
style: Theme.of(context)
.textTheme
.headline2!
.displayMedium!
.copyWith(height: 1.5, color: greyScalBodyColor),
),
SizedBox(height: 10),
Expand Down Expand Up @@ -262,7 +262,7 @@ class _BottomNavigationMenuState extends State<BottomNavigationMenu> {
DemoLocalization.of(context)!
.getTranslatedValue('colorMode')
.toString(),
style: Theme.of(context).textTheme.headline2,
style: Theme.of(context).textTheme.displayMedium,
),
SizedBox(height: 10),
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:bhagavad_gita/Constant/app_size_config.dart';
import 'package:bhagavad_gita/localization/demo_localization.dart';
import 'package:bhagavad_gita/services/navigator_service.dart';
import 'package:bhagavad_gita/services/shared_preferences.dart';
import 'package:flutter/cupertino.dart';
// import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import '../../locator.dart';
Expand Down Expand Up @@ -73,7 +73,7 @@ class _InterClickState extends State<InterClick> {
DemoLocalization.of(context)!
.getTranslatedValue('fontFamily')
.toString(),
style: Theme.of(context).textTheme.headline2!.copyWith(
style: Theme.of(context).textTheme.displayMedium!.copyWith(
color: Colors.black,
fontSize: 14,
height: 1.5,
Expand Down
61 changes: 42 additions & 19 deletions bhagavad_gita/lib/screens/chapter_detail/chapter_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class _ChapterDetailScreenState extends State<ChapterDetailScreen> {
},
child: Text(
StringConstant.strAa,
style: Theme.of(context).textTheme.headline1!.copyWith(
style: Theme.of(context).textTheme.displayLarge!.copyWith(
fontSize: 18,
color: formatingColor.naviagationIconColor,
fontWeight: FontWeight.w100,
Expand Down Expand Up @@ -222,46 +222,66 @@ class _ChapterDetailScreenState extends State<ChapterDetailScreen> {
"${DemoLocalization.of(context)!.getTranslatedValue('chapter').toString()} ${chapterDetailData.gitaChapterById!.chapterNumber ?? 1}",
style: Theme.of(context)
.textTheme
.headline1!
.displayLarge!
.copyWith(
height: lineSpacing,
color: Color(0xffd97706),
fontSize: (Localizations.localeOf(context).languageCode == 'hi') ?
fontSize + 2 : fontSize,
fontSize:
(Localizations.localeOf(context)
.languageCode ==
'hi')
? fontSize + 2
: fontSize,
fontFamily: fontFamily,
),
),
),
SizedBox(height: kPadding),
Text(
(Localizations.localeOf(context).languageCode == 'hi') ? (chapterDetailData
.gitaChapterById!.name ?? "") : chapterDetailData
.gitaChapterById!.nameTranslated ?? "",
(Localizations.localeOf(context).languageCode ==
'hi')
? (chapterDetailData
.gitaChapterById!.name ??
"")
: chapterDetailData
.gitaChapterById!.nameTranslated ??
"",
style: Theme.of(context)
.textTheme
.headline2!
.displayMedium!
.copyWith(
height: lineSpacing,
fontSize: (Localizations.localeOf(context).languageCode == 'hi') ?
fontSize + 4 : fontSize + 2,
fontSize: (Localizations.localeOf(context)
.languageCode ==
'hi')
? fontSize + 4
: fontSize + 2,
fontFamily: fontFamily,
color:
formatingColor.naviagationIconColor,
),
),
SizedBox(height: kDefaultPadding * 2),
Text(
(Localizations.localeOf(context).languageCode == 'hi') ? (chapterDetailData
.gitaChapterById!.chapterSummaryHindi ?? "") : chapterDetailData
.gitaChapterById!.chapterSummary ?? "",
(Localizations.localeOf(context).languageCode ==
'hi')
? (chapterDetailData.gitaChapterById!
.chapterSummaryHindi ??
"")
: chapterDetailData
.gitaChapterById!.chapterSummary ??
"",
maxLines: isShowMoreChapterDetail ? 500 : 4,
overflow: TextOverflow.ellipsis,
style: Theme.of(context)
.textTheme
.subtitle1!
.titleMedium!
.copyWith(
fontSize: (Localizations.localeOf(context).languageCode == 'hi') ?
fontSize + 2 : fontSize,
fontSize: (Localizations.localeOf(context)
.languageCode ==
'hi')
? fontSize + 2
: fontSize,
height: lineSpacing,
fontFamily: fontFamily,
color:
Expand All @@ -287,7 +307,7 @@ class _ChapterDetailScreenState extends State<ChapterDetailScreen> {
.toString(),
style: Theme.of(context)
.textTheme
.headline2!
.displayMedium!
.copyWith(
fontSize: fontSize - 2,
height: lineSpacing,
Expand All @@ -310,8 +330,11 @@ class _ChapterDetailScreenState extends State<ChapterDetailScreen> {
.gitaVersesByChapterId!.nodes![index],
formatingColor: formatingColor,
lineSpacing: lineSpacing,
fontSize: (Localizations.localeOf(context).languageCode == 'hi') ?
fontSize + 2 : fontSize,
fontSize: (Localizations.localeOf(context)
.languageCode ==
'hi')
? fontSize + 2
: fontSize,
fontFamily: fontFamily,
refreshEditing: () {
refreshChapterDetailPage();
Expand Down
Loading