navToChildPage method
Navigate to sharing child page
Implementation
dynamic navToChildPage(BuildContext context) async {
return Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => AppHomePage(
title: topBarTitle,
childPage: childPage,
),
),
(Route<dynamic> route) =>
false, // This predicate ensures all previous routes are removed
);
}