import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'GlobalConstants.dart'; import 'app_colors.dart'; PreferredSizeWidget appbar(BuildContext context, title) { return AppBar( automaticallyImplyLeading: false, elevation: 2.0, title: SizedBox( child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ InkResponse( onTap: () => Navigator.pop(context, true), child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25), ), InkResponse( onTap: () => Navigator.pop(context,true), child: Text( title, style: TextStyle( fontSize: 16, height: 1.1, fontFamily: "JakartaSemiBold", color: AppColors.semi_black, ), ), ), ], ), ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( bottom: Radius.circular(30), // Adjust the radius as needed ), ), ); } PreferredSizeWidget appbar2(BuildContext context, title,widget) { return AppBar( automaticallyImplyLeading: false, elevation: 2.0, title: SizedBox( child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ InkResponse( onTap: () => Navigator.pop(context, true), child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25), ), Expanded( flex:4, child: InkResponse( onTap: () => Navigator.pop(context, true), child: Text( title, overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( fontSize: 16, height: 1.1, fontFamily: "JakartaSemiBold", color: AppColors.semi_black, ), ), ), ), Spacer(), widget ], ), ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( bottom: Radius.circular(30), // Adjust the radius as needed ), ), ); } Future onBackPressed(BuildContext context) async { Navigator.pop(context, true); return true; } Widget Emptywidget(BuildContext context){ return SizedBox( height: MediaQuery.of(context).size.height*0.8, child: Center( child: Text("No Data Available")), ); } class MyNavigatorObserver extends NavigatorObserver { @override void didPush(Route route, Route? previousRoute) { super.didPush(route, previousRoute); // Called when a route has been pushed onto the navigator. didPushed = "true"; // print('Route pushed: ${route.settings.name}'); // print('didPushed$didPushed'); } @override void didPop(Route route, Route? previousRoute) { super.didPop(route, previousRoute); didPopped = "true"; // Called when a route has been popped off the navigator. // print('Route popped: ${route.settings.name}'); // print('didPopped${didPopped}'); } }