feat: refactor financial wallet UI components and add offline map service support
This commit is contained in:
@@ -21,13 +21,11 @@ class RatePassenger extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[50],
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: AppBar(
|
||||
title: Text('Trip Completed'.tr,
|
||||
style: const TextStyle(color: Colors.black)),
|
||||
title: Text('Trip Completed'.tr),
|
||||
centerTitle: true,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
),
|
||||
body: GetBuilder<RateController>(
|
||||
@@ -156,23 +154,23 @@ class RatePassenger extends StatelessWidget {
|
||||
Widget _buildWalletSection(BuildContext context, RateController controller) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: Theme.of(context).cardColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: Colors.grey.shade200),
|
||||
border: Border.all(color: Theme.of(context).dividerColor),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: controller.ispassengerWantWalletFromDriver
|
||||
? _buildAmountInput(controller)
|
||||
: _buildWalletQuery(controller),
|
||||
? _buildAmountInput(context, controller)
|
||||
: _buildWalletQuery(context, controller),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWalletQuery(RateController controller) {
|
||||
Widget _buildWalletQuery(BuildContext context, RateController controller) {
|
||||
return Column(
|
||||
key: const ValueKey('walletQuery'),
|
||||
children: [
|
||||
@@ -181,11 +179,11 @@ class RatePassenger extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orange.withOpacity(0.1),
|
||||
color: Colors.amber.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(Icons.account_balance_wallet,
|
||||
color: Colors.orange),
|
||||
child:
|
||||
const Icon(Icons.account_balance_wallet, color: Colors.amber),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Expanded(
|
||||
@@ -206,8 +204,8 @@ class RatePassenger extends StatelessWidget {
|
||||
child: OutlinedButton(
|
||||
onPressed: () {}, // Optional logic
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: Colors.grey,
|
||||
side: BorderSide(color: Colors.grey.shade300),
|
||||
foregroundColor: Theme.of(context).hintColor,
|
||||
side: BorderSide(color: Theme.of(context).dividerColor),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
@@ -235,14 +233,17 @@ class RatePassenger extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAmountInput(RateController controller) {
|
||||
Widget _buildAmountInput(BuildContext context, RateController controller) {
|
||||
return Column(
|
||||
key: const ValueKey('amountInput'),
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Enter Amount Paid".tr,
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Form(
|
||||
@@ -279,11 +280,12 @@ class RatePassenger extends StatelessWidget {
|
||||
Text(
|
||||
'Rate Passenger'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[600],
|
||||
color: Theme.of(context).hintColor,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
RatingBar.builder(
|
||||
initialRating: 0,
|
||||
@@ -306,19 +308,20 @@ class RatePassenger extends StatelessWidget {
|
||||
TextField(
|
||||
controller: controller.comment,
|
||||
maxLines: 2,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Any comments about the passenger?'.tr,
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
fillColor: Theme.of(context).cardColor,
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
borderSide: BorderSide(color: Theme.of(context).dividerColor),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.grey.shade200),
|
||||
borderSide: BorderSide(color: Theme.of(context).dividerColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user