Skip to content

Commit a3858c0

Browse files
committed
non_constant_identifier_names
1 parent 3c45463 commit a3858c0

19 files changed

+66
-95
lines changed

analysis_options.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ analyzer:
55
mixin_inherits_from_not_object: ignore
66

77
linter:
8-
rules:
8+
rules:
9+
non_constant_identifier_names: false

lib/common/dao/user_dao.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class UserDao {
3939
if (res != null && res.result) {
4040
var result = Uri.parse("gsy://oauth?$res.data");
4141
var token = result.queryParameters["access_token"]!;
42-
var _token = 'token $token';
43-
await LocalStorage.save(Config.TOKEN_KEY, _token);
42+
var token0 = 'token $token';
43+
await LocalStorage.save(Config.TOKEN_KEY, token0);
4444

4545
resultData = await getUserInfo(null);
4646
if (Config.DEBUG!) {

lib/common/net/graphql/client.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import 'package:gsy_github_app_flutter/common/net/graphql/users.dart';
44
import 'package:gsy_github_app_flutter/common/utils/common_utils.dart';
55

66
Future<GraphQLClient> _client(token) async {
7-
final HttpLink _httpLink = HttpLink(
7+
final HttpLink httpLink = HttpLink(
88
'https://api.github.com/graphql',
99
);
1010

11-
final AuthLink _authLink = AuthLink(
11+
final AuthLink authLink = AuthLink(
1212
getToken: () => '$token',
1313
);
1414

15-
final Link _link = _authLink.concat(_httpLink);
15+
final Link link = authLink.concat(httpLink);
1616
var path = await CommonUtils.getApplicationDocumentsPath();
1717
final store = await HiveStore.open(path: path);
1818
return GraphQLClient(
1919
cache: GraphQLCache(store: store),
20-
link: _link,
20+
link: link,
2121
);
2222
}
2323

@@ -32,14 +32,14 @@ releaseClient() {
3232
}
3333

3434
Future<QueryResult>? getRepository(String owner, String? name) async {
35-
final QueryOptions _options = QueryOptions(
35+
final QueryOptions options = QueryOptions(
3636
document: gql(readRepository),
3737
variables: <String, dynamic>{
3838
'owner': owner,
3939
'name': name,
4040
},
4141
fetchPolicy: FetchPolicy.noCache);
42-
return await _innerClient!.query(_options);
42+
return await _innerClient!.query(options);
4343
}
4444

4545
Future<QueryResult>? getTrendUser(String location, {String? cursor}) async {
@@ -51,9 +51,9 @@ Future<QueryResult>? getTrendUser(String location, {String? cursor}) async {
5151
'location': "location:$location sort:followers",
5252
'after': cursor,
5353
};
54-
final QueryOptions _options = QueryOptions(
54+
final QueryOptions options = QueryOptions(
5555
document: gql(cursor == null ? readTrendUser : readTrendUserByCursor),
5656
variables: variables,
5757
fetchPolicy: FetchPolicy.noCache);
58-
return await _innerClient!.query(_options);
58+
return await _innerClient!.query(options);
5959
}

lib/common/net/interceptors/log_interceptor.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: type_literal_in_constant_pattern
2+
13
import 'package:dio/dio.dart';
24
import 'package:gsy_github_app_flutter/common/config/config.dart';
35

lib/common/scoped_model/scoped_model.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class ScopedModel<T extends Model> extends StatelessWidget {
118118
Widget build(BuildContext context) {
119119
return AnimatedBuilder(
120120
animation: model!,
121-
builder: (context, _) => _InheritedModel<T>(model: model!, child: child!),
121+
builder: (context, _) => _InheritedModel<T>(model: model, child: child!),
122122
);
123123
}
124124

@@ -274,6 +274,7 @@ class ScopedModelDescendant<T extends Model> extends StatelessWidget {
274274
class ScopedModelError extends Error {
275275
ScopedModelError();
276276

277+
@override
277278
String toString() {
278279
return '''Error: Could not find the correct ScopedModel.
279280

lib/page/login/login_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ mixin LoginBLoC on State<LoginPage> {
200200

201201
oauthLogin() async {
202202
String? code = await NavigatorUtils.goLoginWebView(context,
203-
Address.getOAuthUrl(), "${GSYLocalizations.i18n(context)!.oauth_text}");
203+
Address.getOAuthUrl(), GSYLocalizations.i18n(context)!.oauth_text);
204204

205205
if (code != null && code.isNotEmpty) {
206206
///通过 redux 去执行登陆流程

lib/page/repos/repository_detail_issue_list_page.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ class RepositoryDetailIssuePageState extends State<RepositoryDetailIssuePage>
109109
page: page);
110110
}
111111

112-
@override
113-
void initState() {
114-
super.initState();
115-
}
116112

117113
@override
118114
bool get wantKeepAlive => true;

lib/page/search/search_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ class AnimationClipper extends CustomClipper<Path> {
315315
});
316316

317317
@override
318-
bool shouldReclip(old) => true;
318+
bool shouldReclip(oldClipper) => true;
319319

320320
@override
321321
Path getClip(Size size) {

lib/page/welcome_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class _WelcomePageState extends State<WelcomePage> {
100100
height: size,
101101
child: RiveAnimation.asset(
102102
'static/file/launch.riv',
103-
animations: ["lookUp"],
103+
animations: const ["lookUp"],
104104
onInit: (arb) {
105105
var controller =
106106
StateMachineController.fromArtboard(arb, "birb");

lib/redux/login_redux.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class LoginMiddleware implements MiddlewareClass<GSYState> {
7171
}
7272

7373
Stream<dynamic> loginEpic(Stream<dynamic> actions, EpicStore<GSYState> store) {
74-
Stream<dynamic> _loginIn(
74+
Stream<dynamic> loginIn(
7575
LoginAction action, EpicStore<GSYState> store) async* {
7676
CommonUtils.showLoadingDialog(action.context);
7777
var res = await UserDao.login(
@@ -81,11 +81,11 @@ Stream<dynamic> loginEpic(Stream<dynamic> actions, EpicStore<GSYState> store) {
8181
}
8282
return actions
8383
.whereType<LoginAction>()
84-
.switchMap((action) => _loginIn(action, store));
84+
.switchMap((action) => loginIn(action, store));
8585
}
8686

8787
Stream<dynamic> oauthEpic(Stream<dynamic> actions, EpicStore<GSYState> store) {
88-
Stream<dynamic> _loginIn(
88+
Stream<dynamic> loginIn(
8989
OAuthAction action, EpicStore<GSYState> store) async* {
9090
CommonUtils.showLoadingDialog(action.context);
9191
var res = await UserDao.oauth(action.code, store);
@@ -94,5 +94,5 @@ Stream<dynamic> oauthEpic(Stream<dynamic> actions, EpicStore<GSYState> store) {
9494
}
9595
return actions
9696
.whereType<OAuthAction>()
97-
.switchMap((action) => _loginIn(action, store));
97+
.switchMap((action) => loginIn(action, store));
9898
}

0 commit comments

Comments
 (0)