Fixed most of the warnings

This commit is contained in:
Juan Gilsanz Polo 2024-09-11 18:13:26 +02:00
parent 715ca0ab3f
commit f7c3ba0374
87 changed files with 252 additions and 250 deletions

View file

@ -157,7 +157,7 @@ class _AddServerModalState extends State<AddServerModal> {
if (result != AuthStatus.success) {
cancelConnecting();
if (mounted) {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: getErrorMessage(result),
color: Colors.red
@ -206,7 +206,7 @@ class _AddServerModalState extends State<AddServerModal> {
if (serverCreated != null) {
if (mounted) setState(() => isConnecting = false);
if (mounted) {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.connectionNotCreated,
color: Colors.red
@ -256,7 +256,7 @@ class _AddServerModalState extends State<AddServerModal> {
if (result != AuthStatus.success) {
cancelConnecting();
if (mounted) {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: getErrorMessage(result),
color: Colors.red
@ -306,7 +306,7 @@ class _AddServerModalState extends State<AddServerModal> {
)
);
if (mounted) {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.connectionNotCreated,
color: Colors.red

View file

@ -13,7 +13,7 @@ class FormTextField extends StatelessWidget {
final bool isConnecting;
const FormTextField({
Key? key,
super.key,
required this.label,
required this.controller,
this.error,
@ -24,7 +24,7 @@ class FormTextField extends StatelessWidget {
this.hintText,
this.helperText,
required this.isConnecting
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -15,12 +15,12 @@ class CustomCombinedLineChart extends StatelessWidget {
final bool daysInterval;
const CustomCombinedLineChart({
Key? key,
super.key,
required this.inputData,
required this.context,
required this.dates,
required this.daysInterval
}) : super(key: key);
});
LineChartData mainData(Map<String, dynamic> data, ThemeMode selectedTheme) {
String chartDate(DateTime date) {
@ -55,11 +55,11 @@ class CustomCombinedLineChart extends StatelessWidget {
}
return LineChartData(
gridData: FlGridData(
gridData: const FlGridData(
show: false,
drawVerticalLine: false,
),
titlesData: FlTitlesData(
titlesData: const FlTitlesData(
show: false,
),
borderData: FlBorderData(
@ -73,7 +73,7 @@ class CustomCombinedLineChart extends StatelessWidget {
barWidth: 2,
isStrokeCapRound: true,
preventCurveOverShooting: true,
dotData: FlDotData(
dotData: const FlDotData(
show: false,
),
belowBarData: BarAreaData(

View file

@ -8,12 +8,12 @@ class ConfirmActionModal extends StatelessWidget {
final void Function() onConfirm;
const ConfirmActionModal({
Key? key,
super.key,
required this.icon,
required this.title,
required this.message,
required this.onConfirm
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -9,14 +9,14 @@ class CustomCheckboxListTile extends StatelessWidget {
final EdgeInsets? padding;
const CustomCheckboxListTile({
Key? key,
super.key,
required this.value,
required this.onChanged,
required this.title,
this.disabled,
this.subtitle,
this.padding
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -14,7 +14,7 @@ class CustomListTile extends StatelessWidget {
final Color? color;
const CustomListTile({
Key? key,
super.key,
required this.title,
this.subtitle,
this.subtitleWidget,
@ -26,7 +26,7 @@ class CustomListTile extends StatelessWidget {
this.disabled,
this.onHover,
this.color,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -7,12 +7,12 @@ class CustomRadio extends StatelessWidget {
final Color backgroundColor;
const CustomRadio({
Key? key,
super.key,
required this.value,
required this.groupValue,
this.onChange,
required this.backgroundColor,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -11,14 +11,14 @@ class CustomRadioListTile extends StatelessWidget {
final void Function(String) onChanged;
const CustomRadioListTile({
Key? key,
super.key,
required this.groupValue,
required this.value,
required this.radioBackgroundColor,
required this.title,
this.subtitle,
required this.onChanged,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -7,12 +7,12 @@ class CustomRadioToggle extends StatelessWidget {
final void Function(String) onTap;
const CustomRadioToggle({
Key? key,
super.key,
required this.groupSelected,
required this.value,
required this.label,
required this.onTap,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -13,13 +13,13 @@ class CustomLineChart extends StatelessWidget {
final BuildContext context;
const CustomLineChart({
Key? key,
super.key,
required this.data,
required this.color,
required this.dates,
required this.daysInterval,
required this.context
}) : super(key: key);
});
String chartDate(DateTime date) {
String twoDigits(int number) => number.toString().padLeft(2, '0');
@ -55,11 +55,11 @@ class CustomLineChart extends StatelessWidget {
LineChartData mainData(Map<String, dynamic> data, ThemeMode selectedTheme) {
return LineChartData(
gridData: FlGridData(
gridData: const FlGridData(
show: false,
drawVerticalLine: false,
),
titlesData: FlTitlesData(
titlesData: const FlTitlesData(
show: false,
),
borderData: FlBorderData(
@ -73,7 +73,7 @@ class CustomLineChart extends StatelessWidget {
barWidth: 2,
isStrokeCapRound: true,
preventCurveOverShooting: true,
dotData: FlDotData(
dotData: const FlDotData(
show: false,
),
belowBarData: BarAreaData(

View file

@ -11,9 +11,9 @@ class CustomMenuBar extends StatelessWidget {
final Widget child;
const CustomMenuBar({
Key? key,
super.key,
required this.child
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -7,12 +7,12 @@ class OptionBox extends StatelessWidget {
final String label;
const OptionBox({
Key? key,
super.key,
required this.optionsValue,
required this.itemValue,
required this.onTap,
required this.label,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -4,9 +4,9 @@ class ProcessDialog extends StatelessWidget {
final String message;
const ProcessDialog({
Key? key,
super.key,
required this.message,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -5,10 +5,10 @@ class SectionLabel extends StatelessWidget {
final EdgeInsets? padding;
const SectionLabel({
Key? key,
super.key,
required this.label,
this.padding
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -13,9 +13,9 @@ class DeleteModal extends StatelessWidget {
final Server serverToDelete;
const DeleteModal({
Key? key,
super.key,
required this.serverToDelete,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {
@ -34,14 +34,14 @@ class DeleteModal extends StatelessWidget {
appConfigProvider.setSelectedScreen(0);
}
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.connectionRemoved,
color: Colors.green
);
}
else {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.connectionCannotBeRemoved,
color: Colors.red

View file

@ -50,14 +50,15 @@ void showDeleteModal({
required BuildContext context,
required Server server
}) async {
await Future.delayed(const Duration(seconds: 0), () => {
await Future.delayed(const Duration(seconds: 0), () {
if (!context.mounted) return;
showDialog(
context: context,
builder: (context) => DeleteModal(
serverToDelete: server,
),
barrierDismissible: false
)
);
});
}
@ -133,7 +134,7 @@ void connectToServer({
process.close();
if (!context.mounted) return;
final appConfigProvider = Provider.of<AppConfigProvider>(context, listen: false);
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.cannotConnect,
color: Colors.red
@ -150,14 +151,14 @@ void setDefaultServer({
if (!context.mounted) return;
final appConfigProvider = Provider.of<AppConfigProvider>(context, listen: false);
if (result == null) {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.connectionDefaultSuccessfully,
color: Colors.green
);
}
else {
showSnacbkar(
showSnackbar(
appConfigProvider: appConfigProvider,
label: AppLocalizations.of(context)!.connectionDefaultFailed,
color: Colors.red

View file

@ -16,13 +16,13 @@ class ServersList extends StatelessWidget {
final double breakingWidth;
const ServersList({
Key? key,
super.key,
required this.context,
required this.controllers,
required this.onChange,
required this.scrollController,
required this.breakingWidth
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -68,7 +68,7 @@ class _ServersListItemState extends State<ServersListItem> with SingleTickerProv
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).colorScheme.surfaceVariant,
color: Theme.of(context).colorScheme.surfaceContainerHighest,
width: 1
)
)

View file

@ -11,10 +11,10 @@ class UpdateModal extends StatefulWidget {
final void Function(String, String) onDownload;
const UpdateModal({
Key? key,
super.key,
required this.gitHubRelease,
required this.onDownload,
}) : super(key: key);
});
@override
State<UpdateModal> createState() => _UpdateModalState();

View file

@ -5,9 +5,9 @@ class VersionWarningModal extends StatelessWidget {
final String version;
const VersionWarningModal({
Key? key,
super.key,
required this.version,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {