-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
import 'package:progress_tracker/progress_tracker.dart'; | ||
|
||
class ProgressTrackerAtom extends StatelessWidget { | ||
const ProgressTrackerAtom(this.states, this.currentState); | ||
|
||
final List<String> states; | ||
final String currentState; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final int currentIndex = states.indexOf(currentState); | ||
final List<Status> statusList = []; | ||
bool active = true; | ||
|
||
for (final String state in states) { | ||
statusList.add( | ||
Status( | ||
name: state, | ||
icon: state == currentState ? FontAwesomeIcons.caretDown : null, | ||
active: active, | ||
), | ||
); | ||
if (state == currentState) { | ||
active = false; | ||
} | ||
} | ||
|
||
final ThemeData themeData = Theme.of(context); | ||
final ColorScheme colorScheme = themeData.colorScheme; | ||
|
||
return ProgressTracker( | ||
currentIndex: currentIndex, | ||
statusList: statusList, | ||
activeColor: colorScheme.onSurface, | ||
inActiveColor: colorScheme.outlineVariant, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters