-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…994) * feat: 🎸 create 'smooth action button' component Specifc button to use in the 'smooth alert dialog'. Created because the 'smooth simple button' creates a render box problem if multiple of them are in a horizontal group. * refactor: 💡 change the action buttons type requirement change from 'smooth simple button' to 'smooth action button' * docs: ✏️ change the action buttons type requirement in the doc * refactor: 💡 change the buttons in the smooth alert dialogues change the buttons to the new type of button requirement * refactor: 💡 remove unused imports * Rename smoot_action_button.dart to smooth_action_button.dart * Update packages/smooth_app/lib/pages/user_preferences_profile.dart * Update packages/smooth_app/lib/pages/product/common/product_dialog_helper.dart * Update packages/smooth_app/lib/pages/product/common/product_list_dialog_helper.dart * Update packages/smooth_app/lib/pages/user_management/sign_up_page.dart * Update packages/smooth_app/lib/pages/user_preferences_settings.dart * Update packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart * Update packages/smooth_ui_library/lib/dialogs/smooth_alert_dialog.dart * Update packages/smooth_app/lib/widgets/loading_dialog.dart * Update packages/smooth_app/lib/pages/product/nutrition_page_loaded.dart Co-authored-by: Moises Alonso <moises.alonso@codeminer42.com> Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
- Loading branch information
1 parent
d1194ad
commit 8cbca14
Showing
10 changed files
with
80 additions
and
43 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
37 changes: 37 additions & 0 deletions
37
packages/smooth_ui_library/lib/buttons/smooth_action_button.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,37 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SmoothActionButton extends StatelessWidget { | ||
const SmoothActionButton({ | ||
required this.text, | ||
required this.onPressed, | ||
this.minWidth = 15, | ||
this.height = 20, | ||
}); | ||
|
||
final String text; | ||
final VoidCallback onPressed; | ||
final double minWidth; | ||
final double height; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final ThemeData themeData = Theme.of(context); | ||
return MaterialButton( | ||
color: themeData.colorScheme.primary, | ||
child: Padding( | ||
padding: const EdgeInsets.all(10), | ||
child: Text( | ||
text, | ||
style: themeData.textTheme.bodyText2! | ||
.copyWith(color: themeData.colorScheme.onPrimary), | ||
), | ||
), | ||
height: height, | ||
minWidth: minWidth, | ||
shape: const RoundedRectangleBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(15.0)), | ||
), | ||
onPressed: () => onPressed(), | ||
); | ||
} | ||
} |
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