mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
use isCurrentStep instead of checking with multi variables everyTime
This commit is contained in:
@ -176,6 +176,7 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
int step3 = 0;
|
||||
|
||||
Widget _buildStep1Indicator(int step, String label, UsersBloc bloc) {
|
||||
final isCurrentStep = currentStep == step;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@ -199,7 +200,7 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
currentStep == step
|
||||
isCurrentStep
|
||||
? Assets.currentProcessIcon
|
||||
: bloc.isCompleteBasics == false
|
||||
? Assets.wrongProcessIcon
|
||||
@ -214,12 +215,11 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: currentStep == step
|
||||
color: isCurrentStep
|
||||
? ColorsManager.blackColor
|
||||
: ColorsManager.greyColor,
|
||||
fontWeight: currentStep == step
|
||||
? FontWeight.bold
|
||||
: FontWeight.normal,
|
||||
fontWeight:
|
||||
isCurrentStep ? FontWeight.bold : FontWeight.normal,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -243,6 +243,7 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
}
|
||||
|
||||
Widget _buildStep2Indicator(int step, String label, UsersBloc bloc) {
|
||||
final isCurrentStep = currentStep == step;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@ -262,7 +263,7 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
currentStep == step
|
||||
isCurrentStep
|
||||
? Assets.currentProcessIcon
|
||||
: bloc.isCompleteSpaces == false
|
||||
? Assets.wrongProcessIcon
|
||||
@ -277,12 +278,11 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: currentStep == step
|
||||
color: isCurrentStep
|
||||
? ColorsManager.blackColor
|
||||
: ColorsManager.greyColor,
|
||||
fontWeight: currentStep == step
|
||||
? FontWeight.bold
|
||||
: FontWeight.normal,
|
||||
fontWeight:
|
||||
isCurrentStep ? FontWeight.bold : FontWeight.normal,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -306,6 +306,7 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
}
|
||||
|
||||
Widget _buildStep3Indicator(int step, String label, UsersBloc bloc) {
|
||||
final isCurrentStep = currentStep == step;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@ -324,7 +325,7 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
currentStep == step
|
||||
isCurrentStep
|
||||
? Assets.currentProcessIcon
|
||||
: bloc.isCompleteRolePermissions == false
|
||||
? Assets.wrongProcessIcon
|
||||
@ -339,12 +340,11 @@ class _EditUserDialogState extends State<EditUserDialog> {
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: currentStep == step
|
||||
color: isCurrentStep
|
||||
? ColorsManager.blackColor
|
||||
: ColorsManager.greyColor,
|
||||
fontWeight: currentStep == step
|
||||
? FontWeight.bold
|
||||
: FontWeight.normal,
|
||||
fontWeight:
|
||||
isCurrentStep ? FontWeight.bold : FontWeight.normal,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user