11import 'package:equatable/equatable.dart' ;
22
3+ enum ConfigErrorEnum {
4+ invalidReleaseMode (error: 'Bugsee is disabled in debug mode' ),
5+ invalidToken (error: 'Invalid token, cannot start Bugsee reporting' ),
6+ invalidPlatform (error: 'Bugsee cannot be configured on this platform' );
7+
8+ final String error;
9+ const ConfigErrorEnum ({
10+ required this .error,
11+ });
12+ }
13+
314final class BugseeConfigState extends Equatable {
415 /// Indicate if the app require a restart to reactivate the bugsee configurations
516 ///
@@ -45,6 +56,9 @@ final class BugseeConfigState extends Equatable {
4556 /// By default it's enabled.
4657 final bool attachLogFile;
4758
59+ /// Indicate the configuration error type (debug, invalid token or invalid platform)
60+ final ConfigErrorEnum ? configErrorEnum;
61+
4862 const BugseeConfigState ({
4963 this .isRestartRequired = false ,
5064 this .isBugseeEnabled = false ,
@@ -54,6 +68,7 @@ final class BugseeConfigState extends Equatable {
5468 this .isLogCollectionEnabled = false ,
5569 this .isLogFilterEnabled = false ,
5670 this .attachLogFile = false ,
71+ this .configErrorEnum,
5772 });
5873
5974 BugseeConfigState copyWith ({
@@ -65,6 +80,7 @@ final class BugseeConfigState extends Equatable {
6580 bool ? isLogCollectionEnabled,
6681 bool ? isLogFilterEnabled,
6782 bool ? attachLogFile,
83+ ConfigErrorEnum ? configErrorEnum,
6884 }) =>
6985 BugseeConfigState (
7086 isRestartRequired: isRestartRequired ?? this .isRestartRequired,
@@ -77,6 +93,7 @@ final class BugseeConfigState extends Equatable {
7793 isLogCollectionEnabled ?? this .isLogCollectionEnabled,
7894 isVideoCaptureEnabled:
7995 isVideoCaptureEnabled ?? this .isVideoCaptureEnabled,
96+ configErrorEnum: configErrorEnum ?? this .configErrorEnum,
8097 );
8198
8299 @override
0 commit comments