Implement Scanner-View

This commit is contained in:
2025-04-13 00:17:06 +02:00
parent c0b8a8a3f4
commit 95353735b0
19 changed files with 961 additions and 179 deletions

View File

@@ -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);

View File

@@ -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)),
);