-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1534 from atsign-foundation/1518-npt_atsign_bugs
fix: npt ui fixes
- Loading branch information
Showing
14 changed files
with
131 additions
and
21 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:npt_flutter/app.dart'; | ||
|
||
enum ProfileStatus { | ||
off, | ||
starting, | ||
on, | ||
stopping, | ||
loading, | ||
failedToStart, | ||
failedToLoad, | ||
} | ||
|
||
extension ProfileStatusExtension on ProfileStatus { | ||
String get message { | ||
final strings = AppLocalizations.of(App.navState.currentContext!)!; | ||
switch (this) { | ||
case ProfileStatus.off: | ||
return strings.profileStatusLoaded; | ||
case ProfileStatus.starting: | ||
return strings.profileStatusStarting; | ||
case ProfileStatus.on: | ||
return strings.profileStatusStarted; | ||
case ProfileStatus.stopping: | ||
return strings.profileStatusStopping; | ||
case ProfileStatus.loading: | ||
return strings.profileStatusLoading; | ||
case ProfileStatus.failedToStart: | ||
return strings.profileStatusFailedStart; | ||
case ProfileStatus.failedToLoad: | ||
return strings.profileStatusFailedLoad; | ||
} | ||
} | ||
|
||
String get emoji { | ||
switch (this) { | ||
case ProfileStatus.off: | ||
return '⚪'; | ||
case ProfileStatus.starting: | ||
return '🟡'; | ||
case ProfileStatus.on: | ||
return '🟢'; | ||
case ProfileStatus.stopping: | ||
return '🟡'; | ||
case ProfileStatus.loading: | ||
return '🟡'; | ||
case ProfileStatus.failedToStart: | ||
return '🔴'; | ||
case ProfileStatus.failedToLoad: | ||
return '🔴'; | ||
} | ||
} | ||
} |