146 lines
4.4 KiB
Dart
146 lines
4.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:kmobile/features/yojna/screens/pm_main_screen.dart';
|
|
import '../../../l10n/app_localizations.dart';
|
|
|
|
class GovSchemeScreen extends StatefulWidget {
|
|
const GovSchemeScreen({super.key});
|
|
|
|
@override
|
|
State<GovSchemeScreen> createState() => _GovSchemeScreenState();
|
|
}
|
|
|
|
class _GovSchemeScreenState extends State<GovSchemeScreen> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Government Schemes'),
|
|
),
|
|
body: Stack(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Expanded(
|
|
child: GovSchemeTile(
|
|
logoText: "PMJJBY/PMSBY",
|
|
label: "Pradhan Mantri Yojana",
|
|
subtitle: "Enroll in Pradhan Mantri Jeevan Jyoti Bima Yojana (PMJJBY) and Pradhan Mantri Suraksha Bima Yojana (PMSBY) insurance schemes",
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => const PMMainScreen(),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
Expanded(
|
|
child: GovSchemeTile(
|
|
logoText: "APY",
|
|
label: "Atal Pension Yojana",
|
|
subtitle: "Secure your future with Atal Pension Yojana (APY) retirement scheme",
|
|
onTap: () {
|
|
// Action for APY will be added later
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
IgnorePointer(
|
|
child: Center(
|
|
child: Opacity(
|
|
opacity: 0.07,
|
|
child: ClipOval(
|
|
child: Image.asset(
|
|
'assets/images/logo.png',
|
|
width: 200,
|
|
height: 200,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class GovSchemeTile extends StatelessWidget {
|
|
final String logoText;
|
|
final String label;
|
|
final String? subtitle;
|
|
final VoidCallback onTap;
|
|
final bool disable;
|
|
|
|
const GovSchemeTile({
|
|
super.key,
|
|
required this.logoText,
|
|
required this.label,
|
|
this.subtitle,
|
|
required this.onTap,
|
|
this.disable = false,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
return Card(
|
|
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
),
|
|
elevation: 4,
|
|
child: InkWell(
|
|
onTap: disable ? null : onTap,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 36.0, horizontal: 16.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
logoText,
|
|
style: TextStyle(
|
|
fontSize: logoText.length > 5 ? 28 : 40,
|
|
fontWeight: FontWeight.bold,
|
|
color: theme.colorScheme.primary,
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
label,
|
|
textAlign: TextAlign.center,
|
|
style: theme.textTheme.headlineSmall?.copyWith(
|
|
fontWeight: FontWeight.bold,
|
|
color: disable
|
|
? theme.disabledColor
|
|
: theme.colorScheme.onSurface,
|
|
),
|
|
),
|
|
if (subtitle != null)
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
child: Text(
|
|
subtitle!,
|
|
textAlign: TextAlign.center,
|
|
style: theme.textTheme.bodyMedium?.copyWith(
|
|
color: disable
|
|
? theme.disabledColor
|
|
: theme.colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|