routerWrapper function
Implementation
Widget routerWrapper(
BuildContext context, Widget? child, IADState? initialState) {
return Stack(
children: [
child!,
const IADFloatingButton(),
IADWindow(
child: MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(0.8),
viewPadding: const EdgeInsets.all(0),
viewInsets: const EdgeInsets.all(0),
systemGestureInsets: const EdgeInsets.all(0),
padding: const EdgeInsets.all(0),
),
child: Theme(
data: Theme.of(context).copyWith(
visualDensity: VisualDensity.compact,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
buttonTheme: ButtonTheme.of(context).copyWith(
minWidth: 0,
padding: const EdgeInsets.all(0),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
minimumSize: const Size(0, 32),
padding: const EdgeInsets.symmetric(horizontal: 8),
),
),
appBarTheme: AppBarTheme.of(context).copyWith(
toolbarHeight: 40,
titleSpacing: 0,
iconTheme: IconThemeData(size: 18),
),
tabBarTheme: TabBarTheme.of(context).copyWith(
labelPadding: const EdgeInsets.all(0),
),
),
child: HeroControllerScope(
controller: HeroController(createRectTween: (begin, end) {
return MaterialRectArcTween(begin: begin, end: end);
}),
child: Navigator(
onGenerateRoute: (settings) {
return MaterialPageRoute(
builder: (context) {
return _IADPanel();
},
);
},
),
),
),
),
),
],
);
}