-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TF-2646 Handle mark all as starred for selection emails
- Loading branch information
Showing
22 changed files
with
559 additions
and
33 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
38 changes: 38 additions & 0 deletions
38
...presentation/widgets/loading/mark_all_as_starred_selection_all_emails_loading_widget.dart
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,38 @@ | ||
|
||
import 'package:core/presentation/state/failure.dart'; | ||
import 'package:core/presentation/state/success.dart'; | ||
import 'package:dartz/dartz.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart'; | ||
import 'package:tmail_ui_user/features/thread/domain/state/mark_all_as_starred_selection_all_emails_state.dart'; | ||
|
||
class MarkAllAsStarredSelectionAllEmailsLoadingWidget extends StatelessWidget with AppLoaderMixin { | ||
|
||
final Either<Failure, Success> viewState; | ||
|
||
const MarkAllAsStarredSelectionAllEmailsLoadingWidget({super.key, required this.viewState}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return viewState.fold( | ||
(failure) => const SizedBox.shrink(), | ||
(success) { | ||
if (success is MarkAllAsStarredSelectionAllEmailsLoading) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), | ||
child: horizontalLoadingWidget | ||
); | ||
} else if (success is MarkAllAsStarredSelectionAllEmailsUpdating) { | ||
final percent = success.total > 0 | ||
? success.countStarred / success.total | ||
: 0.0; | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), | ||
child: horizontalPercentLoadingWidget(percent) | ||
); | ||
} | ||
return const SizedBox.shrink(); | ||
} | ||
); | ||
} | ||
} |
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
Oops, something went wrong.