Skip to content

Commit be71993

Browse files
feat: add proactive bug reporting
1 parent 0221b01 commit be71993

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

lib/src/models/proactive_reporting_config.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class ProactiveReportingConfigsBuilder {
3030
ProactiveReportingConfigsBuilder setGapBetweenModals(int gap) {
3131
if (gap <= 0) {
3232
_logWarning(
33-
'gapBetweenModals must be a positive number. Using default value of 30 seconds.',);
33+
'gapBetweenModals must be a positive number. Using default value of 30 seconds.',
34+
);
3435
return this;
3536
}
3637
gapBetweenModals = gap;
@@ -41,7 +42,8 @@ class ProactiveReportingConfigsBuilder {
4142
ProactiveReportingConfigsBuilder setModalDelayAfterDetection(int delay) {
4243
if (delay <= 0) {
4344
_logWarning(
44-
'modalDelayAfterDetection must be a positive number. Using default value of 15 seconds.',);
45+
'modalDelayAfterDetection must be a positive number. Using default value of 15 seconds.',
46+
);
4547
return this;
4648
}
4749
modalDelayAfterDetection = delay;

lib/src/modules/bug_reporting.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ class BugReporting implements BugReportingFlutterApi {
262262
static Future<void> setProactiveReportingConfigurations(
263263
ProactiveReportingConfigs config,
264264
) async {
265-
_host.setProactiveReportingConfigurations(config.enabled,
266-
config.gapBetweenModals, config.modalDelayAfterDetection,);
265+
_host.setProactiveReportingConfigurations(
266+
config.enabled,
267+
config.gapBetweenModals,
268+
config.modalDelayAfterDetection,
269+
);
267270
}
268271
}

pigeons/bug_reporting.api.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,8 @@ abstract class BugReportingHostApi {
3333
List<String>? reportTypes,
3434
);
3535
void setProactiveReportingConfigurations(
36-
bool enabled, int gapBetweenModals, int modalDelayAfterDetection,);
36+
bool enabled,
37+
int gapBetweenModals,
38+
int modalDelayAfterDetection,
39+
);
3740
}

test/bug_reporting_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,12 @@ void main() {
203203
test('[setProactiveReportingConfigurations] should call host method',
204204
() async {
205205
await BugReporting.setProactiveReportingConfigurations(
206-
ProactiveReportingConfigsBuilder()
207-
.setGapBetweenModals(1)
208-
.setModalDelayAfterDetection(1)
209-
.isEnabled(true)
210-
.build(),);
206+
ProactiveReportingConfigsBuilder()
207+
.setGapBetweenModals(1)
208+
.setModalDelayAfterDetection(1)
209+
.isEnabled(true)
210+
.build(),
211+
);
211212

212213
verify(mHost.setProactiveReportingConfigurations(true, 1, 1)).called(1);
213214
});

0 commit comments

Comments
 (0)