diff --git a/packages/dart/npt_flutter/assets/onboarding_bg.svg b/packages/dart/npt_flutter/assets/onboarding_bg.svg
new file mode 100644
index 000000000..c925206fa
--- /dev/null
+++ b/packages/dart/npt_flutter/assets/onboarding_bg.svg
@@ -0,0 +1,114 @@
+
diff --git a/packages/dart/npt_flutter/lib/app.dart b/packages/dart/npt_flutter/lib/app.dart
index 72ccacfd4..2a19be78e 100644
--- a/packages/dart/npt_flutter/lib/app.dart
+++ b/packages/dart/npt_flutter/lib/app.dart
@@ -32,6 +32,8 @@ class App extends StatelessWidget {
],
child: MultiBlocProvider(
providers: [
+ // TODO this should be called LocalSettingsCubit and move
+ // Localization from the SettingsCubit to this
BlocProvider(
create: (_) => EnableLoggingCubit(),
),
@@ -42,7 +44,7 @@ class App extends StatelessWidget {
create: (_) => LogsCubit(),
),
- /// A cubit which manages the onboarding status
+ // A bloc which manages the atDirectory state
BlocProvider(
create: (_) => OnboardingCubit(),
),
diff --git a/packages/dart/npt_flutter/lib/constants.dart b/packages/dart/npt_flutter/lib/constants.dart
index 58c1eb465..d412655ab 100644
--- a/packages/dart/npt_flutter/lib/constants.dart
+++ b/packages/dart/npt_flutter/lib/constants.dart
@@ -1,5 +1,6 @@
+import 'package:flutter/material.dart';
+
class Constants {
- static const rootDomain = 'root.atsign.org';
static String? get namespace => 'noports';
// TODO: issue & secure API key properly
static String? get appAPIKey => 'asdf';
@@ -15,5 +16,10 @@ class Constants {
"@rv_ap": "Singapore",
};
+ static Map getRootDomains(BuildContext context) {
+ // TODO localize right hand side of map
+ return {'root.atsign.org': 'Default (Prod)', 'vip.ve.atsign.zone': 'Demo (VE)'};
+ }
+
static const languages = ['English', 'Spanish', 'Br portuguese', 'Mandarin', 'Cantonese'];
}
diff --git a/packages/dart/npt_flutter/lib/features/favorite/bloc/favorite_bloc.dart b/packages/dart/npt_flutter/lib/features/favorite/bloc/favorite_bloc.dart
index 0401e3f9d..1f6bd41ce 100644
--- a/packages/dart/npt_flutter/lib/features/favorite/bloc/favorite_bloc.dart
+++ b/packages/dart/npt_flutter/lib/features/favorite/bloc/favorite_bloc.dart
@@ -15,6 +15,8 @@ class FavoriteBloc extends LoggingBloc {
on(_onRemove);
}
+ void clearAll() => emit(const FavoritesInitial());
+
FutureOr _onLoad(
FavoriteLoadEvent event, Emitter emit) async {
emit(const FavoritesLoading());
diff --git a/packages/dart/npt_flutter/lib/features/onboarding/cubit/onboarding_cubit.dart b/packages/dart/npt_flutter/lib/features/onboarding/cubit/onboarding_cubit.dart
index 65f4a9bbc..890e5a93b 100644
--- a/packages/dart/npt_flutter/lib/features/onboarding/cubit/onboarding_cubit.dart
+++ b/packages/dart/npt_flutter/lib/features/onboarding/cubit/onboarding_cubit.dart
@@ -1,10 +1,49 @@
-import 'package:npt_flutter/features/logging/logging.dart';
-
-part 'onboarding_state.dart';
+import 'package:npt_flutter/features/logging/models/logging_bloc.dart';
+import 'package:npt_flutter/features/onboarding/util/atsign_manager.dart';
class OnboardingCubit extends LoggingCubit {
- OnboardingCubit() : super(const OnboardingInitial());
+ OnboardingCubit()
+ : super(const OnboardingState(atSign: '', status: OnboardingStatus.offboarded, rootDomain: 'root.atsign.org'));
+
+ void setRootDomain(String rootDomain) =>
+ emit(OnboardingState(atSign: state.atSign, status: state.status, rootDomain: rootDomain));
+ String getRootDomain() => (state.rootDomain);
+
+ void setAtSign(String atSign) =>
+ emit(OnboardingState(atSign: atSign, status: state.status, rootDomain: state.rootDomain));
+ String getAtSign() => (state.atSign);
+
+ void setStatus(OnboardingStatus status) =>
+ emit(OnboardingState(atSign: state.atSign, status: status, rootDomain: state.rootDomain));
+ OnboardingStatus getStatus() => (state.status);
+
+ /// If state is passed, all other arguments are ignored
+ /// If individual arguments (atsign, rootDomain, status) are passed
+ /// then they will override the value of the current state
+ /// keeping unspecified values the same
+ void setState({
+ String? atSign,
+ OnboardingStatus? status,
+ String? rootDomain,
+ }) =>
+ emit(OnboardingState(
+ atSign: atSign ?? state.atSign,
+ status: status ?? state.status,
+ rootDomain: rootDomain ?? state.rootDomain,
+ ));
+}
+
+enum OnboardingStatus { onboarded, offboarded }
+
+class OnboardingState extends AtsignInformation {
+ final OnboardingStatus status;
+ const OnboardingState({required this.status, required super.atSign, required super.rootDomain});
+
+ @override
+ List