TF-1098 Apply lints for all module

This commit is contained in:
dab246
2022-10-21 13:31:33 +07:00
committed by Dat H. Pham
parent c6e73d4272
commit ae89802845
58 changed files with 442 additions and 348 deletions
@@ -128,9 +128,9 @@ class ConfirmDialogBuilder {
} else {
return Dialog(
key: _key,
shape: RoundedRectangleBorder(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16))),
insetPadding: EdgeInsets.symmetric(
insetPadding: const EdgeInsets.symmetric(
horizontal: 24.0,
vertical: 16.0),
child: _bodyContent(),
@@ -141,49 +141,49 @@ class ConfirmDialogBuilder {
Widget _bodyContent() {
return Container(
width: _widthDialog ?? 400,
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(16))),
borderRadius: const BorderRadius.all(Radius.circular(16))),
margin: _margin,
child: Wrap(children: [
if (_onCloseButtonAction != null)
Align(
alignment: Alignment.centerRight,
child: Padding(
padding: EdgeInsets.only(top: 8, right: 8),
padding: const EdgeInsets.only(top: 8, right: 8),
child: buildIconWeb(
icon: SvgPicture.asset(_imagePath.icCloseMailbox, fit: BoxFit.fill),
onTap: () => _onCloseButtonAction?.call())
)),
if (_iconWidget != null)
Container(
margin: _marginIcon ?? EdgeInsets.only(top: 24),
margin: _marginIcon ?? const EdgeInsets.only(top: 24),
alignment: Alignment.center,
child: _iconWidget,
),
if (_title.isNotEmpty)
Padding(
padding: _paddingTitle ?? EdgeInsets.only(top: 12),
padding: _paddingTitle ?? const EdgeInsets.only(top: 12),
child: Center(
child: Text(
_title,
textAlign: TextAlign.center,
style: _styleTitle ?? TextStyle(fontSize: 20.0, color: AppColor.colorActionDeleteConfirmDialog, fontWeight: FontWeight.w500)
style: _styleTitle ?? const TextStyle(fontSize: 20.0, color: AppColor.colorActionDeleteConfirmDialog, fontWeight: FontWeight.w500)
)
)
),
if (_content.isNotEmpty)
Padding(
padding: _paddingContent ?? EdgeInsets.symmetric(horizontal: 16, vertical: 24),
padding: _paddingContent ?? const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Center(
child: Text(_content,
textAlign: TextAlign.center,
style: _styleContent ?? TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog)
style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog)
),
),
),
Padding(
padding: _paddingButton ?? EdgeInsets.only(bottom: 16, left: 16, right: 16),
padding: _paddingButton ?? const EdgeInsets.only(bottom: 16, left: 16, right: 16),
child: Row(
children: [
if (_cancelText.isNotEmpty)
@@ -193,7 +193,7 @@ class ConfirmDialogBuilder {
radius: _radiusButton,
textStyle: _styleTextCancelButton,
action: _onCancelButtonAction)),
if (_confirmText.isNotEmpty && _cancelText.isNotEmpty) SizedBox(width: 16),
if (_confirmText.isNotEmpty && _cancelText.isNotEmpty) const SizedBox(width: 16),
if (_confirmText.isNotEmpty)
Expanded(child: _buildButton(
name: _confirmText,
@@ -225,11 +225,11 @@ class ConfirmDialogBuilder {
side: BorderSide(width: 0, color: bgColor ?? AppColor.colorTextButton),
)),
padding: MaterialStateProperty.resolveWith<EdgeInsets>(
(Set<MaterialState> states) => EdgeInsets.symmetric(horizontal: 16)),
(Set<MaterialState> states) => const EdgeInsets.symmetric(horizontal: 16)),
elevation: MaterialStateProperty.resolveWith<double>((Set<MaterialState> states) => 0)),
child: Text(name ?? '',
textAlign: TextAlign.center,
style: textStyle ?? TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: Colors.white)),
style: textStyle ?? const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: Colors.white)),
)
);
}
@@ -37,21 +37,21 @@ class DownloadingFileDialogBuilder {
Widget build() {
return CupertinoAlertDialog(
key: _key ?? Key('DownloadingFileBuilder'),
title: Text(_title, style: TextStyle(fontSize: 17.0, color: Colors.black)),
key: _key ?? const Key('DownloadingFileBuilder'),
title: Text(_title, style: const TextStyle(fontSize: 17.0, color: Colors.black)),
content: Padding(
padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: Center(
child: Column(
children: [
SizedBox(
const SizedBox(
width: 20.0,
height: 20.0,
child: CupertinoActivityIndicator()),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
_content,
style: TextStyle(fontSize: 13.0, color: Colors.black),
style: const TextStyle(fontSize: 13.0, color: Colors.black),
softWrap: false,
maxLines: 1)
],
@@ -60,10 +60,10 @@ class DownloadingFileDialogBuilder {
actions: [
if (_actionText.isNotEmpty)
Padding(
padding: EdgeInsets.only(bottom: kIsWeb ? 16 : 0, top: kIsWeb ? 16 : 0),
padding: const EdgeInsets.only(bottom: kIsWeb ? 16 : 0, top: kIsWeb ? 16 : 0),
child: TextButton(
onPressed: () => _onCancelDownloadActionClick?.call(),
child: Text(_actionText, style: TextStyle(fontSize: 17.0, color: AppColor.appColor)),
child: Text(_actionText, style: const TextStyle(fontSize: 17.0, color: AppColor.appColor)),
))
],
);
@@ -82,26 +82,26 @@ class EditTextDialogBuilder {
Widget build() {
return Dialog(
key: _key,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20))),
insetPadding: EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20))),
insetPadding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
child: Container(
margin: EdgeInsets.zero,
padding: EdgeInsets.zero,
width: 400,
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20))),
child: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
return Container(
padding: EdgeInsets.only(left: 30, right: 30, top: 30, bottom: 24),
padding: const EdgeInsets.only(left: 30, right: 30, top: 30, bottom: 24),
child: Wrap(
children: <Widget>[
Text(
_title,
style: TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700),
style: const TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700),
textAlign: TextAlign.center),
Padding(
padding: EdgeInsets.only(top: 20),
padding: const EdgeInsets.only(top: 20),
child: TextFormField(
keyboardType: TextInputType.visiblePassword,
onChanged: (value) => _onTextChanged(value, setState),
@@ -109,12 +109,12 @@ class EditTextDialogBuilder {
controller: _textController,
decoration: InputDecoration(
errorText: _error,
enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: AppColor.colorDividerMailbox)),
enabledBorder: const UnderlineInputBorder(borderSide: BorderSide(color: AppColor.colorDividerMailbox)),
hintText: _hintText),
)
),
Padding(
padding: EdgeInsets.only(left: 16, right: 16, top: 24),
padding: const EdgeInsets.only(left: 16, right: 16, top: 24),
child: Row(
children: [
Expanded(
@@ -123,7 +123,7 @@ class EditTextDialogBuilder {
bgColor: AppColor.colorContentEmail,
action: () => _onCancelButtonPress(context))
),
SizedBox(width: 20),
const SizedBox(width: 20),
Expanded(
child: _buildButton(
name: _confirmText,
@@ -164,7 +164,7 @@ class EditTextDialogBuilder {
side: BorderSide(width: 0, color: bgColor ?? AppColor.colorTextButton),
)),
padding: MaterialStateProperty.resolveWith<EdgeInsets>(
(Set<MaterialState> states) => EdgeInsets.symmetric(horizontal: 16)),
(Set<MaterialState> states) => const EdgeInsets.symmetric(horizontal: 16)),
elevation: MaterialStateProperty.resolveWith<double>((Set<MaterialState> states) => 0)),
child: Text(name ?? '',
textAlign: TextAlign.center,