session creation and show business information
This commit is contained in:
@@ -18,6 +18,7 @@ export 'src/mocks/home_repository_mock.dart';
|
||||
export 'src/mocks/business_repository_mock.dart';
|
||||
export 'src/mocks/order_repository_mock.dart';
|
||||
export 'src/data_connect_module.dart';
|
||||
export 'src/session/client_session_store.dart';
|
||||
|
||||
// Export the generated Data Connect SDK
|
||||
export 'src/dataconnect_generated/generated.dart';
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'package:krow_domain/krow_domain.dart' as domain;
|
||||
|
||||
class ClientBusinessSession {
|
||||
final String id;
|
||||
final String businessName;
|
||||
final String? email;
|
||||
final String? city;
|
||||
final String? contactName;
|
||||
final String? companyLogoUrl;
|
||||
|
||||
const ClientBusinessSession({
|
||||
required this.id,
|
||||
required this.businessName,
|
||||
this.email,
|
||||
this.city,
|
||||
this.contactName,
|
||||
this.companyLogoUrl,
|
||||
});
|
||||
}
|
||||
|
||||
class ClientSession {
|
||||
final domain.User user;
|
||||
final String? userPhotoUrl;
|
||||
final ClientBusinessSession? business;
|
||||
|
||||
const ClientSession({
|
||||
required this.user,
|
||||
required this.userPhotoUrl,
|
||||
required this.business,
|
||||
});
|
||||
}
|
||||
|
||||
class ClientSessionStore {
|
||||
ClientSession? _session;
|
||||
|
||||
ClientSession? get session => _session;
|
||||
|
||||
void setSession(ClientSession session) {
|
||||
_session = session;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
_session = null;
|
||||
}
|
||||
|
||||
static final ClientSessionStore instance = ClientSessionStore._();
|
||||
|
||||
ClientSessionStore._();
|
||||
}
|
||||
Reference in New Issue
Block a user