Skip to content

Commit

Permalink
Merge pull request #65 from OpenPecha/develop
Browse files Browse the repository at this point in the history
update feedbacks
  • Loading branch information
tentamdin authored Dec 11, 2024
2 parents 3bb60f6 + 56e9101 commit 5d286f0
Show file tree
Hide file tree
Showing 24 changed files with 203 additions and 47 deletions.
Binary file added assets/media/17109258772024-01-30.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/media/1710929961IMG20220622104550.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/media/1710930394IMG_1116.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,14 @@
DEVELOPMENT_TEAM = N9G5QJKAY4;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Gonpa Tour";
IPHONEOS_DEPLOYMENT_TARGET = 15.5.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 15.5.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.cta.gonpatour;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -676,12 +678,14 @@
DEVELOPMENT_TEAM = N9G5QJKAY4;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Gonpa Tour";
IPHONEOS_DEPLOYMENT_TARGET = 15.5.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 15.5.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.cta.gonpatour;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -701,12 +705,14 @@
DEVELOPMENT_TEAM = N9G5QJKAY4;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Gonpa Tour";
IPHONEOS_DEPLOYMENT_TARGET = 15.5.0;
"IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 15.5.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.cta.gonpatour;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
8 changes: 7 additions & 1 deletion lib/config/go_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:gompa_tour/ui/screen/festival_detail_screen.dart';
import 'package:gompa_tour/ui/screen/festival_list_screen.dart';
import 'package:gompa_tour/ui/screen/organization_detail_screen.dart';
import 'package:gompa_tour/ui/screen/organization_list_screen.dart';
import 'package:gompa_tour/ui/screen/orginatzations_screen.dart';

import '../ui/screen/deities_detail_screen.dart';
import '../ui/screen/skeleton_screen.dart';
Expand Down Expand Up @@ -32,9 +33,14 @@ final router = GoRouter(
GoRoute(
path: OrganizationListScreen.routeName,
builder: (context, state) {
return const OrganizationListScreen();
return OrganizationListScreen();
},
),
GoRoute(
path: OrginatzationsScreen.routeName,
builder: (context, state) {
return const OrginatzationsScreen();
}),
GoRoute(
path: OrganizationDetailScreen.routeName,
builder: (context, state) {
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/localization_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LocalizationHelper {
return "${localizedText.substring(0, maxLength)}...";
}

return localizedText;
return localizedText.replaceAll(RegExp(r'\\r\\n|\\n'), '\n');
}

static double? getLocalizedHeight(BuildContext buildContext) {
Expand Down
13 changes: 10 additions & 3 deletions lib/l10n/app_bo.arb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"contactSupport": "འབྲེལ་མཐུད།",
"sendEmail": "གློག་འཕྲིན་",
"close": "ཁ་རྒྱག",
"recentSearches": "ཉེ་ཆར་གྱི་འཚོལ་བྱེད",
"suggestion": "འོས་སྦྱོར",
"recentSearches": "ཉེ་ཆར་གྱི་འཚོལ་བྱེད",
"suggestion": "འོས་སྦྱོར",
"detail": "ཞིབ་ཕྲ།",
"deities": "རྟེན་བཤད།",
"organizations": "ཆོས་སྡེ།",
Expand All @@ -41,5 +41,12 @@
"nepal": "བལ་ཡུལ།",
"bhutan": "འབྲུག་ཡུལ།",
"darkMode": "འཆར་ངོས་ནག་པོ།",
"theme": "འཆར་ངོས།"
"theme": "འཆར་ངོས།",
"nyingma": "རྙིང་མ།",
"kagyu": "བཀའ་བརྒྱུད།",
"sakya": "ས་སྐྱ།",
"gelug": "དགེ་ལུགས།",
"bon": "བོན།",
"jonang": "ཇོ་ནང།",
"others": "གཞན།"
}
11 changes: 9 additions & 2 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"organizations": "Monastery",
"festival": "Festival",
"deity": "Deity",
"organization": "Organization",
"organization": "Monastery",
"scanQrCode": "Scan QR Code",
"address": "Address",
"location": "Location",
Expand All @@ -41,5 +41,12 @@
"nepal": "Nepal",
"bhutan": "Bhutan",
"darkMode": "Dark Mode",
"theme": "Theme"
"theme": "Theme",
"nyingma": "Nyingma",
"kagyu": "Kagyu",
"sakya": "Sakya",
"gelug": "Gelug",
"bon": "Bon",
"jonang": "Jonang",
"others": "Others"
}
8 changes: 6 additions & 2 deletions lib/repo/database_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ class DatabaseRepository<T> {
);
}

Future<List<T>> getSortedPaginatedOrganization(int page, int pageSize) async {
Future<List<T>> getSortedPaginatedOrganization(
int page, int pageSize, String category) async {
final db = await dbHelper.database;
final sanitizedCategory =
category.replaceAll("'", "''"); // Prevent SQL injection
final maps = await db.query(
tableName,
orderBy: 'categories asc',
where: 'categories LIKE ?',
whereArgs: ['%$sanitizedCategory%'],
limit: pageSize,
offset: page * pageSize,
);
Expand Down
10 changes: 5 additions & 5 deletions lib/states/organization_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ class OrganizationNotifier extends StateNotifier<OrganizationListState> {
OrganizationNotifier(this.repository)
: super(OrganizationListState.initial());

Future<void> fetchInitialOrganizations() async {
Future<void> fetchInitialOrganizations(String category) async {
state = state.copyWith(isLoading: true);
try {
final initialOrganizations =
await repository.getSortedPaginatedOrganization(0, state.pageSize);
final initialOrganizations = await repository
.getSortedPaginatedOrganization(0, state.pageSize, category);
state = state.copyWith(
organizations: initialOrganizations,
page: 1,
Expand All @@ -84,14 +84,14 @@ class OrganizationNotifier extends StateNotifier<OrganizationListState> {
);
}

Future<void> fetchPaginatedOrganizations() async {
Future<void> fetchPaginatedOrganizations(String category) async {
if (state.isLoading || state.hasReachedMax) return;

try {
state = state.copyWith(isLoading: true);

final newOrganizations = await repository.getSortedPaginatedOrganization(
state.page, state.pageSize);
state.page, state.pageSize, category);

final hasReachedMax = newOrganizations.length < state.pageSize;

Expand Down
8 changes: 6 additions & 2 deletions lib/ui/screen/deities_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class DeityDetailScreen extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final selectedDeity = ref.watch(selectedDeityProvider);
final height = MediaQuery.of(context).size.height;
Locale locale = Localizations.localeOf(context);

if (selectedDeity == null) {
return const Scaffold(
Expand All @@ -40,9 +41,10 @@ class DeityDetailScreen extends ConsumerWidget {
enText: selectedDeity.enTitle,
boText: selectedDeity.tbTitle,
),
style: const TextStyle(
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
height: context.getLocalizedHeight(),
),
),
),
Expand Down Expand Up @@ -73,7 +75,9 @@ class DeityDetailScreen extends ConsumerWidget {
boText: selectedDeity.tbContent,
),
style: TextStyle(
fontSize: 16, height: context.getLocalizedHeight()),
fontSize: 16,
height: context.getLocalizedHeight(),
),
),
if (selectedDeity.slug != null) ...[
const SizedBox(height: 16),
Expand Down
7 changes: 5 additions & 2 deletions lib/ui/screen/festival_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class FestivalDetailScreen extends ConsumerWidget {
enText: selectedFestival.eventEnName!,
boText: selectedFestival.eventTbName!,
),
style: const TextStyle(
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
height: context.getLocalizedHeight(),
),
),
),
Expand All @@ -62,7 +63,9 @@ class FestivalDetailScreen extends ConsumerWidget {
boText: selectedFestival.tbDescription!,
),
style: TextStyle(
fontSize: 16, height: context.getLocalizedHeight()),
fontSize: 16,
height: context.getLocalizedHeight(),
),
),
if (selectedFestival.slug != null) ...[
const SizedBox(height: 16),
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/screen/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:go_router/go_router.dart';
import 'package:gompa_tour/ui/screen/deities_list_screen.dart';
import 'package:gompa_tour/ui/screen/festival_list_screen.dart';
import 'package:gompa_tour/ui/screen/organization_list_screen.dart';
import 'package:gompa_tour/ui/screen/orginatzations_screen.dart';
import 'package:gompa_tour/util/enum.dart';

class HomeScreen extends ConsumerWidget {
Expand Down Expand Up @@ -49,7 +50,7 @@ class HomeScreen extends ConsumerWidget {
context.push(DeitiesListScreen.routeName);
return;
case MenuType.organization:
context.push(OrganizationListScreen.routeName);
context.push(OrginatzationsScreen.routeName);
return;
case MenuType.festival:
context.push(FestivalListScreen.routeName);
Expand Down
10 changes: 8 additions & 2 deletions lib/ui/screen/map_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ class _MapScreenState extends ConsumerState<MapScreen> {
children: [
Text(
selectedOrganization.tbTitle,
style: const TextStyle(
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
height: context.getLocalizedHeight(),
),
),
const SizedBox(height: 8),
Expand All @@ -162,6 +163,9 @@ class _MapScreenState extends ConsumerState<MapScreen> {
boText: selectedOrganization.tbContent,
maxLength: kDescriptionMaxLength,
),
style: TextStyle(
height: context.getLocalizedHeight(),
)
),
const SizedBox(height: 12),
Row(
Expand All @@ -174,7 +178,9 @@ class _MapScreenState extends ConsumerState<MapScreen> {
.state = selectedOrganization;
context.push(OrganizationDetailScreen.routeName);
},
child: Text(AppLocalizations.of(context)!.detail),
child: Text(
AppLocalizations.of(context)!.detail,
),
),
TextButton(
onPressed: () => ref
Expand Down
12 changes: 7 additions & 5 deletions lib/ui/screen/organization_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ class OrganizationDetailScreen extends ConsumerWidget {
enText: selectedOrganization.enTitle,
boText: selectedOrganization.tbTitle,
),
style: const TextStyle(
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
height: context.getLocalizedHeight(),
),
),
),
Expand Down Expand Up @@ -71,11 +72,12 @@ class OrganizationDetailScreen extends ConsumerWidget {
const SizedBox(height: 16),
Text(
context.localizedText(
enText: selectedOrganization.enContent,
boText: selectedOrganization.tbContent,
),
enText: selectedOrganization.enContent,
boText: selectedOrganization.tbContent),
style: TextStyle(
fontSize: 16, height: context.getLocalizedHeight()),
fontSize: 16,
height: context.getLocalizedHeight(),
),
),
const SizedBox(height: 16),
AddressCard(
Expand Down
11 changes: 8 additions & 3 deletions lib/ui/screen/organization_list_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import 'package:gompa_tour/ui/widget/organization_card_item.dart';

class OrganizationListScreen extends ConsumerStatefulWidget {
static const String routeName = '/organization-list';
final String? category;

const OrganizationListScreen({super.key});
OrganizationListScreen({
super.key,
this.category,
});

@override
ConsumerState createState() => _DetiesListScreenState();
Expand All @@ -22,7 +26,7 @@ class _DetiesListScreenState extends ConsumerState<OrganizationListScreen> {
// Fetch initial deities when the screen is first loaded
organizationNotifier = ref.read(organizationNotifierProvider.notifier);
WidgetsBinding.instance.addPostFrameCallback((_) {
organizationNotifier.fetchInitialOrganizations();
organizationNotifier.fetchInitialOrganizations(widget.category ?? '');
});
}

Expand All @@ -36,7 +40,8 @@ class _DetiesListScreenState extends ConsumerState<OrganizationListScreen> {
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent &&
!organizationState.isLoading &&
!organizationState.hasReachedMax) {
organizationNotifier.fetchPaginatedOrganizations();
organizationNotifier
.fetchPaginatedOrganizations(widget.category ?? '');
}
return false;
},
Expand Down
Loading

0 comments on commit 5d286f0

Please sign in to comment.