Skip to content

Commit

Permalink
Added documentation for signup_progress_indicator.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
Satyam Jha committed Jan 28, 2025
1 parent f257f95 commit 903a3bc
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions lib/widgets/signup_progress_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
// ignore_for_file: talawa_api_doc
// ignore_for_file: talawa_good_doc_comments

import 'package:flutter/material.dart';
import 'package:talawa/services/size_config.dart';
import 'package:talawa/utils/app_localization.dart';
import 'package:timelines_plus/timelines_plus.dart';

/// This class returns a widget for showing the
/// progress indicator/flow while Signing Up/ Registration.
/// A widget that displays a progress indicator/flow for the Sign-Up or Registration process.
///
/// The widget uses a horizontal timeline to represent the progress
/// through different stages of the Sign-Up process.
///
/// **params**:
/// * `key`: The unique identifier for the widget.
/// * `currentPageIndex`: The index of the current step in the Sign-Up process.
///
/// **returns**:
/// None
class SignupProgressIndicator extends StatelessWidget {
SignupProgressIndicator({required Key key, required this.currentPageIndex})
: super(key: key);

/// The index of the current step in the Sign-Up process.
final int currentPageIndex;

/// The list of labels for each step in the progress indicator.
final List<String> progressLabel = [
'Select\nOrganization',
'Enter Details',
Expand All @@ -32,8 +41,9 @@ class SignupProgressIndicator extends StatelessWidget {
contentsBuilder: (_, index) => Text(
AppLocalizations.of(context)!.strictTranslate(progressLabel[index]),
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
// If the flow index is greater than currentPageIndex then
// show green(visited) color else show fade(not visited) color.
/// Sets the color of the text.
/// If the step index is less than or equal to `currentPageIndex`,
/// the color is green (visited). Otherwise, show fade(not visited) color.
color: index <= currentPageIndex
? const Color(0xFF008A37)
: const Color(0xFF737373),
Expand All @@ -43,8 +53,10 @@ class SignupProgressIndicator extends StatelessWidget {
connectorBuilder: (_, index, __) {
return SolidLineConnector(
space: 30,
// If the flow index is greater than currentPageIndex then
// show green(visited) color else show fade(not visited) color.

/// Sets the color of the connector line.
/// If the step index is less than `currentPageIndex`,
/// the color is green (visited). Otherwise, show fade(not visited) color.
color: index < currentPageIndex
? const Color(0xFF008A37)
: const Color(0xFF737373),
Expand Down

0 comments on commit 903a3bc

Please sign in to comment.