style: use super parameters

This commit is contained in:
Rongjian Zhang 2022-09-26 01:59:30 +08:00
parent d7972c4084
commit 8d1e3fa596
5 changed files with 6 additions and 7 deletions

View File

@ -30,6 +30,7 @@ linter:
omit_local_variable_types: true omit_local_variable_types: true
prefer_final_in_for_each: true prefer_final_in_for_each: true
prefer_final_locals: true prefer_final_locals: true
use_super_parameters: true
analyzer: analyzer:
exclude: exclude:

View File

@ -60,8 +60,7 @@ class GiteaTree {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GiteaBlob extends GiteaTree { class GiteaBlob extends GiteaTree {
GiteaBlob({required String type, required String name}) GiteaBlob({required super.type, required super.name});
: super(name: name, type: type);
factory GiteaBlob.fromJson(Map<String, dynamic> json) => factory GiteaBlob.fromJson(Map<String, dynamic> json) =>
_$GiteaBlobFromJson(json); _$GiteaBlobFromJson(json);
String? content; String? content;

View File

@ -62,8 +62,7 @@ class GogsTree {
@JsonSerializable(fieldRename: FieldRename.snake) @JsonSerializable(fieldRename: FieldRename.snake)
class GogsBlob extends GogsTree { class GogsBlob extends GogsTree {
GogsBlob({required String type, required String name}) GogsBlob({required super.type, required super.name});
: super(name: name, type: type);
factory GogsBlob.fromJson(Map<String, dynamic> json) => factory GogsBlob.fromJson(Map<String, dynamic> json) =>
_$GogsBlobFromJson(json); _$GogsBlobFromJson(json);
String? content; String? content;

View File

@ -10,7 +10,7 @@ const contributionEmptyColor = '#ebedf0';
const contributionColors = ['#9be9a8', '#40c463', '#30a14e', '#216e39']; const contributionColors = ['#9be9a8', '#40c463', '#30a14e', '#216e39'];
class HideScrollbar extends StatelessWidget { class HideScrollbar extends StatelessWidget {
const HideScrollbar({Key? key, this.child}) : super(key: key); const HideScrollbar({super.key, this.child});
final Widget? child; final Widget? child;
@override @override

View File

@ -10,10 +10,10 @@ import 'package:provider/provider.dart';
class NotificationItem extends StatefulWidget { class NotificationItem extends StatefulWidget {
const NotificationItem({ const NotificationItem({
Key? key, super.key,
required this.payload, required this.payload,
required this.markAsRead, required this.markAsRead,
}) : super(key: key); });
final GithubNotificationItem payload; final GithubNotificationItem payload;
final Function markAsRead; final Function markAsRead;