mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Adding the demo app from my I/O talk. Because AI. ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. --------- Co-authored-by: Brett Morgan <brett.morgan@gmail.com>
9 lines
277 B
Dart
9 lines
277 B
Dart
String cleanJson(String maybeInvalidJson) {
|
|
if (maybeInvalidJson.contains('```')) {
|
|
final withoutLeading = maybeInvalidJson.split('```json').last;
|
|
final withoutTrailing = withoutLeading.split('```').first;
|
|
return withoutTrailing;
|
|
}
|
|
return maybeInvalidJson;
|
|
}
|