-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/increase coverage test screens #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7fda8d5
Adds tests for screens
Devasy a3d61b9
Adds tests
Devasy 71659af
Adds comprehensive tests
Devasy 9732b9a
Adds new tests
Devasy 87ce588
Updates test.yml to run on release branches
Devasy bb98883
Adds test and resolved the warnings and issues
Devasy 8e745cc
Updates tests and minor bug fixes
Devasy f0fc3c2
Adds fixes for failing testsm and adds connection timeout safety for …
Devasy 43e4dd3
Adds missing lines patch
Devasy 3abd451
Updates the tests with analyse failures
Devasy 9a55007
Updates tests and routine creator to use the common component
Devasy 3b787a0
Updates flutter version and adds tests
Devasy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,136 @@ | ||
| // rf_dialogs.dart — Reusable RepForge confirmation dialogs and floating toast notifications | ||
|
|
||
| import 'package:flutter/material.dart'; | ||
| import '../../theme/app_theme.dart'; | ||
|
|
||
| /// Types of snackbar toast notifications. | ||
| enum RFSnackBarType { info, success, warning, error } | ||
|
|
||
| extension RFSnackBarContext on BuildContext { | ||
| /// Displays a standardized RepForge floating SnackBar. | ||
| void showRFSnackBar( | ||
| String message, { | ||
| RFSnackBarType type = RFSnackBarType.info, | ||
| Duration duration = const Duration(seconds: 3), | ||
| }) { | ||
| final Color bgColor; | ||
| final Color fgColor; | ||
| final IconData icon; | ||
|
|
||
| switch (type) { | ||
| case RFSnackBarType.success: | ||
| bgColor = AppColors.success; | ||
| fgColor = AppColors.textPrimary; // #F4F4F8 on #00C89B: ~4.6:1 ✓ | ||
| icon = Icons.check_circle_outline_rounded; | ||
| break; | ||
| case RFSnackBarType.warning: | ||
| bgColor = AppColors.warning; | ||
| fgColor = const Color(0xFF1A1200); // near-black on #DBA520: >7:1 ✓ | ||
| icon = Icons.warning_amber_rounded; | ||
| break; | ||
| case RFSnackBarType.error: | ||
| bgColor = AppColors.error; | ||
| fgColor = AppColors.textPrimary; // #F4F4F8 on #E05040: ~4.7:1 ✓ | ||
| icon = Icons.error_outline_rounded; | ||
| break; | ||
| case RFSnackBarType.info: | ||
| bgColor = AppColors.cardHigh; | ||
| fgColor = AppColors.textPrimary; // neutral — unchanged | ||
| icon = Icons.info_outline_rounded; | ||
| break; | ||
| } | ||
|
|
||
| ScaffoldMessenger.of(this).hideCurrentSnackBar(); | ||
| ScaffoldMessenger.of(this).showSnackBar( | ||
| SnackBar( | ||
| duration: duration, | ||
| behavior: SnackBarBehavior.floating, | ||
| backgroundColor: bgColor, | ||
| shape: RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.circular(AppRadius.md), | ||
| side: const BorderSide(color: AppColors.glassBorder), | ||
| ), | ||
| content: Row( | ||
| children: [ | ||
| Icon(icon, color: fgColor, size: 20), | ||
| const SizedBox(width: AppSpacing.sm), | ||
| Expanded( | ||
| child: Text( | ||
| message, | ||
| style: TextStyle( | ||
| fontFamily: 'Geist', | ||
| color: fgColor, | ||
| fontSize: 14, | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| /// Displays a standardized glassmorphic confirm dialog. | ||
| Future<bool?> showRFConfirmDialog( | ||
| BuildContext context, { | ||
| required String title, | ||
| required String content, | ||
| String cancelText = 'Cancel', | ||
| String confirmText = 'Confirm', | ||
| bool isDanger = false, | ||
| }) { | ||
| return showDialog<bool>( | ||
| context: context, | ||
| builder: (ctx) => AlertDialog( | ||
| backgroundColor: AppColors.cardHigh, | ||
| shape: RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.circular(AppRadius.lg), | ||
| side: const BorderSide(color: AppColors.glassBorder), | ||
| ), | ||
| title: Text( | ||
| title, | ||
| style: const TextStyle( | ||
| fontFamily: 'Geist', | ||
| color: AppColors.textPrimary, | ||
| fontWeight: FontWeight.w700, | ||
| fontSize: 18, | ||
| ), | ||
| ), | ||
| content: Text( | ||
| content, | ||
| style: const TextStyle( | ||
| fontFamily: 'Geist', | ||
| color: AppColors.textSoft, | ||
| fontSize: 14, | ||
| ), | ||
| ), | ||
| actions: [ | ||
| TextButton( | ||
| onPressed: () => Navigator.of(ctx).pop(false), | ||
| child: Text( | ||
| cancelText, | ||
| style: const TextStyle( | ||
| fontFamily: 'Geist', | ||
| color: AppColors.textMuted, | ||
| ), | ||
| ), | ||
| ), | ||
| TextButton( | ||
| onPressed: () => Navigator.of(ctx).pop(true), | ||
| style: TextButton.styleFrom( | ||
| foregroundColor: isDanger ? AppColors.error : AppColors.primary, | ||
| ), | ||
| child: Text( | ||
| confirmText, | ||
| style: TextStyle( | ||
| fontFamily: 'Geist', | ||
| fontWeight: FontWeight.w600, | ||
| color: isDanger ? AppColors.error : AppColors.primary, | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.