mirror of
https://github.com/flutter/samples.git
synced 2025-11-09 06:18:49 +00:00
Account for new generated rules.json location in linter tool (#1956)
In preparation for the linter moving to the SDK, the `rules.json` file is no longer generated to its own location. The site-www version is better guaranteed to be up to date and match the `stable` release of Dart.
This commit is contained in:
@@ -8,15 +8,14 @@ import 'package:linting_tool/model/rule.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
class APIProvider {
|
||||
static const String _baseURL = 'https://dart-lang.github.io/linter';
|
||||
|
||||
final http.Client httpClient;
|
||||
|
||||
APIProvider(this.httpClient);
|
||||
|
||||
Future<List<Rule>> getRulesList() async {
|
||||
final response =
|
||||
await httpClient.get(Uri.parse('$_baseURL/lints/machine/rules.json'));
|
||||
final response = await httpClient.get(Uri.parse(
|
||||
'https://raw.githubusercontent.com/dart-lang/site-www/main/src/_data/linter_rules.json',
|
||||
));
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body) as List;
|
||||
|
||||
Reference in New Issue
Block a user