rework ui

This commit is contained in:
verboomp
2026-01-29 07:08:44 +01:00
parent ca514eea67
commit 38979c99e5
19 changed files with 457 additions and 293 deletions

View File

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:fotodocumentation/main.dart';
import 'package:fotodocumentation/pages/customer/customer_list_widget.dart';
import 'package:fotodocumentation/pages/customer/customer_widget.dart';
import 'package:fotodocumentation/pages/customer/picture_widget.dart';
import 'package:fotodocumentation/pages/login/login_widget.dart';
import 'package:fotodocumentation/utils/di_container.dart';
import 'package:fotodocumentation/utils/login_credentials.dart';
@@ -16,6 +17,7 @@ class GlobalRouter {
static final String pathHome = "/home";
static final String pathCustomer = "/customer";
static final String pathPicture = "/picture";
static final String pathLogin = "/login";
static final GoRouter router = createRouter(pathHome);
@@ -45,6 +47,13 @@ class GlobalRouter {
return CustomerWidget(customerId: id ?? -1);
},
),
GoRoute(
path: pathPicture,
builder: (context, state) {
PictureWidgetHolder holder = state.extra as PictureWidgetHolder;
return PictureWidget(customerDto: holder.customerDto, pictureDto: holder.pictureDto);
},
),
],
redirect: (context, state) {
var uriStr = state.uri.toString();

View File

@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:fotodocumentation/utils/di_container.dart';
import 'package:fotodocumentation/utils/jwt_token_storage.dart';
abstract class LoginCredentials extends ChangeNotifier {
String get fullname;
@@ -9,6 +11,8 @@ abstract class LoginCredentials extends ChangeNotifier {
}
class LoginCredentialsImpl extends LoginCredentials {
JwtTokenStorage get jwtTokenStorage => DiContainer.get();
bool loggedIn = false;
@override
@@ -24,6 +28,8 @@ class LoginCredentialsImpl extends LoginCredentials {
@override
void logout() {
loggedIn = false;
jwtTokenStorage.clearTokens;
notifyListeners();
}
}