Skip to content

Commit

Permalink
#34 - return empty json when bufferString is empty / update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
OrlandoEduardo101 committed Jun 5, 2024
1 parent 38e4216 commit e6cfc10
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dartz: ^0.10.1
uno: ^1.0.1+3
mocktail: ^0.3.0
uno:
path: ../
mobx_triple: ^1.1.3+1
flutter_modular: ^5.0.3
flutter_triple: ^1.2.7+4

dev_dependencies:
mocktail: ^1.0.3
flutter_test:
sdk: flutter
integration_test:
Expand Down
4 changes: 4 additions & 0 deletions lib/src/external/universal_http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ class UniversalHttpClient implements HttpDatasource {
buffer.write(item);
}

if (buffer.toString().isEmpty) {
return {};
}

return jsonDecode(buffer.toString());
} on FormatException catch (e, s) {
throw UnoError<FormatException>(
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ dependencies:
universal_io: '>=2.2.0 <3.0.0'
characters: '>=1.2.1 <2.0.0'
meta: '>=1.8.0 <2.0.0'
mime_type: ^1.0.0
mime_type: '>=1.0.0 <2.0.0'
path: '>=1.8.2 <2.0.0'
file: '>=6.1.4 <7.0.0'
file: '>=6.1.4 <8.0.0'

dev_dependencies:
mocktail: ^0.3.0
mocktail: ^1.0.3
flutterando_analysis: ^0.0.2
test: '>=1.10.0 <2.0.0'

0 comments on commit e6cfc10

Please sign in to comment.