Skip to content

Commit 44e1f88

Browse files
committed
Refactor automaticallyCollectCrashReports -> automaticallySendCrashReports
1 parent f191672 commit 44e1f88

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

example_chat_bot/lib/chat_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _ChatScreenState extends State<ChatScreen>
6161
Codelessly.instance.configure(
6262
config: CodelesslyConfig(
6363
authToken: authToken,
64-
automaticallyCollectCrashReports: false,
64+
automaticallySendCrashReports: false,
6565
isPreview: false,
6666
firebaseProjectId: 'codeless-dev',
6767
firebaseCloudFunctionsBaseURL:

lib/src/codelessly.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class Codelessly {
245245

246246
initErrorHandler(
247247
firebaseProjectId: _config!.firebaseProjectId,
248-
automaticallySendCrashReports: _config!.automaticallyCollectCrashReports,
248+
automaticallySendCrashReports: _config!.automaticallySendCrashReports,
249249
);
250250

251251
assert(
@@ -365,7 +365,7 @@ class Codelessly {
365365

366366
initErrorHandler(
367367
firebaseProjectId: _config!.firebaseProjectId,
368-
automaticallySendCrashReports: _config!.automaticallyCollectCrashReports,
368+
automaticallySendCrashReports: _config!.automaticallySendCrashReports,
369369
);
370370
try {
371371
_updateStatus(CodelesslyStatus.configured);

lib/src/codelessly_config.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CodelesslyConfig with EquatableMixin {
2020

2121
/// Allows the SDK to automatically send crash reports back to Codelessly's
2222
/// servers for developer analysis.
23-
final bool automaticallyCollectCrashReports;
23+
final bool automaticallySendCrashReports;
2424

2525
/// Whether [CodelesslyWidget]s should show the preview versions of their
2626
/// layouts.
@@ -58,15 +58,15 @@ class CodelesslyConfig with EquatableMixin {
5858
///
5959
/// [authToken] is the token required to authenticate and initialize the SDK.
6060
///
61-
/// [automaticallyCollectCrashReports] allows the SDK to automatically send
61+
/// [automaticallySendCrashReports] allows the SDK to automatically send
6262
/// crash reports back to Codelessly's servers for developer analysis.
6363
///
6464
/// No device data is sent with the crash report. Only the stack trace and
6565
/// the error message.
6666
CodelesslyConfig({
6767
required this.authToken,
6868
this.slug,
69-
this.automaticallyCollectCrashReports = true,
69+
this.automaticallySendCrashReports = true,
7070
this.isPreview = false,
7171
this.preload = true,
7272
this.firebaseProjectId = defaultFirebaseProjectId,
@@ -78,7 +78,7 @@ class CodelesslyConfig with EquatableMixin {
7878
CodelesslyConfig copyWith({
7979
String? authToken,
8080
String? slug,
81-
bool? automaticallyCollectCrashReports,
81+
bool? automaticallySendCrashReports,
8282
bool? isPreview,
8383
bool? preload,
8484
String? firebaseProjectId,
@@ -87,8 +87,8 @@ class CodelesslyConfig with EquatableMixin {
8787
CodelesslyConfig(
8888
authToken: authToken ?? this.authToken,
8989
slug: slug ?? this.slug,
90-
automaticallyCollectCrashReports: automaticallyCollectCrashReports ??
91-
this.automaticallyCollectCrashReports,
90+
automaticallySendCrashReports: automaticallySendCrashReports ??
91+
this.automaticallySendCrashReports,
9292
isPreview: isPreview ?? this.isPreview,
9393
preload: preload ?? this.preload,
9494
firebaseProjectId: firebaseProjectId ?? this.firebaseProjectId,
@@ -100,9 +100,11 @@ class CodelesslyConfig with EquatableMixin {
100100
List<Object?> get props => [
101101
authToken,
102102
slug,
103-
automaticallyCollectCrashReports,
103+
automaticallySendCrashReports,
104104
isPreview,
105105
preload,
106+
firebaseProjectId,
107+
firebaseCloudFunctionsBaseURL,
106108
];
107109
}
108110

lib/src/ui/codelessly_widget.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ class _CodelesslyWidgetState extends State<CodelesslyWidget> {
248248
_effectiveController.effectiveCodelessly.initErrorHandler(
249249
firebaseProjectId: _effectiveController.config?.firebaseProjectId,
250250
automaticallySendCrashReports:
251-
_effectiveController.config?.automaticallyCollectCrashReports ??
252-
false,
251+
_effectiveController.config?.automaticallySendCrashReports ?? false,
253252
);
254253
}
255254

lib/src/ui/codelessly_widget_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class CodelesslyWidgetController extends ChangeNotifier {
189189
effectiveCodelessly.initErrorHandler(
190190
firebaseProjectId: effectiveCodelessly.config?.firebaseProjectId,
191191
automaticallySendCrashReports:
192-
effectiveCodelessly.config?.automaticallyCollectCrashReports ??
192+
effectiveCodelessly.config?.automaticallySendCrashReports ??
193193
false,
194194
);
195195
CodelesslyErrorHandler.instance

0 commit comments

Comments
 (0)