style: dart fix apply

This commit is contained in:
Rongjian Zhang 2022-10-30 14:52:36 +08:00
parent 504ee9c863
commit c30895ab1e
4 changed files with 16 additions and 25 deletions

View File

@ -32,14 +32,19 @@ linter:
prefer_final_locals: true prefer_final_locals: true
use_super_parameters: true use_super_parameters: true
use_key_in_widget_constructors: false # waiting for auto fix: https://github.com/dart-lang/sdk/issues/50056 use_key_in_widget_constructors: false # waiting for auto fix: https://github.com/dart-lang/sdk/issues/50056
avoid_print: false # TODO:
# TODO:
avoid_print: false
use_build_context_synchronously: false
non_constant_identifier_names: false
analyzer: analyzer:
errors: errors:
todo: ignore todo: ignore
fixme: ignore fixme: ignore
exclude: invalid_annotation_target: ignore # https://github.com/rrousselGit/freezed#disabling-invalid_annotation_target-warning-and-warning-in-generates-files
- "**/*.gql.dart" # TODO:
- "**/*.g.dart" unused_element: false
override_on_non_overriding_member: false
# Additional information about this file can be found at # Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options # https://dart.dev/guides/language/analysis-options

View File

@ -1,14 +0,0 @@
# # Defines a default set of lint rules enforced for
# # projects at Google. For details and rationale,
# # see https://github.com/dart-lang/pedantic#enabled-lints.
# include: package:pedantic/analysis_options.yaml
# # For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# # Uncomment to specify additional rules.
# # linter:
# # rules:
# # - camel_case_types
# analyzer:
# # exclude:
# # - path/to/excluded/files/**

View File

@ -4,15 +4,15 @@ void main() async {
final trending = GithubTrending(); final trending = GithubTrending();
// get trending repositories // get trending repositories
var repos = await trending.getTrendingRepositories(); final repos = await trending.getTrendingRepositories();
print(repos[0].name); print(repos[0].name);
// specify time period // specify time period
var weeklyRepos = await trending.getTrendingRepositories(since: 'weekly'); final weeklyRepos = await trending.getTrendingRepositories(since: 'weekly');
print(weeklyRepos[0].name); print(weeklyRepos[0].name);
// specify language // specify language
var dartRepos = await trending.getTrendingRepositories(language: 'dart'); final dartRepos = await trending.getTrendingRepositories(language: 'dart');
print(dartRepos[0].language); // Dart print(dartRepos[0].language); // Dart
print(dartRepos[0].languageColor); // #00B4AB print(dartRepos[0].languageColor); // #00B4AB
} }

View File

@ -4,9 +4,9 @@ part 'model.g.dart';
@JsonSerializable() @JsonSerializable()
class GithubTrendingRepository { class GithubTrendingRepository {
GithubTrendingRepository();
factory GithubTrendingRepository.fromJson(Map<String, dynamic> json) => factory GithubTrendingRepository.fromJson(Map<String, dynamic> json) =>
_$GithubTrendingRepositoryFromJson(json); _$GithubTrendingRepositoryFromJson(json);
GithubTrendingRepository();
String? author; String? author;
String? name; String? name;
String? avatar; String? avatar;
@ -22,9 +22,9 @@ class GithubTrendingRepository {
@JsonSerializable() @JsonSerializable()
class GithubTrendingRepositoryBuiltBy { class GithubTrendingRepositoryBuiltBy {
GithubTrendingRepositoryBuiltBy();
factory GithubTrendingRepositoryBuiltBy.fromJson(Map<String, dynamic> json) => factory GithubTrendingRepositoryBuiltBy.fromJson(Map<String, dynamic> json) =>
_$GithubTrendingRepositoryBuiltByFromJson(json); _$GithubTrendingRepositoryBuiltByFromJson(json);
GithubTrendingRepositoryBuiltBy();
String? href; String? href;
String? avatar; String? avatar;
String? username; String? username;
@ -32,9 +32,9 @@ class GithubTrendingRepositoryBuiltBy {
@JsonSerializable() @JsonSerializable()
class GithubTrendingDeveloper { class GithubTrendingDeveloper {
GithubTrendingDeveloper();
factory GithubTrendingDeveloper.fromJson(Map<String, dynamic> json) => factory GithubTrendingDeveloper.fromJson(Map<String, dynamic> json) =>
_$GithubTrendingDeveloperFromJson(json); _$GithubTrendingDeveloperFromJson(json);
GithubTrendingDeveloper();
String? username; String? username;
String? name; String? name;
String? type; String? type;
@ -45,10 +45,10 @@ class GithubTrendingDeveloper {
@JsonSerializable() @JsonSerializable()
class GithubTrendingDeveloperRepository { class GithubTrendingDeveloperRepository {
GithubTrendingDeveloperRepository();
factory GithubTrendingDeveloperRepository.fromJson( factory GithubTrendingDeveloperRepository.fromJson(
Map<String, dynamic> json) => Map<String, dynamic> json) =>
_$GithubTrendingDeveloperRepositoryFromJson(json); _$GithubTrendingDeveloperRepositoryFromJson(json);
GithubTrendingDeveloperRepository();
String? name; String? name;
String? description; String? description;
String? url; String? url;