-
Notifications
You must be signed in to change notification settings - Fork 6
/
requirement_widget.dart
64 lines (50 loc) · 1.82 KB
/
requirement_widget.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'package:flutter/material.dart';
class PassCheckRequirements extends StatelessWidget {
/// a `bool` value as check [required] field in case you want to `modify` the package
final bool? passCheck;
/// requirement text [required] field in case you want to `modify` the package
final String? requirementText;
/// IconData when requirement is completed
final IconData? activeIcon;
/// IconData when requirement is not completed/inActive
final IconData? inActiveIcon;
/// inActive color
final Color? inActiveColor;
/// Active color
final Color? activeColor;
PassCheckRequirements({
Key? key,
@required this.passCheck, /// [required parameters] in case you want to modify the package
@required this.requirementText, /// [required parameters] in case you want to modify the package
/// [default] value of in-active IconData
this.inActiveIcon = Icons.check_circle_outline_rounded,
/// [default] value of active IconData
this.activeIcon = Icons.check_circle_rounded,
/// [default] color of in-active field
this.inActiveColor = Colors.grey,
/// [default] color of active field
this.activeColor = Colors.blue,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 3.5),
child: Row(
children: [
/// requirement IconData based on check!
passCheck!
? Icon(Icons.check_circle_rounded, color: activeColor)
: Icon(Icons.check_circle_outline_rounded, color: inActiveColor),
SizedBox(width: 8.0),
/// requirement text
Text(
requirementText!,
style: TextStyle(
color: passCheck! ? activeColor : inActiveColor,
),
)
],
),
);
}
}