refactor: apply lint from analyzer

This commit is contained in:
validcube
2023-11-11 19:07:32 +07:00
committed by aAbed
parent d25d1efe9c
commit ad3a778fb9
40 changed files with 67 additions and 106 deletions

View File

@ -8,12 +8,12 @@ import 'package:timeago/timeago.dart';
class ApplicationItem extends StatefulWidget {
const ApplicationItem({
Key? key,
super.key,
required this.icon,
required this.name,
required this.patchDate,
required this.onPressed,
}) : super(key: key);
});
final Uint8List icon;
final String name;
final DateTime patchDate;

View File

@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
class CustomCard extends StatelessWidget {
const CustomCard({
Key? key,
super.key,
this.isFilled = true,
required this.child,
this.onTap,
this.padding,
this.backgroundColor,
}) : super(key: key);
});
final bool isFilled;
final Widget child;
final Function()? onTap;

View File

@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
class CustomChip extends StatelessWidget {
const CustomChip({
Key? key,
super.key,
required this.label,
this.isSelected = false,
this.onSelected,
}) : super(key: key);
});
final Widget label;
final bool isSelected;
final Function(bool)? onSelected;

View File

@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
class CustomMaterialButton extends StatelessWidget {
const CustomMaterialButton({
Key? key,
super.key,
required this.label,
this.isFilled = true,
this.isExpanded = false,
required this.onPressed,
}) : super(key: key);
});
final Widget label;
final bool isFilled;
final bool isExpanded;
@ -49,13 +49,13 @@ class CustomMaterialButton extends StatelessWidget {
// ignore: must_be_immutable
class TimerButton extends StatefulWidget {
TimerButton({
Key? key,
super.key,
required this.seconds,
required this.isRunning,
required this.onTimerEnd,
this.label = const Text(''),
this.isFilled = true,
}) : super(key: key);
});
Widget label;
bool isFilled;
int seconds;

View File

@ -1,39 +0,0 @@
import 'package:flutter/material.dart';
class CustomPopupMenu extends StatelessWidget {
const CustomPopupMenu({
Key? key,
required this.onSelected,
required this.children,
}) : super(key: key);
final Function(dynamic) onSelected;
final Map<int, Widget> children;
@override
Widget build(BuildContext context) {
return Theme(
data: Theme.of(context).copyWith(useMaterial3: false),
child: PopupMenuButton<int>(
icon: Icon(
Icons.more_vert,
color: Theme.of(context).colorScheme.secondary,
),
onSelected: onSelected,
itemBuilder: (context) => children.entries
.map(
(entry) => PopupMenuItem<int>(
padding: const EdgeInsets.all(16.0).copyWith(right: 20),
value: entry.key,
child: entry.value,
),
)
.toList(),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24),
),
color: Theme.of(context).colorScheme.secondaryContainer,
position: PopupMenuPosition.under,
),
);
}
}

View File

@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
class CustomSliverAppBar extends StatelessWidget {
const CustomSliverAppBar({
Key? key,
super.key,
required this.title,
this.actions,
this.bottom,
this.isMainView = false,
this.onBackButtonPressed,
}) : super(key: key);
});
final Widget title;
final List<Widget>? actions;
final PreferredSizeWidget? bottom;

View File

@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
class OpenContainerWrapper extends StatelessWidget {
const OpenContainerWrapper({
Key? key,
super.key,
required this.openBuilder,
required this.closedBuilder,
}) : super(key: key);
});
final OpenContainerBuilder openBuilder;
final CloseContainerBuilder closedBuilder;

View File

@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
class SearchBar extends StatefulWidget {
const SearchBar({
Key? key,
super.key,
required this.hintText,
this.showSelectIcon = false,
this.onSelectAll,
required this.onQueryChanged,
}) : super(key: key);
});
final String? hintText;
final bool showSelectIcon;
final Function(bool)? onSelectAll;