Skip to content

Commit 576218a

Browse files
Add UPI donation options:
- Added UPI, Google Pay, PhonePe, and Paytm SVG icons. - Created a new `Upi` screen to handle UPI donations. - Users can enter an amount and choose a UPI app to donate. - Implemented `UpiDonationScreen` for a more detailed UPI payment flow. - Includes amount validation and processing dialogs. - Updated the "Donate via UPI" button in the About screen to navigate to the new `Upi` screen. - Changed GitHub and LinkedIn icons. - Updated gradient colors in the app bar.
1 parent c132da8 commit 576218a

File tree

7 files changed

+584
-31
lines changed

7 files changed

+584
-31
lines changed

assets/about/google-pay.svg

Lines changed: 1 addition & 0 deletions
Loading

assets/about/paytm.svg

Lines changed: 2 additions & 0 deletions
Loading

assets/about/phonepe.svg

Lines changed: 1 addition & 0 deletions
Loading

assets/about/upi.svg

Lines changed: 6 additions & 0 deletions
Loading

lib/presentation/screens/about/index.dart

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import 'package:flutter/cupertino.dart';
12
import 'package:flutter/material.dart';
23
import 'package:flutter_svg/flutter_svg.dart';
34
import 'package:lottie/lottie.dart';
45
import 'package:package_info_plus/package_info_plus.dart';
56
import 'package:sysadmin/core/utils/color_extension.dart';
6-
import 'package:sysadmin/core/utils/util.dart';
77
import 'package:sysadmin/core/widgets/ios_scaffold.dart';
8+
import 'package:sysadmin/presentation/screens/about/upi.dart';
89
import 'package:url_launcher/url_launcher.dart';
910

10-
1111
class AboutScreen extends StatefulWidget {
1212
const AboutScreen({super.key});
1313

@@ -71,6 +71,7 @@ class _AboutScreenState extends State<AboutScreen> with SingleTickerProviderStat
7171
return Expanded(
7272
child: InkWell(
7373
onTap: onTap,
74+
borderRadius: BorderRadius.circular(12),
7475
child: Container(
7576
width: double.infinity,
7677
height: 60,
@@ -79,17 +80,13 @@ class _AboutScreenState extends State<AboutScreen> with SingleTickerProviderStat
7980
color: Theme.of(context).colorScheme.surface,
8081
borderRadius: BorderRadius.circular(12),
8182
),
82-
83-
child: Padding(
84-
padding: const EdgeInsets.symmetric(horizontal: 8.0),
85-
child: Row(
86-
mainAxisAlignment: MainAxisAlignment.center,
87-
children: [
88-
Icon(icon, color: iconColor ?? Theme.of(context).primaryColor, size: 20),
89-
const SizedBox(width: 8),
90-
Text(title, style: Theme.of(context).textTheme.labelLarge),
91-
],
92-
),
83+
child: Row(
84+
mainAxisAlignment: MainAxisAlignment.center,
85+
children: [
86+
Icon(icon, color: iconColor ?? Theme.of(context).primaryColor, size: 20),
87+
const SizedBox(width: 8),
88+
Text(title, style: Theme.of(context).textTheme.labelLarge),
89+
],
9390
),
9491
),
9592
),
@@ -139,8 +136,8 @@ class _AboutScreenState extends State<AboutScreen> with SingleTickerProviderStat
139136
gradient: const LinearGradient(
140137
colors: <Color> [
141138
Color(0xFFCC3399),
142-
Color(0xFF9933CC),
143139
Color(0xFF3399CC),
140+
Color(0xFF9933CC),
144141
Color(0xFF33CC99),
145142
],
146143
),
@@ -213,18 +210,6 @@ class _AboutScreenState extends State<AboutScreen> with SingleTickerProviderStat
213210
);
214211
}
215212

216-
void _launchUpiApp() async {
217-
final Uri uri = Uri.parse(
218-
'upi://pay?pa=pkhade2865@okaxis&pn=Prathamesh%20Khade&am=&cu=INR&tn=SysAdmin%20Donation');
219-
try {
220-
await launchUrl(uri, mode: LaunchMode.externalApplication);
221-
}
222-
catch (e) {
223-
if (!mounted) return;
224-
Util.showMsg(context: context, isError: true, msg: "No UPI app found on your device");
225-
}
226-
}
227-
228213
@override
229214
Widget build(BuildContext context) {
230215
final theme = Theme.of(context);
@@ -367,14 +352,14 @@ class _AboutScreenState extends State<AboutScreen> with SingleTickerProviderStat
367352
runSpacing: 8,
368353
children: [
369354
_buildSocialButton(
370-
asset: 'assets/icons/github.svg',
355+
asset: 'assets/about/github.svg',
371356
label: 'GitHub',
372-
onTap: () => _launchUrl('https://github.com/yourusername'),
357+
onTap: () => _launchUrl('https://github.com/prathameshkhade'),
373358
),
374359
_buildSocialButton(
375-
asset: 'assets/icons/linkedin.svg',
360+
asset: 'assets/about/linkedin.svg',
376361
label: 'LinkedIn',
377-
onTap: () => _launchUrl('https://linkedin.com/in/yourusername'),
362+
onTap: () => _launchUrl('https://linkedin.com/in/prathameshkhade'),
378363
),
379364
],
380365
),
@@ -407,7 +392,10 @@ class _AboutScreenState extends State<AboutScreen> with SingleTickerProviderStat
407392
_buildDonationOption(
408393
// title: "Donate via UPI",
409394
asset: 'assets/about/upi.png',
410-
onTap: _launchUpiApp
395+
onTap: () => Navigator.push(
396+
context,
397+
CupertinoPageRoute(builder: (context) => const Upi())
398+
)
411399
),
412400
],
413401
),

0 commit comments

Comments
 (0)