-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add add water feature widgets on widgetbook
- Loading branch information
Showing
7 changed files
with
228 additions
and
31 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
12 changes: 12 additions & 0 deletions
12
...or_2/widgetbook/lib/src/features/add_water/view/widgets/add_water_screen_back_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,12 @@ | ||
import 'package:coffee_maker_navigator_2/features/add_water/ui/view/widgets/add_water_screen_back_button.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart'; | ||
|
||
@UseCase( | ||
name: 'AddWaterScreenBackButton', | ||
type: AddWaterScreenBackButton, | ||
path: 'Add Water/Widgets', | ||
) | ||
Widget addWaterScreenBackButton(BuildContext context) { | ||
return const AddWaterScreenBackButton(); | ||
} |
18 changes: 18 additions & 0 deletions
18
...navigator_2/widgetbook/lib/src/features/add_water/view/widgets/add_water_screen_body.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,18 @@ | ||
import 'package:coffee_maker_navigator_2/features/add_water/ui/view/widgets/add_water_screen_body.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart'; | ||
|
||
@UseCase( | ||
name: 'AddWaterScreenBody', | ||
type: AddWaterScreenBody, | ||
path: 'Add Water/Widgets', | ||
) | ||
Widget addWaterScreenBody(BuildContext context) { | ||
return Scaffold( | ||
body: AddWaterScreenBody( | ||
onWaterQuantityUpdated: (_) {}, | ||
onWaterTemperatureUpdated: (_) {}, | ||
onWaterSourceUpdated: (_) {}, | ||
), | ||
); | ||
} |
34 changes: 34 additions & 0 deletions
34
...igator_2/widgetbook/lib/src/features/add_water/view/widgets/add_water_screen_content.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,34 @@ | ||
import 'package:coffee_maker_navigator_2/features/add_water/ui/view/widgets/add_water_screen_content.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart'; | ||
|
||
@UseCase( | ||
name: 'AddWaterScreenContent', | ||
type: AddWaterScreenContent, | ||
path: 'Add Water/Widgets', | ||
) | ||
Widget addWaterScreenContent(BuildContext context) { | ||
return Scaffold( | ||
body: AddWaterScreenContent( | ||
isReadyToAddWater: ValueNotifier( | ||
context.knobs.boolean( | ||
label: 'Is Ready To Add Water', | ||
initialValue: false, | ||
), | ||
), | ||
errorMessage: ValueNotifier( | ||
context.knobs.string( | ||
label: 'Error Message', | ||
initialValue: 'Error message', | ||
), | ||
), | ||
onWaterQuantityUpdated: (_) {}, | ||
onWaterTemperatureUpdated: (_) {}, | ||
onWaterSourceUpdated: (_) {}, | ||
onCheckValidityPressed: () {}, | ||
onAddWaterPressed: () {}, | ||
onStepCompleted: () {}, | ||
), | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
...vigator_2/widgetbook/lib/src/features/add_water/view/widgets/add_water_screen_footer.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,31 @@ | ||
import 'package:coffee_maker_navigator_2/features/add_water/ui/view/widgets/add_water_screen_footer.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart'; | ||
|
||
@UseCase( | ||
name: 'AddWaterScreenFooter', | ||
type: AddWaterScreenFooter, | ||
path: 'Add Water/Widgets', | ||
) | ||
Widget addWaterScreenFooter(BuildContext context) { | ||
return Scaffold( | ||
body: AddWaterScreenFooter( | ||
ValueNotifier( | ||
context.knobs.boolean( | ||
label: 'Is Ready To Add Water', | ||
initialValue: false, | ||
), | ||
), | ||
ValueNotifier( | ||
context.knobs.string( | ||
label: 'Error Message', | ||
initialValue: 'Error message', | ||
), | ||
), | ||
() {}, | ||
() {}, | ||
() {}, | ||
), | ||
); | ||
} |
16 changes: 16 additions & 0 deletions
16
..._2/widgetbook/lib/src/features/add_water/view/widgets/add_water_step_order_not_found.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,16 @@ | ||
import 'package:coffee_maker_navigator_2/features/add_water/ui/view/widgets/add_water_step_order_not_found.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart'; | ||
|
||
@UseCase( | ||
name: 'AddWaterStepOrderNotFound', | ||
type: AddWaterStepOrderNotFound, | ||
path: 'Add Water/Widgets', | ||
) | ||
Widget addWaterStepOrderNotFound(BuildContext context) { | ||
return Scaffold( | ||
body: AddWaterStepOrderNotFound( | ||
onOrderStepCompleted: () {}, | ||
), | ||
); | ||
} |
22 changes: 22 additions & 0 deletions
22
...gator_2/widgetbook/lib/src/features/add_water/view/widgets/error_notification_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,22 @@ | ||
import 'package:coffee_maker_navigator_2/features/add_water/ui/view/widgets/error_notification_widget.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart'; | ||
|
||
@UseCase( | ||
name: 'ErrorNotificationWidget', | ||
type: ErrorNotificationWidget, | ||
path: 'Add Water/Widgets', | ||
) | ||
Widget errorNotificationWidget(BuildContext context) { | ||
return Scaffold( | ||
body: Center( | ||
child: ErrorNotificationWidget( | ||
context.knobs.string( | ||
label: 'Error Message', | ||
initialValue: 'Error message', | ||
), | ||
), | ||
), | ||
); | ||
} |