Skip to content

Commit

Permalink
Merge pull request #76 from OpenPecha/home
Browse files Browse the repository at this point in the history
update home, pilgrim, setting. db and localisation. feddback
  • Loading branch information
tentamdin authored Feb 6, 2025
2 parents 090e085 + 5694ac2 commit 395557e
Show file tree
Hide file tree
Showing 18 changed files with 158 additions and 81 deletions.
Binary file modified assets/db/gonpa.db
Binary file not shown.
Binary file added assets/images/dorjee_den.webp
Binary file not shown.
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ PODS:
- Flutter
- FlutterMacOS
- PromisesObjC (2.4.0)
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -74,6 +76,7 @@ DEPENDENCIES:
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
Expand Down Expand Up @@ -105,6 +108,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/mobile_scanner/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite_darwin:
Expand All @@ -130,6 +135,7 @@ SPEC CHECKSUMS:
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
Expand Down
7 changes: 4 additions & 3 deletions lib/l10n/app_bo.arb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@
"sakya": "ས་སྐྱ།",
"gelug": "དགེ་ལུགས།",
"bon": "བོན།",
"jonang": "ཇོ་ནང།",
"jonang": "ཇོ་ནང།",
"others": "གཞན།",
"allGonpa": "དགོན་པ་ཡོངས་རྫོགས",
"allGonpa": "དགོན་པ་ཡོངས་རྫོགས",
"pilgrimage": "གནས།",
"neykor": "གནས་སྐོར།",
"deptName": "༄༅། །བོད་མིའི་སྒྲིག་འཛུགས་ཆོས་རིག་ལས་ཁུངས།"
"deptName": "༄༅། །བོད་མིའི་སྒྲིག་འཛུགས་ཆོས་རིག་ལས་ཁུངས།",
"deptDescription": "༄༅།། འཛམ་གླིང་སྐྱེ་འགྲོའི་བདེ་སྐྱིད་ལ་ཇི་མི་སྙམ་པར་རྒྱ་ནག་སྲིད་གཞུང་གིས་བོད་ནང་བཙན་འཛུལ་བྱས་ཏེ་བོད་ཆོས་ལྡན་གྱི་རྒྱལ་ཁབ་བཙན་བཟུང་བྱས་པར་བརྟེན། ༸གོང་ས་༸སྐྱབས་མགོན་ཆེན་པོ་མཆོག་གིས་སྐྱེ་འགྲོ་སྤྱི་དང༌བྱེ་བྲག་བོད་མིའི་འཕྲལ་ཕུགས་ཕན་བདེ་ལ་དགོངས་པ་ཆེ་བཞེས་ཀྱིས་རྒྱ་གར་འཕགས་པའི་ཡུལ་དུ་༸ཞབས་སོར་འཁོད་འཕྲལ། ཕྱི་ལོ་ ༡༩༥༩ ཟླ་ ༤ ཚེས་ ༢༧ ཉིན་བཞུགས་སྒར་མ་སུ་རིར་དང་ཐོག་༼ཆོས་དོན་ལྷན་ཚོགས་༽ཞེས་པ་གསར་འཛུགས་ཀྱིས་བྲོས་བྱོལ་དུ་ཕེབས་པའི་རིས་མེད་དགེ་འདུན་རྣམས་ལ་གཟིགས་སྐྱོང་དང་། ཆོས་སྡེ་དང་རིག་གཞུང་བསྟི་གནས་བཅས་པ་གསར་འཛུགས་གནང་རྒྱུས་མཚོན། བོད་ཀྱི་ཆོས་དང་རིག་གཞུང་མི་ཉམས་རྒྱུན་འཛིན་དང་ཉམས་པ་སླར་གསོ་བྱ་རྒྱུའི་ལས་དོན་ཆེ་ཕྲ་མང་པོ་བསྐྱངས་པ་ནས་བཟུང་། ཕྱི་ལོ་ ༡༩༨༢ ཟླ་ ༤ ཚེས་ ༢༥ ཉིན་གནས་ཡུལ་རྒྱལ་ཁབ་ཀྱི་ཁྲིམས་སྲོལ་དང་མཐུན་པར་བོད་ཀྱི་རིག་གཞུང་ཚོགས་པ་དང༌། ཕྱི་ལོ་ ༡༩༩༨ ཟླ་ ༦ ཚེས་ ༡༩ ཉིན་བོད་ཀྱི་ཆོས་དང་རིག་གཞུང་ཚོགས་པ་ཞེས་པའི་མཚན་ཐོག་དེབ་བསྐྱེལ་དང་སྦྲགས་མང་གཙོའི་ཁྲིམས་ལུགས་ལྡན་པའི་དབུས་བོད་མིའི་སྒྲིག་འཛུགས་ཀྱི་འཛིན་སྐྱོང་སྡེ་ཚན་ཁོངས་ལྷན་ཁང་ཞིག་གི་ངོ་བོར་༼ཆོས་རིག་ལས་ཁུངས།༽ཞེས་གནས་ཡོད།"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
"allGonpa": "All Gonpa",
"pilgrimage": "Pilgrimage",
"neykor": "Neykor",
"deptName": "Department of Religion and Culture"
"deptName": "Department of Religion and Culture",
"deptDescription": "The Department of Religion and Culture is a ministry office established under the executive organ of Central Tibetan Administration whose function is to overlook religious and cultural affairs in Tibetan exile community. It has the responsibility of supervising works aimed at reviving, preserving, and promotion of Tibetan religious and cultural heritage that is being led to the verge of extinction in Tibet.\nIt began its operation in exile community as Council for Religious Affairs office on April 27, 1959, headed by a Director and constituted by the representative of the four Buddhist schools as its principal members in Mussorrie. On 30th May 1960, the Council for Religious Affairs shifted its office to Dharamsala and on September 12, 1960, it became one of the seven main departments when His Holiness the Dalai Lama formally established the Central Tibetan Administration (CTA).\nUnder the affiliation of this department, there are 255 monasteries and 37 nunneries in India, Nepal and Bhutan and also five cultural institutions across India"
}
4 changes: 4 additions & 0 deletions lib/models/pilgrimage_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Pilgrimage {
final String address;
final String state;
final String country;
final String map;
final DateTime? createdAt;
final DateTime? updatedAt;

Expand All @@ -23,6 +24,7 @@ class Pilgrimage {
required this.address,
required this.state,
required this.country,
required this.map,
this.createdAt,
this.updatedAt,
});
Expand All @@ -39,6 +41,7 @@ class Pilgrimage {
address: map['address'] as String,
state: map['state'] as String,
country: map['country'] as String,
map: map['map'] as String,
createdAt: map['created_at'] != null
? DateTime.parse(map['created_at'] as String)
: null,
Expand All @@ -60,6 +63,7 @@ class Pilgrimage {
'address': address,
'state': state,
'country': country,
'map': map,
'created_at': createdAt?.toIso8601String(),
'updated_at': updatedAt?.toIso8601String(),
};
Expand Down
108 changes: 61 additions & 47 deletions lib/ui/screen/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,41 +160,38 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
Widget _buildCategoryCards(BuildContext context) {
return _searchController.text.isEmpty
? Expanded(
child: Center(
child: GridView.count(
crossAxisCount: 2,
padding: EdgeInsets.all(8),
mainAxisSpacing: 16,
crossAxisSpacing: 16,
shrinkWrap: true,
childAspectRatio: 1,
children: [
_buildCard(
MenuType.deities,
'assets/images/buddha.png',
context,
totalDeity,
),
_buildCard(
MenuType.organization,
'assets/images/potala2.png',
context,
totalOrganization,
),
_buildCard(
MenuType.pilgrimage,
'assets/images/duchen.png',
context,
totalPilgrimage,
),
_buildCard(
MenuType.festival,
'assets/images/duchen.png',
context,
totalFestival,
),
],
),
child: GridView.count(
crossAxisCount: 2,
padding: EdgeInsets.all(8),
mainAxisSpacing: 16,
crossAxisSpacing: 16,
childAspectRatio: 0.8,
children: [
_buildCard(
MenuType.deities,
'assets/images/buddha.png',
context,
totalDeity,
),
_buildCard(
MenuType.organization,
'assets/images/potala2.png',
context,
totalOrganization,
),
_buildCard(
MenuType.pilgrimage,
'assets/images/dorjee_den.webp',
context,
totalPilgrimage,
),
_buildCard(
MenuType.festival,
'assets/images/duchen.png',
context,
totalFestival,
),
],
),
)
: const SizedBox();
Expand Down Expand Up @@ -225,22 +222,39 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
color: Theme.of(context).colorScheme.surfaceContainer,
child: Column(
children: [
Flexible(
child: Image.asset(
imagePath,
// height: 120,
// fit: BoxFit.contain,
Expanded(
flex: 3,
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.asset(
imagePath,
fit: BoxFit.contain,
),
),
),
Text(
_getTitle(type, context),
style: const TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
const SizedBox(height: 8),
Expanded(
flex: 2, // Give less space to text content
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
_getTitle(type, context),
style: const TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 8),
Text(count.toString(),
style: TextStyle(
fontSize: 16,
color: Colors.grey.shade600,
)),
const SizedBox(height: 8),
],
),
),
Text(count.toString()),
const SizedBox(height: 8),
],
),
),
Expand Down
12 changes: 2 additions & 10 deletions lib/ui/screen/orginatzations_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,10 @@ class _OrginatzationsScreenState extends ConsumerState<OrginatzationsScreen> {
horizontal: 16,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_getTitle(organization.values.first, context),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
Expand All @@ -178,9 +177,9 @@ class _OrginatzationsScreenState extends ConsumerState<OrginatzationsScreen> {
const SizedBox(height: 8),
Text(
organization.values.last.toString(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.grey.shade600,
),
),
],
Expand Down Expand Up @@ -258,13 +257,6 @@ class _OrginatzationsScreenState extends ConsumerState<OrginatzationsScreen> {
},
)
: const SizedBox(),
// IconButton(
// icon: Icon(Icons.qr_code),
// onPressed: () {
// ref.read(bottomNavProvider.notifier).setAndPersistValue(2);
// Navigator.pop(context);
// },
// )
],
hintText: AppLocalizations.of(context)!.search,
onChanged: (value) {
Expand Down
8 changes: 7 additions & 1 deletion lib/ui/screen/pilgrimage_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter/material.dart';
import 'package:gompa_tour/states/pilgrimage_state.dart';
import 'package:gompa_tour/ui/widget/card_tag.dart';
import 'package:gompa_tour/ui/widget/gonap_qr_card.dart';
import 'package:gompa_tour/ui/widget/gonpa_app_bar.dart';
import 'package:gompa_tour/helper/localization_helper.dart';
import 'package:gompa_tour/ui/widget/gonpa_cache_image.dart';
import 'package:gompa_tour/ui/widget/location_card.dart';

class PilgrimageDetailScreen extends ConsumerWidget {
static const String routeName = '/pilgrimage-detail';
Expand Down Expand Up @@ -86,6 +86,12 @@ class PilgrimageDetailScreen extends ConsumerWidget {
height: context.getLocalizedHeight(),
),
),
const SizedBox(
height: 16,
),
LocationCard(
address: selectedPilgrimage,
),
],
),
),
Expand Down
29 changes: 16 additions & 13 deletions lib/ui/screen/settings_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:share_plus/share_plus.dart';

class SettingsScreen extends ConsumerWidget {
const SettingsScreen({super.key});
Expand Down Expand Up @@ -62,10 +63,10 @@ class SettingsScreen extends ConsumerWidget {
child: SettingsListTile(
leading: const Icon(Icons.share),
title: AppLocalizations.of(context)!.shareApp,
onTap: () => _showDialog(
context,
DialogContent.aboutUs,
),
onTap: () {
Share.share(
"https://play.google.com/store/apps/details?id=com.chorig.tibetanprayer");
},
),
),
];
Expand All @@ -80,7 +81,7 @@ class SettingsScreen extends ConsumerWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: _getDialogContent(content),
children: _getDialogContent(content, context),
),
),
actions: [
Expand All @@ -106,8 +107,9 @@ class SettingsScreen extends ConsumerWidget {
}
}

List<Widget> _getDialogContent(DialogContent content) {
List<Widget> _getDialogContent(DialogContent content, BuildContext context) {
const spacing = SizedBox(height: 16);
Locale locale = Localizations.localeOf(context);

switch (content) {
case DialogContent.contact:
Expand All @@ -123,13 +125,14 @@ class SettingsScreen extends ConsumerWidget {
];
case DialogContent.aboutUs:
return [
const Text(
"The Department of Religion and Culture is a ministry office established under the executive organ of Central Tibetan Administration whose function is to overlook religious and cultural affairs in Tibetan exile community. It has the responsibility of supervising works aimed at reviving, preserving, and promotion of Tibetan religious and cultural heritage that is being led to the verge of extinction in Tibet."),
const Text(
"It began its operation in exile community as Council for Religious Affairs office on April 27, 1959, headed by a Director and constituted by the representative of the four Buddhist schools as its principal members in Mussorrie. On 30th May 1960, the Council for Religious Affairs shifted its office to Dharamsala and on September 12, 1960, it became one of the seven main departments when His Holiness the Dalai Lama formally established the Central Tibetan Administration (CTA)."),
const Text(
"Under the affiliation of this department, there are 255 monasteries and 37 nunneries in India, Nepal and Bhutan and also five cultural institutions across India"),
// Add other texts as needed
Text(
AppLocalizations.of(context)!.deptDescription,
style: TextStyle(
fontSize: 16,
height: locale.languageCode == 'bo' ? 2 : 1.5,
),
),
spacing,
];
case DialogContent.prayerApp:
return [
Expand Down
4 changes: 0 additions & 4 deletions lib/ui/screen/skeleton_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ class SkeletonScreen extends ConsumerWidget {
],
),
]),
// IconButton(
// icon: const Icon(Icons.more_vert),
// onPressed: () {},
// ),
],
),
body: AnimatedSwitcher(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widget/gonpa_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GonpaAppBar extends ConsumerWidget implements PreferredSizeWidget {
)
: null,
title: Text(
"Neykor",
AppLocalizations.of(context)!.neykor,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
Expand Down
9 changes: 8 additions & 1 deletion lib/ui/widget/location_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:gompa_tour/models/organization_model.dart';
import 'package:gompa_tour/models/pilgrimage_model.dart';
import 'package:latlong2/latlong.dart';

import '../../config/constant.dart';

class LocationCard extends StatelessWidget {
final Organization address;
final Object address;
const LocationCard({super.key, required this.address});

@override
Expand Down Expand Up @@ -72,3 +73,9 @@ class LocationCard extends StatelessWidget {
return (latitude, longitude);
}
}

extension on Object {
String get map => this is Organization
? (this as Organization).map
: (this as Pilgrimage).map;
}
Loading

0 comments on commit 395557e

Please sign in to comment.