diff --git a/lib/widgets/button_send.dart b/lib/widgets/button_send.dart index 9434e949..67e78908 100644 --- a/lib/widgets/button_send.dart +++ b/lib/widgets/button_send.dart @@ -18,17 +18,15 @@ class SendButton extends StatelessWidget { Widget build(BuildContext context) { return ADFilledButton( onPressed: isWorking ? onCancel : onTap, + isTonal: isWorking ? true : false, items: isWorking ? const [ + kHSpacer8, Text( kLabelCancel, style: kTextStyleButton, ), - kHSpacer10, - Icon( - size: 16, - Icons.cancel, - ) + kHSpacer6, ] : const [ Text( diff --git a/packages/apidash_design_system/lib/tokens/measurements.dart b/packages/apidash_design_system/lib/tokens/measurements.dart index bbcb1da8..4be0ec8a 100644 --- a/packages/apidash_design_system/lib/tokens/measurements.dart +++ b/packages/apidash_design_system/lib/tokens/measurements.dart @@ -84,6 +84,8 @@ const kSizedBoxEmpty = SizedBox(); const kHSpacer2 = SizedBox(width: 2); const kHSpacer4 = SizedBox(width: 4); const kHSpacer5 = SizedBox(width: 5); +const kHSpacer6 = SizedBox(width: 6); +const kHSpacer8 = SizedBox(width: 8); const kHSpacer10 = SizedBox(width: 10); const kHSpacer12 = SizedBox(width: 12); const kHSpacer20 = SizedBox(width: 20); diff --git a/test/widgets/button_form_data_file_test.dart b/test/widgets/button_form_data_file_test.dart index 81a5d3b2..db0e1751 100644 --- a/test/widgets/button_form_data_file_test.dart +++ b/test/widgets/button_form_data_file_test.dart @@ -17,7 +17,7 @@ void main() { final icon = find.byIcon(Icons.snippet_folder_rounded); Finder button = find.ancestor( of: icon, - matching: find.byWidgetPredicate((widget) => widget is ElevatedButton)); + matching: find.byWidgetPredicate((widget) => widget is FilledButton)); expect(button, findsOneWidget); expect(find.text(kLabelSelectFile), findsOneWidget); @@ -37,7 +37,7 @@ void main() { final icon = find.byIcon(Icons.snippet_folder_rounded); Finder button = find.ancestor( of: icon, - matching: find.byWidgetPredicate((widget) => widget is ElevatedButton)); + matching: find.byWidgetPredicate((widget) => widget is FilledButton)); expect(button, findsOneWidget); expect(find.text(testValue), findsOneWidget); @@ -61,7 +61,7 @@ void main() { final icon = find.byIcon(Icons.snippet_folder_rounded); Finder button = find.ancestor( of: icon, - matching: find.byWidgetPredicate((widget) => widget is ElevatedButton)); + matching: find.byWidgetPredicate((widget) => widget is FilledButton)); await tester.tap(button); await tester.pump(); diff --git a/test/widgets/button_send_test.dart b/test/widgets/button_send_test.dart index 44180cff..c9bee3c7 100644 --- a/test/widgets/button_send_test.dart +++ b/test/widgets/button_send_test.dart @@ -56,7 +56,6 @@ void main() { // Verify initial cancel state expect(find.byIcon(Icons.send), findsNothing); expect(find.text(kLabelSend), findsNothing); - expect(find.byIcon(Icons.cancel), findsOneWidget); expect(find.text(kLabelCancel), findsOneWidget); // Tap and verify callback @@ -94,7 +93,6 @@ void main() { await tester.pump(); // Verify cancel state - expect(find.byIcon(Icons.cancel), findsOneWidget); expect(find.text(kLabelCancel), findsOneWidget); // Tap to cancel