Quick Links added
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
@@ -12,31 +10,45 @@ class EnquiryScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
// Updated to launch externally and pre-fill the subject
|
||||
Future<void> _launchEmailAddress(String email) async {
|
||||
final Uri emailUri = Uri(scheme: 'mailto', path: email);
|
||||
final Uri emailUri = Uri(
|
||||
scheme: 'mailto',
|
||||
path: email,
|
||||
query: 'subject=Enquiry', // Pre-fills the subject line
|
||||
);
|
||||
if (await canLaunchUrl(emailUri)) {
|
||||
await launchUrl(emailUri);
|
||||
// Use external application mode
|
||||
await launchUrl(emailUri, mode: LaunchMode.externalApplication);
|
||||
} else {
|
||||
debugPrint('${AppLocalizations.of(context).emailLaunchError} $email');
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Could not open email app for $email')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Updated with better error handling
|
||||
Future<void> _launchPhoneNumber(String phone) async {
|
||||
final Uri phoneUri = Uri(scheme: 'tel', path: phone);
|
||||
if (await canLaunchUrl(phoneUri)) {
|
||||
await launchUrl(phoneUri);
|
||||
} else {
|
||||
debugPrint('${AppLocalizations.of(context).dialerLaunchError} $phone');
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Could not open dialer for $phone')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Updated to launch externally
|
||||
Future<void> _launchUrl(String url) async {
|
||||
final Uri uri = Uri.parse(url);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
// Use external application mode
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
} else {
|
||||
// Consider adding a 'urlLaunchError' key to your AppLocalizations
|
||||
debugPrint('Could not launch $url');
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Could not launch $url')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +69,7 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
onTap: () => _launchPhoneNumber(phone),
|
||||
child: Text(phone,
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).scaffoldBackgroundColor)),
|
||||
TextStyle(color: Theme.of(context).colorScheme.primary)), // Changed color for visibility
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -79,13 +91,14 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
GestureDetector(
|
||||
onTap: () => _launchUrl("https://kccb.in/complaint-form"),
|
||||
onTap: () => _launchUrl("https://kccbhp.bank.in/complaint-form/"),
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
Text(
|
||||
"Complaint Form",
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
decoration: TextDecoration.underline, // Added underline for link clarity
|
||||
decorationColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
@@ -150,4 +163,4 @@ class _EnquiryScreen extends State<EnquiryScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/l10n/app_localizations.dart';
|
||||
|
||||
// Data model for a single FAQ item
|
||||
class FaqItem {
|
||||
final String question;
|
||||
final String answer;
|
||||
|
||||
FaqItem({required this.question, required this.answer});
|
||||
}
|
||||
|
||||
class FaqsScreen extends StatefulWidget {
|
||||
const FaqsScreen({super.key});
|
||||
|
||||
@@ -9,55 +17,95 @@ class FaqsScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FaqsScreenState extends State<FaqsScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_getFaqs();
|
||||
}
|
||||
|
||||
// A placeholder for your future API call
|
||||
Future<void> _getFaqs() async {
|
||||
// TODO: Implement API call to fetch FAQs data
|
||||
// For now, simulating a network call with a delay
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
// In a real implementation, you would process the API response here
|
||||
}
|
||||
// List of FAQs
|
||||
final List<FaqItem> _faqs = [
|
||||
FaqItem(
|
||||
question: "How do I log in to the mobile banking app?",
|
||||
answer:
|
||||
"You can log in using your customer number and password. Biometric login (fingerprint) and MPIN is also available for supported devices.",
|
||||
),
|
||||
FaqItem(
|
||||
question: "Is my banking information secure on this app?",
|
||||
answer:
|
||||
"Yes. We use industry-standard encryption and multi-factor authentication to ensure your data is safe.",
|
||||
),
|
||||
FaqItem(
|
||||
question: "How can I check my account balance?",
|
||||
answer:
|
||||
"Once logged in, your account balance will be displayed on the home screen. You can also view detailed balances under the “Accounts” section.",
|
||||
),
|
||||
FaqItem(
|
||||
question: "Can I transfer money to other bank accounts?",
|
||||
answer:
|
||||
"Yes. You can use NEFT, RTGS or IMPS to transfer funds to any bank account in India.",
|
||||
),
|
||||
FaqItem(
|
||||
question: "How do I view my transaction history?",
|
||||
answer:
|
||||
"Click on the “Account Statement” icon under the Home Screen to view recent and past transactions.",
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).faq,
|
||||
softWrap: true,
|
||||
style: const TextStyle(
|
||||
fontSize: 16.5,
|
||||
),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
title: Text(AppLocalizations.of(context).faq),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
// Background logo
|
||||
IgnorePointer(
|
||||
child: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.1, // Low opacity
|
||||
opacity: 0.1,
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 200, // Adjust size as needed
|
||||
height: 200, // Adjust size as needed
|
||||
width: 200,
|
||||
height: 200,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// FAQ List
|
||||
ListView.builder(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
itemCount: _faqs.length,
|
||||
itemBuilder: (context, index) {
|
||||
final faq = _faqs[index];
|
||||
return Card(
|
||||
margin:
|
||||
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0),
|
||||
elevation: 2.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
child: ExpansionTile(
|
||||
title: Text(
|
||||
faq.question,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16.0, 0, 16.0, 16.0),
|
||||
child: Text(
|
||||
faq.answer,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey[700],
|
||||
height: 1.5,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,144 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/l10n/app_localizations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/l10n/app_localizations.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class QuickLinksScreen extends StatefulWidget {
|
||||
const QuickLinksScreen({super.key});
|
||||
// Data model for a single Quick Link item
|
||||
class QuickLink {
|
||||
final String title;
|
||||
final String url;
|
||||
final IconData icon;
|
||||
|
||||
@override
|
||||
State<QuickLinksScreen> createState() => _QuickLinksScreenState();
|
||||
}
|
||||
QuickLink({required this.title, required this.url, required this.icon});
|
||||
}
|
||||
|
||||
class _QuickLinksScreenState extends State<QuickLinksScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_getQuickLinks();
|
||||
}
|
||||
class QuickLinksScreen extends StatefulWidget {
|
||||
const QuickLinksScreen({super.key});
|
||||
|
||||
// A placeholder for your future API call
|
||||
Future<void> _getQuickLinks() async {
|
||||
// TODO: Implement API call to fetch quick links data
|
||||
// For now, simulating a network call with a delay
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
// In a real implementation, you would process the API response here
|
||||
}
|
||||
@override
|
||||
State<QuickLinksScreen> createState() => _QuickLinksScreenState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context).quickLinks),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
IgnorePointer(
|
||||
child: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.1, // Low opacity
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 200, // Adjust size as needed
|
||||
height: 200, // Adjust size as needed
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
class _QuickLinksScreenState extends State<QuickLinksScreen> {
|
||||
// List of Quick Links
|
||||
final List<QuickLink> _quickLinks = [
|
||||
QuickLink(
|
||||
title: "National Bank of Agriculture & Rural Development",
|
||||
url: "http://www.nabard.org/",
|
||||
icon: Icons.account_balance),
|
||||
QuickLink(
|
||||
title: "Reserve Bank of India",
|
||||
url: "http://www.rbi.org.in/home.aspx",
|
||||
icon: Icons.account_balance_wallet),
|
||||
QuickLink(
|
||||
title: "Indian Institute of Banking & Finance",
|
||||
url: "http://www.iibf.org.in/",
|
||||
icon: Icons.school),
|
||||
QuickLink(
|
||||
title: "Indian Bank Association",
|
||||
url: "http://www.iba.org.in/",
|
||||
icon: Icons.group_work),
|
||||
QuickLink(
|
||||
title: "Ministry of Finance",
|
||||
url: "http://www.finmin.nic.in/",
|
||||
icon: Icons.business),
|
||||
QuickLink(
|
||||
title: "Securities Exchange Board of India",
|
||||
url: "http://www.sebi.gov.in/",
|
||||
icon: Icons.show_chart),
|
||||
QuickLink(
|
||||
title: "Insurance Regulatory & Development Authority",
|
||||
url: "https://www.irdai.gov.in/",
|
||||
icon: Icons.shield_outlined),
|
||||
];
|
||||
|
||||
// Function to launch a URL
|
||||
Future<void> _launchURL(String url, BuildContext context) async {
|
||||
final Uri uri = Uri.parse(url);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Could not launch $url')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context).quickLinks),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
// Background logo
|
||||
IgnorePointer(
|
||||
child: Center(
|
||||
child: Opacity(
|
||||
opacity: 0.1,
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png',
|
||||
width: 200,
|
||||
height: 200,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Grid of Quick Links
|
||||
GridView.builder(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2, // Two columns
|
||||
crossAxisSpacing: 12.0,
|
||||
mainAxisSpacing: 12.0,
|
||||
childAspectRatio: 1.1, // Adjust for better card shape
|
||||
),
|
||||
itemCount: _quickLinks.length,
|
||||
itemBuilder: (context, index) {
|
||||
final link = _quickLinks[index];
|
||||
return _buildLinkCard(link, context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLinkCard(QuickLink link, BuildContext context) {
|
||||
return Card(
|
||||
elevation: 3.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15.0),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () => _launchURL(link.url, context),
|
||||
borderRadius: BorderRadius.circular(15.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
link.icon,
|
||||
size: 40.0,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
const SizedBox(height: 12.0),
|
||||
Text(
|
||||
link.title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14.0,
|
||||
),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user