1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-12 08:27:04 +01:00

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
use_super_parameters: true
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:
errors:
todo: ignore
fixme: ignore
exclude:
- "**/*.gql.dart"
- "**/*.g.dart"
invalid_annotation_target: ignore # https://github.com/rrousselGit/freezed#disabling-invalid_annotation_target-warning-and-warning-in-generates-files
# TODO:
unused_element: false
override_on_non_overriding_member: false
# Additional information about this file can be found at
# 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();
// get trending repositories
var repos = await trending.getTrendingRepositories();
final repos = await trending.getTrendingRepositories();
print(repos[0].name);
// specify time period
var weeklyRepos = await trending.getTrendingRepositories(since: 'weekly');
final weeklyRepos = await trending.getTrendingRepositories(since: 'weekly');
print(weeklyRepos[0].name);
// specify language
var dartRepos = await trending.getTrendingRepositories(language: 'dart');
final dartRepos = await trending.getTrendingRepositories(language: 'dart');
print(dartRepos[0].language); // Dart
print(dartRepos[0].languageColor); // #00B4AB
}

View File

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