
Introduces a side navigation drawer on the home page to improve navigation and centralize user actions. Displays the logged-in user's information (name, email) in the drawer header. Adds a link to the Product List page ("Inventaire") within the drawer. Moves the logout functionality to the drawer, ensuring user data is also cleared from local storage upon logout. Ensures user data is saved to local storage during the login process and fetched when the home page loads. Includes minor text updates on the Product Form page.
174 lines
6.0 KiB
Dart
174 lines
6.0 KiB
Dart
// dart format width=80
|
|
// coverage:ignore-file
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// ignore_for_file: type=lint
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'auth_struct.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$AuthStruct {
|
|
|
|
String? get accessToken; String? get refreshToken; UserStruct? get user;
|
|
/// Create a copy of AuthStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$AuthStructCopyWith<AuthStruct> get copyWith => _$AuthStructCopyWithImpl<AuthStruct>(this as AuthStruct, _$identity);
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthStruct&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.user, user) || other.user == user));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,accessToken,refreshToken,user);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthStruct(accessToken: $accessToken, refreshToken: $refreshToken, user: $user)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $AuthStructCopyWith<$Res> {
|
|
factory $AuthStructCopyWith(AuthStruct value, $Res Function(AuthStruct) _then) = _$AuthStructCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String? accessToken, String? refreshToken, UserStruct? user
|
|
});
|
|
|
|
|
|
$UserStructCopyWith<$Res>? get user;
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$AuthStructCopyWithImpl<$Res>
|
|
implements $AuthStructCopyWith<$Res> {
|
|
_$AuthStructCopyWithImpl(this._self, this._then);
|
|
|
|
final AuthStruct _self;
|
|
final $Res Function(AuthStruct) _then;
|
|
|
|
/// Create a copy of AuthStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? accessToken = freezed,Object? refreshToken = freezed,Object? user = freezed,}) {
|
|
return _then(_self.copyWith(
|
|
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
|
as UserStruct?,
|
|
));
|
|
}
|
|
/// Create a copy of AuthStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$UserStructCopyWith<$Res>? get user {
|
|
if (_self.user == null) {
|
|
return null;
|
|
}
|
|
|
|
return $UserStructCopyWith<$Res>(_self.user!, (value) {
|
|
return _then(_self.copyWith(user: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
/// @nodoc
|
|
@JsonSerializable(createToJson: false)
|
|
|
|
class _AuthStruct implements AuthStruct {
|
|
_AuthStruct({this.accessToken, this.refreshToken, this.user});
|
|
factory _AuthStruct.fromJson(Map<String, dynamic> json) => _$AuthStructFromJson(json);
|
|
|
|
@override final String? accessToken;
|
|
@override final String? refreshToken;
|
|
@override final UserStruct? user;
|
|
|
|
/// Create a copy of AuthStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$AuthStructCopyWith<_AuthStruct> get copyWith => __$AuthStructCopyWithImpl<_AuthStruct>(this, _$identity);
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthStruct&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.user, user) || other.user == user));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,accessToken,refreshToken,user);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthStruct(accessToken: $accessToken, refreshToken: $refreshToken, user: $user)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$AuthStructCopyWith<$Res> implements $AuthStructCopyWith<$Res> {
|
|
factory _$AuthStructCopyWith(_AuthStruct value, $Res Function(_AuthStruct) _then) = __$AuthStructCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
String? accessToken, String? refreshToken, UserStruct? user
|
|
});
|
|
|
|
|
|
@override $UserStructCopyWith<$Res>? get user;
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$AuthStructCopyWithImpl<$Res>
|
|
implements _$AuthStructCopyWith<$Res> {
|
|
__$AuthStructCopyWithImpl(this._self, this._then);
|
|
|
|
final _AuthStruct _self;
|
|
final $Res Function(_AuthStruct) _then;
|
|
|
|
/// Create a copy of AuthStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? accessToken = freezed,Object? refreshToken = freezed,Object? user = freezed,}) {
|
|
return _then(_AuthStruct(
|
|
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
|
as String?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
|
as UserStruct?,
|
|
));
|
|
}
|
|
|
|
/// Create a copy of AuthStruct
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$UserStructCopyWith<$Res>? get user {
|
|
if (_self.user == null) {
|
|
return null;
|
|
}
|
|
|
|
return $UserStructCopyWith<$Res>(_self.user!, (value) {
|
|
return _then(_self.copyWith(user: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
// dart format on
|