Skip to content

Commit cd4d114

Browse files
committed
use_key_in_widget_constructors
1 parent a55b17d commit cd4d114

File tree

64 files changed

+88
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+88
-60
lines changed

lib/app.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import 'package:redux/redux.dart';
2323
import 'common/utils/navigator_utils.dart';
2424

2525
class FlutterReduxApp extends StatefulWidget {
26+
const FlutterReduxApp({super.key});
27+
2628
@override
2729
_FlutterReduxAppState createState() => _FlutterReduxAppState();
2830
}

lib/common/scoped_model/scoped_model.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class ScopedModel<T extends Model> extends StatelessWidget {
110110
/// The [Widget] the [model] will be available to.
111111
final Widget? child;
112112

113-
const ScopedModel({@required this.model, @required this.child})
113+
const ScopedModel({super.key, @required this.model, @required this.child})
114114
: assert(model != null),
115115
assert(child != null);
116116

@@ -250,7 +250,7 @@ class ScopedModelDescendant<T extends Model> extends StatelessWidget {
250250
final bool rebuildOnChange;
251251

252252
/// Creates the ScopedModelDescendant
253-
const ScopedModelDescendant({
253+
const ScopedModelDescendant({super.key,
254254
@required this.builder,
255255
this.child,
256256
this.rebuildOnChange = true,

lib/env/config_wrapper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:gsy_github_app_flutter/env/env_config.dart';
44

55
///往下共享环境配置
66
class ConfigWrapper extends StatelessWidget {
7-
const ConfigWrapper({Key? key, this.config, this.child});
7+
const ConfigWrapper({super.key, this.config, this.child});
88

99
@override
1010
Widget build(BuildContext context) {

lib/page/code_detail_page_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CodeDetailPageWeb extends StatefulWidget {
2929
final String? htmlUrl;
3030

3131
const CodeDetailPageWeb(
32-
{this.title,
32+
{super.key, this.title,
3333
this.userName,
3434
this.reposName,
3535
this.path,

lib/page/common_list_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CommonListPage extends StatefulWidget {
2424
final String? title;
2525

2626
const CommonListPage(this.title, this.showType, this.dataType,
27-
{this.userName, this.reposName});
27+
{super.key, this.userName, this.reposName});
2828

2929
@override
3030
_CommonListPageState createState() => _CommonListPageState();

lib/page/debug/debug_data_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import '../error_page.dart';
1010

1111
///请求数据调
1212
class DebugDataPage extends StatefulWidget {
13+
const DebugDataPage({super.key});
14+
1315
@override
1416
_DebugDataPageState createState() => _DebugDataPageState();
1517
}
@@ -66,7 +68,7 @@ class DebugDataList extends StatefulWidget {
6668

6769
final List<String?> titles;
6870

69-
const DebugDataList(this.titles, this.dataList);
71+
const DebugDataList(this.titles, this.dataList, {super.key});
7072

7173
@override
7274
_DebugDataListState createState() => _DebugDataListState();

lib/page/debug/debug_label.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class GlobalLabel extends StatefulWidget {
6969
final String? platform;
7070
final String? language;
7171

72-
const GlobalLabel({this.version, this.deviceInfo, this.platform, this.language});
72+
const GlobalLabel({super.key, this.version, this.deviceInfo, this.platform, this.language});
7373

7474
@override
7575
_GlobalLabelState createState() => _GlobalLabelState();

lib/page/error_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ErrorPage extends StatefulWidget {
99
final String errorMessage;
1010
final FlutterErrorDetails details;
1111

12-
const ErrorPage(this.errorMessage, this.details);
12+
const ErrorPage(this.errorMessage, this.details, {super.key});
1313

1414
@override
1515
ErrorPageState createState() => ErrorPageState();

lib/page/gsy_webview.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GSYWebView extends StatefulWidget {
1313
final String url;
1414
final String? title;
1515

16-
const GSYWebView(this.url, this.title);
16+
const GSYWebView(this.url, this.title, {super.key});
1717

1818
@override
1919
_GSYWebViewState createState() => _GSYWebViewState();

lib/page/home/home_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import 'package:gsy_github_app_flutter/page/home/widget/home_drawer.dart';
1818
class HomePage extends StatefulWidget {
1919
static const String sName = "home";
2020

21+
const HomePage({super.key});
22+
2123
@override
2224
_HomePageState createState() => _HomePageState();
2325
}

0 commit comments

Comments
 (0)