route animation improvement.

pull/57/head
Sikander Saleem 1 month ago
parent 99e1036043
commit 2584e6cc6e

@ -171,19 +171,14 @@ class _RechargeWalletPageState extends State<RechargeWalletPage> {
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h),
SizedBox(width: 8.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h), LocaleKeys.email.tr(context: context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
SizedBox(width: 8.h), "${appState.getAuthenticatedUser()!.emailAddress}".toText16(color: AppColors.textColor, weight: FontWeight.w500),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.email.tr(context: context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
"${appState.getAuthenticatedUser()!.emailAddress}".toText16(color: AppColors.textColor, weight: FontWeight.w500),
],
),
], ],
), ),
], ],

@ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.dart'; import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'collapsing_list_view.dart'; import 'collapsing_list_view.dart';
@ -50,7 +51,13 @@ class _LabOrdersPageState extends State<LabOrdersPage> {
if (lavVM.isLabOrdersLoading) { if (lavVM.isLabOrdersLoading) {
return; return;
} else { } else {
String? value = await Navigator.of(context).push(CupertinoPageRoute(fullscreenDialog: true, builder: (context) => SearchLabResultsContent(labSuggestionsList: lavVM.labSuggestions))); String? value = await Navigator.of(context).push(
CustomPageRoute(
page: SearchLabResultsContent(labSuggestionsList: lavVM.labSuggestions),
fullScreenDialog: true,
direction: AxisDirection.down,
),
);
if (value != null) { if (value != null) {
selectedFilterText = value; selectedFilterText = value;
lavVM.filterLabReports(value); lavVM.filterLabReports(value);

@ -2,14 +2,16 @@ import 'package:flutter/material.dart';
import 'package:flutter/physics.dart'; import 'package:flutter/physics.dart';
/// Reusable spring route /// Reusable spring route
class CustomPageRoute extends PageRouteBuilder { class CustomPageRoute<T> extends PageRouteBuilder<T> {
final Widget page; final Widget page;
final AxisDirection direction; final AxisDirection direction;
final bool fullScreenDialog;
CustomPageRoute({required this.page, this.direction = AxisDirection.right}) CustomPageRoute({required this.page, this.direction = AxisDirection.right, this.fullScreenDialog = false})
: super( : super(
transitionDuration: const Duration(milliseconds: 1500), transitionDuration: const Duration(milliseconds: 1500),
reverseTransitionDuration: const Duration(milliseconds: 500), reverseTransitionDuration: const Duration(milliseconds: 500),
fullscreenDialog: fullScreenDialog,
pageBuilder: (_, __, ___) => page, pageBuilder: (_, __, ___) => page,
transitionsBuilder: (context, animation, secondaryAnimation, child) { transitionsBuilder: (context, animation, secondaryAnimation, child) {
final spring = SpringDescription(mass: 1, stiffness: 100, damping: 15); final spring = SpringDescription(mass: 1, stiffness: 100, damping: 15);

Loading…
Cancel
Save