v1.0.1 warning fixes

This commit is contained in:
Tibor Bossanyi
2023-02-10 19:48:58 +01:00
parent ee205bf4b8
commit 9782a1ca46
19 changed files with 165 additions and 178 deletions
+6 -5
View File
@@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:workouttest_util/util/app_language.dart';
import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:intl/intl.dart';
class DateRate {
@@ -11,7 +12,7 @@ class DateRate {
static String yearly = "yearly";
}
mixin Common {
mixin Common{
final emailError = "Please type a right email address here.";
final passwordError = "The password must have at least 8 characters.";
@@ -29,7 +30,7 @@ mixin Common {
String dateName = DateFormat(DateFormat.YEAR_NUM_MONTH_DAY, AppLanguage().appLocal.toString()).format(date.toUtc());
if (timeDisplay) {
dateName += " " + DateFormat(DateFormat.HOUR_MINUTE, AppLanguage().appLocal.toString()).format(date.toUtc());
dateName += " ${DateFormat(DateFormat.HOUR_MINUTE, AppLanguage().appLocal.toString()).format(date.toUtc())}";
}
return dateName;
@@ -51,7 +52,7 @@ mixin Common {
}
static String? emailValidation(String? email) {
final String error = "Please type an email address";
const String error = "Please type an email address";
if (email == null) {
return error;
}
@@ -60,8 +61,8 @@ mixin Common {
}
static String? passwordValidation(String? value) {
final String error = "Password too short";
if (value == null || value.length == 0) {
const String error = "Password too short";
if (value == null || value.isEmpty) {
return error;
}
bool valid = 8 < value.length;