Skip to content

Commit 794991c

Browse files
authored
Merge pull request #17 from VB10/feature/code-static-anlycis
feature/code static anlycis
2 parents c435e6c + cb2b537 commit 794991c

38 files changed

+106
-132
lines changed

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:pedantic/analysis_options.1.9.0.yaml

lib/core/base/model/base_error.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:fluttermvvmtemplate/core/init/network/IResponseModel.dart';
1+
import '../../init/network/IResponseModel.dart';
22

33
class BaseError extends IErrorModel {
44
final String message;

lib/core/components/button/icon_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class IconNormalButton extends StatelessWidget {
1010
@override
1111
Widget build(BuildContext context) {
1212
return NormalButton(
13-
onPressed: this.onPressed,
13+
onPressed: onPressed,
1414
child: Center(
1515
child: Icon(icon),
1616
),

lib/core/components/button/normal_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class NormalButton extends StatelessWidget {
1111
return RaisedButton(
1212
padding: EdgeInsets.all(15),
1313
elevation: 10,
14-
onPressed: this.onPressed,
14+
onPressed: onPressed,
1515
child: child,
1616
);
1717
}

lib/core/components/button/title_text_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TitleTextButton extends StatelessWidget {
1010
@override
1111
Widget build(BuildContext context) {
1212
return NormalButton(
13-
onPressed: this.onPressed,
13+
onPressed: onPressed,
1414
child: Center(
1515
child: Text(text),
1616
),

lib/core/components/card/not_found_navigation_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class NotFoundNavigationWidget extends StatelessWidget {
44
@override
55
Widget build(BuildContext context) {
66
return Scaffold(
7-
body: Text("Not Found"),
7+
body: Text('Not Found'),
88
);
99
}
1010
}

lib/core/components/column/form_column.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FormColumn extends StatelessWidget {
1212
Expanded(
1313
flex: 8,
1414
child: Column(
15-
children: this.children,
15+
children: children,
1616
),
1717
),
1818
Spacer(flex: 1),

lib/core/components/decoration/circle_decoration.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ class _CirclePainter extends BoxPainter {
1313
final Paint _paint;
1414
final double radius;
1515

16+
Offset circleOffset;
17+
1618
_CirclePainter(Color color, this.radius)
1719
: _paint = Paint()
1820
..color = color
1921
..isAntiAlias = true;
2022

2123
@override
2224
void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
23-
final Offset circleOffset = offset + Offset(cfg.size.width / 2, cfg.size.height - radius - 5);
25+
circleOffset = offset + Offset(cfg.size.width / 2, cfg.size.height - radius - 5);
2426
canvas.drawCircle(circleOffset, radius, _paint);
2527
}
2628
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class ApplicationConstants {
2-
static const LANG_ASSET_PATH = "asset/lang";
3-
static const IPAD_NAME = "IPAD";
4-
static const FONT_FAMILY = "POPPINS";
5-
static const COMPANY_NAME = "HWA";
2+
static const LANG_ASSET_PATH = 'asset/lang';
3+
static const IPAD_NAME = 'IPAD';
4+
static const FONT_FAMILY = 'POPPINS';
5+
static const COMPANY_NAME = 'HWA';
66

7-
static const EMAIL_REGIEX = r"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}\$";
7+
static const EMAIL_REGIEX = r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}\$';
88
}
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
class ImageConstants {
22
static ImageConstants _instace;
33

4-
static ImageConstants get instance {
5-
if (_instace == null) _instace = ImageConstants._init();
6-
return _instace;
7-
}
4+
static ImageConstants get instance => _instace ??= ImageConstants._init();
85

96
ImageConstants._init();
107

11-
String get logo => toPng("veli");
8+
String get logo => toPng('veli');
129

13-
String get hotDog => toPng("hotdogs");
10+
String get hotDog => toPng('hotdogs');
1411

15-
String toPng(String name) => "asset/image/$name.png";
12+
String toPng(String name) => 'asset/image/$name.png';
1613
}

0 commit comments

Comments
 (0)