Implement Scanner-View
This commit is contained in:
@@ -13,6 +13,15 @@ class Navi {
|
||||
Navigator.push(context, MaterialPageRoute<T>(builder: (context) => builder()));
|
||||
}
|
||||
|
||||
static void pushOnRoot<T extends Widget>(BuildContext context, T Function() builder) {
|
||||
Provider.of<AppBarState>(context, listen: false).setLoadingIndeterminate(false);
|
||||
Provider.of<AppBarState>(context, listen: false).setShowSearchField(false);
|
||||
|
||||
Navigator.popUntil(context, (route) => route.isFirst);
|
||||
|
||||
Navigator.push(context, MaterialPageRoute<T>(builder: (context) => builder()));
|
||||
}
|
||||
|
||||
static void popToRoot(BuildContext context) {
|
||||
Provider.of<AppBarState>(context, listen: false).setLoadingIndeterminate(false);
|
||||
Provider.of<AppBarState>(context, listen: false).setShowSearchField(false);
|
||||
|
@@ -4,7 +4,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
class UI {
|
||||
static const double DefaultBorderRadius = 4;
|
||||
|
||||
static Widget button({required String text, required void Function() onPressed, bool big = false, Color? color = null, bool tonal = false, IconData? icon = null}) {
|
||||
static Widget button({required String text, required void Function() onPressed, bool big = false, Color? color = null, Color? textColor = null, bool tonal = false, IconData? icon = null}) {
|
||||
final double fontSize = big ? 24 : 14;
|
||||
final padding = big ? EdgeInsets.fromLTRB(8, 12, 8, 12) : null;
|
||||
|
||||
@@ -12,6 +12,7 @@ class UI {
|
||||
textStyle: TextStyle(fontSize: fontSize),
|
||||
padding: padding,
|
||||
backgroundColor: color,
|
||||
foregroundColor: textColor,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(DefaultBorderRadius)),
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user