fix phone dashboard
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class AppBackButton extends StatelessWidget {
|
||||
final String fallbackRoute;
|
||||
final Color? color;
|
||||
|
||||
const AppBackButton({
|
||||
super.key,
|
||||
required this.fallbackRoute,
|
||||
this.color,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
icon: Icon(Icons.arrow_back_ios_new_rounded, color: color),
|
||||
onPressed: () {
|
||||
if (context.canPop()) {
|
||||
context.pop();
|
||||
return;
|
||||
}
|
||||
context.go(fallbackRoute);
|
||||
},
|
||||
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user