improving VMC flow
This commit is contained in:
@@ -11,6 +11,8 @@ class StepLoadingWidget extends StatefulWidget {
|
||||
final bool isLoading;
|
||||
final String? errorMessage;
|
||||
final VoidCallback? onRetry;
|
||||
final int pollAttempt;
|
||||
final int pollMaxAttempts;
|
||||
|
||||
const StepLoadingWidget({
|
||||
super.key,
|
||||
@@ -21,6 +23,8 @@ class StepLoadingWidget extends StatefulWidget {
|
||||
required this.isLoading,
|
||||
this.errorMessage,
|
||||
this.onRetry,
|
||||
this.pollAttempt = 0,
|
||||
this.pollMaxAttempts = 0,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -144,7 +148,24 @@ class _StepLoadingWidgetState extends State<StepLoadingWidget>
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
||||
const SizedBox(height: 50),
|
||||
// Poll attempt counter
|
||||
if (widget.pollMaxAttempts > 0 &&
|
||||
widget.status != 'SUCCESS' &&
|
||||
widget.status != 'FAILED')
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
child: Text(
|
||||
'Attempt ${widget.pollAttempt} of ${widget.pollMaxAttempts}',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.grey.shade500,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 36),
|
||||
|
||||
// Error state with retry
|
||||
if (widget.status == 'FAILED')
|
||||
|
||||
Reference in New Issue
Block a user