Use pkg:meta alwaysThrows to flag always throwing functions
MODIFY
lib/src/common.dart
lib/src/common.dart
@@ -9,6 +9,7 @@ import "dart:convert"
import "package:http/http.dart" as http;
import 'package:http_parser/http_parser.dart' as http_parser;
import "package:json_annotation/json_annotation.dart";
+import 'package:meta/meta.dart' as meta show alwaysThrows;
import 'common/model/repos_releases.dart';
import 'common/model/users.dart';

MODIFY
lib/src/common/github.dart
lib/src/common/github.dart
@@ -286,6 +286,7 @@ class GitHub {
///
/// Internal method to handle status codes
///
+ @meta.alwaysThrows
void handleStatusCode(http.Response response) {
String message;
List<Map<String, String>> errors;
@@ -396,7 +397,6 @@ class GitHub {
if (statusCode != null && statusCode != response.statusCode) {
fail != null ? fail(response) : null;
handleStatusCode(response);
- return null;
} else
return response;
}

MODIFY
lib/src/common/repos_service.dart
lib/src/common/repos_service.dart
@@ -552,8 +552,6 @@ class RepositoriesService extends Service {
throw NotReady(_github, path);
}
_github.handleStatusCode(response);
- // will never get here!
- return null;
}
/// Fetches commit counts for the past year.

MODIFY
pubspec.yaml
pubspec.yaml
@@ -9,6 +9,7 @@ dependencies:
http: '>=0.11.3 <0.13.0'
http_parser: ^3.1.1
json_annotation: ^2.0.0
+ meta: ^1.1.0
dev_dependencies:
build_runner: any
build_test: any

Use pkg:meta alwaysThrows to flag always throwing functions