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