Skip to content

Commit f93e871

Browse files
committed
update dart/flutter code samples
1 parent 0a9d684 commit f93e871

File tree

39 files changed

+306
-408
lines changed

39 files changed

+306
-408
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
```dart {3}
2-
await Sentry.init(
3-
(options) {
4-
options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
5-
},
6-
);
1+
```dart {2}
2+
await Sentry.init((options) {
3+
options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
4+
});
75
```
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
```dart {3}
2-
await SentryFlutter.init(
3-
(options) {
4-
options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
5-
},
6-
);
1+
```dart {2}
2+
await SentryFlutter.init((options) {
3+
options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
4+
});
75
```
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
```dart {4}
2-
await Sentry.init(
3-
(options) {
4-
options.beforeBreadcrumb = (breadcrumb, hint) {
5-
return hint is MyHint ? null : crumb;
6-
};
7-
},
8-
);
1+
```dart {3}
2+
await Sentry.init((options) {
3+
options.beforeBreadcrumb = (breadcrumb, hint) {
4+
return hint is MyHint ? null : crumb;
5+
};
6+
});
97
```
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
```dart {4}
2-
await SentryFlutter.init(
3-
(options) {
4-
options.beforeBreadcrumb = (breadcrumb, hint) {
5-
return hint is MyHint ? null : crumb;
6-
};
7-
},
8-
);
1+
```dart {3}
2+
await SentryFlutter.init((options) {
3+
options.beforeBreadcrumb = (breadcrumb, hint) {
4+
return hint is MyHint ? null : crumb;
5+
};
6+
});
97
```
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
```dart {4-7}
2-
await Sentry.init(
3-
(options) {
4-
options.beforeSend = (event, hint) {
5-
if (event.throwable is DatabaseException) {
6-
event = event.copyWith(fingerprint: ['database-connection-error']);
7-
}
8-
return event;
9-
};
10-
},
11-
);
1+
```dart {3-6}
2+
await Sentry.init((options) {
3+
options.beforeSend = (event, hint) {
4+
if (event.throwable is DatabaseException) {
5+
event = event.copyWith(fingerprint: ['database-connection-error']);
6+
}
7+
return event;
8+
};
9+
});
1210
```
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
```dart {4-7}
2-
await SentryFlutter.init(
3-
(options) {
4-
options.beforeSend = (event, hint) {
5-
if (event.throwable is DatabaseException) {
6-
event = event.copyWith(fingerprint: ['database-connection-error']);
7-
}
8-
return event;
9-
};
10-
},
11-
);
1+
```dart {3-6}
2+
await SentryFlutter.init((options) {
3+
options.beforeSend = (event, hint) {
4+
if (event.throwable is DatabaseException) {
5+
event = event.copyWith(fingerprint: ['database-connection-error']);
6+
}
7+
return event;
8+
};
9+
});
1210
```
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
```dart {4}
2-
await Sentry.init(
3-
(options) {
4-
options.beforeSend = (event, hint) {
5-
return hint is MyHint ? null : event;
6-
};
7-
},
8-
);
1+
```dart {3}
2+
await Sentry.init((options) {
3+
options.beforeSend = (event, hint) {
4+
return hint is MyHint ? null : event;
5+
};
6+
});
97
```
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
```dart {4}
2-
await SentryFlutter.init(
3-
(options) {
4-
options.beforeSend = (event, hint) {
5-
return hint is MyHint ? null : event;
6-
};
7-
},
8-
);
1+
```dart {3}
2+
await SentryFlutter.init((options) {
3+
options.beforeSend = (event, hint) {
4+
return hint is MyHint ? null : event;
5+
};
6+
});
97
```
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
```dart {4}
2-
await Sentry.init(
3-
(options) {
4-
options.beforeSend = (event, hint) {
5-
return event.copyWith(serverName: null); // Don't send server names.
6-
};
7-
},
8-
);
1+
```dart {3}
2+
await Sentry.init((options) {
3+
options.beforeSend = (event, hint) {
4+
return event.copyWith(serverName: null); // Don't send server names.
5+
};
6+
});
97
```
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
```dart {4}
2-
await SentryFlutter.init(
3-
(options) {
4-
options.beforeSend = (event, hint) {
5-
return event.copyWith(serverName: null); // Don't send server names.
6-
};
7-
},
8-
);
1+
```dart {3}
2+
await SentryFlutter.init((options) {
3+
options.beforeSend = (event, hint) {
4+
return event.copyWith(serverName: null); // Don't send server names.
5+
};
6+
});
97
```

0 commit comments

Comments
 (0)