Skip to content

Commit

Permalink
feat: add add water feature widgets on widgetbook
Browse files Browse the repository at this point in the history
  • Loading branch information
mukireus committed Nov 19, 2024
1 parent a210fd8 commit 5329f62
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 31 deletions.
126 changes: 95 additions & 31 deletions coffee_maker_navigator_2/widgetbook/lib/main.directories.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,101 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:widgetbook/widgetbook.dart' as _i1;
import 'package:widgetbook_workspace/src/button/wolt_elevated_button.dart'
as _i16;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/grind/grind_or_reject_modal_page.dart'
as _i22;
import 'package:widgetbook_workspace/src/features/add_water/view/widgets/add_water_screen_back_button.dart'
as _i2;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/grind/reject_order_modal_page.dart'
import 'package:widgetbook_workspace/src/features/add_water/view/widgets/add_water_screen_body.dart'
as _i3;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/not_found/order_not_found_modal.dart'
import 'package:widgetbook_workspace/src/features/add_water/view/widgets/add_water_screen_content.dart'
as _i4;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/ready/extra_recommendation_tile.dart'
import 'package:widgetbook_workspace/src/features/add_water/view/widgets/add_water_screen_footer.dart'
as _i5;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/ready/offer_recommendation_modal_page.dart'
import 'package:widgetbook_workspace/src/features/add_water/view/widgets/add_water_step_order_not_found.dart'
as _i6;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/ready/serve_or_offer_modal_page.dart'
import 'package:widgetbook_workspace/src/features/add_water/view/widgets/error_notification_widget.dart'
as _i7;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/coffee_order_list_item_tile.dart'
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/grind/grind_or_reject_modal_page.dart'
as _i8;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/coffee_order_list_view_for_step.dart'
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/grind/reject_order_modal_page.dart'
as _i9;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/orders_screen_bottom_navigation_bar.dart'
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/not_found/order_not_found_modal.dart'
as _i10;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/ready/extra_recommendation_tile.dart'
as _i11;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/ready/offer_recommendation_modal_page.dart'
as _i12;
import 'package:widgetbook_workspace/src/features/orders/view/modal_pages/ready/serve_or_offer_modal_page.dart'
as _i13;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/coffee_order_list_item_tile.dart'
as _i14;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/coffee_order_list_view_for_step.dart'
as _i15;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/orders_screen_bottom_navigation_bar.dart'
as _i17;
import 'package:widgetbook_workspace/src/features/orders/view/widgets/orders_screen_content.dart'
as _i10;
as _i16;
import 'package:widgetbook_workspace/src/features/orders/widgets/coffee_maker_custom_divider.dart'
as _i12;
as _i18;
import 'package:widgetbook_workspace/src/features/orders/widgets/grid_layout_button.dart'
as _i13;
as _i19;
import 'package:widgetbook_workspace/src/features/orders/widgets/store_online_status_button.dart'
as _i14;
as _i20;
import 'package:widgetbook_workspace/src/features/orders/widgets/top_bar.dart'
as _i15;
as _i21;

final directories = <_i1.WidgetbookNode>[
_i1.WidgetbookFolder(
name: 'Add Water',
children: [
_i1.WidgetbookFolder(
name: 'Widgets',
children: [
_i1.WidgetbookLeafComponent(
name: 'AddWaterScreenBackButton',
useCase: _i1.WidgetbookUseCase(
name: 'AddWaterScreenBackButton',
builder: _i2.addWaterScreenBackButton,
),
),
_i1.WidgetbookLeafComponent(
name: 'AddWaterScreenBody',
useCase: _i1.WidgetbookUseCase(
name: 'AddWaterScreenBody',
builder: _i3.addWaterScreenBody,
),
),
_i1.WidgetbookLeafComponent(
name: 'AddWaterScreenContent',
useCase: _i1.WidgetbookUseCase(
name: 'AddWaterScreenContent',
builder: _i4.addWaterScreenContent,
),
),
_i1.WidgetbookLeafComponent(
name: 'AddWaterScreenFooter',
useCase: _i1.WidgetbookUseCase(
name: 'AddWaterScreenFooter',
builder: _i5.addWaterScreenFooter,
),
),
_i1.WidgetbookLeafComponent(
name: 'AddWaterStepOrderNotFound',
useCase: _i1.WidgetbookUseCase(
name: 'AddWaterStepOrderNotFound',
builder: _i6.addWaterStepOrderNotFound,
),
),
_i1.WidgetbookLeafComponent(
name: 'ErrorNotificationWidget',
useCase: _i1.WidgetbookUseCase(
name: 'ErrorNotificationWidget',
builder: _i7.errorNotificationWidget,
),
),
],
)
],
),
_i1.WidgetbookFolder(
name: 'Orders',
children: [
Expand All @@ -58,14 +122,14 @@ final directories = <_i1.WidgetbookNode>[
name: 'GrindOrRejectModalPage',
useCase: _i1.WidgetbookUseCase(
name: 'GrindOrRejectModalPage',
builder: _i2.grindOrRejectModalPage,
builder: _i8.grindOrRejectModalPage,
),
),
_i1.WidgetbookLeafComponent(
name: 'RejectOrderModalPage',
useCase: _i1.WidgetbookUseCase(
name: 'RejectOrderModalPage',
builder: _i3.rejectOrderModalPage,
builder: _i9.rejectOrderModalPage,
),
),
],
Expand All @@ -77,7 +141,7 @@ final directories = <_i1.WidgetbookNode>[
name: 'OrderNotFoundModal',
useCase: _i1.WidgetbookUseCase(
name: 'OrderNotFoundModal',
builder: _i4.rejectOrderModalPage,
builder: _i10.rejectOrderModalPage,
),
)
],
Expand All @@ -89,21 +153,21 @@ final directories = <_i1.WidgetbookNode>[
name: 'ExtraRecommendationTile',
useCase: _i1.WidgetbookUseCase(
name: 'ExtraRecommendationTile',
builder: _i5.extraRecommendationTile,
builder: _i11.extraRecommendationTile,
),
),
_i1.WidgetbookLeafComponent(
name: 'OfferRecommendationModalPage',
useCase: _i1.WidgetbookUseCase(
name: 'OfferRecommendationModalPage',
builder: _i6.offerRecommendationModalPage,
builder: _i12.offerRecommendationModalPage,
),
),
_i1.WidgetbookLeafComponent(
name: 'ServeOrOfferModalPage',
useCase: _i1.WidgetbookUseCase(
name: 'ServeOrOfferModalPage',
builder: _i7.serveOrOfferModalPage,
builder: _i13.serveOrOfferModalPage,
),
),
],
Expand All @@ -117,33 +181,33 @@ final directories = <_i1.WidgetbookNode>[
name: 'CoffeeOrderListItemTile',
useCase: _i1.WidgetbookUseCase(
name: 'CoffeeOrderListItemTile',
builder: _i8.coffeeOrderListItemTile,
builder: _i14.coffeeOrderListItemTile,
),
),
_i1.WidgetbookLeafComponent(
name: 'CoffeeOrderListViewForStep',
useCase: _i1.WidgetbookUseCase(
name: 'CoffeeOrderListViewForStep',
builder: _i9.coffeeOrderListViewForStep,
builder: _i15.coffeeOrderListViewForStep,
),
),
_i1.WidgetbookLeafComponent(
name: 'OrderScreenContent',
useCase: _i1.WidgetbookUseCase(
name: 'OrderScreenContent',
builder: _i10.orderScreenContent,
builder: _i16.orderScreenContent,
),
),
_i1.WidgetbookComponent(
name: 'OrdersScreenBottomNavigationBar',
useCases: [
_i1.WidgetbookUseCase(
name: 'Empty',
builder: _i11.ordersScreenBottomNavigationBarEmpty,
builder: _i17.ordersScreenBottomNavigationBarEmpty,
),
_i1.WidgetbookUseCase(
name: 'Filled',
builder: _i11.ordersScreenBottomNavigationBarFilled,
builder: _i17.ordersScreenBottomNavigationBarFilled,
),
],
),
Expand All @@ -158,28 +222,28 @@ final directories = <_i1.WidgetbookNode>[
name: 'CoffeeMakerCustomDivider',
useCase: _i1.WidgetbookUseCase(
name: 'CoffeeMakerCustomDivider',
builder: _i12.coffeeMakerCustomDivider,
builder: _i18.coffeeMakerCustomDivider,
),
),
_i1.WidgetbookLeafComponent(
name: 'GridLayoutButton',
useCase: _i1.WidgetbookUseCase(
name: 'GridLayoutButton',
builder: _i13.gridLayoutButton,
builder: _i19.gridLayoutButton,
),
),
_i1.WidgetbookLeafComponent(
name: 'StoreOnlineStatusButton',
useCase: _i1.WidgetbookUseCase(
name: 'StoreOnlineStatusButton',
builder: _i14.storeOnlineStatusButton,
builder: _i20.storeOnlineStatusButton,
),
),
_i1.WidgetbookLeafComponent(
name: 'TopBar',
useCase: _i1.WidgetbookUseCase(
name: 'TopBar',
builder: _i15.storeOnlineStatusButton,
builder: _i21.storeOnlineStatusButton,
),
),
],
Expand All @@ -193,7 +257,7 @@ final directories = <_i1.WidgetbookNode>[
name: 'WoltElevatedButton',
useCase: _i1.WidgetbookUseCase(
name: 'Primary',
builder: _i16.primaryButton,
builder: _i22.primaryButton,
),
)
],
Expand Down
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();
}
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: (_) {},
),
);
}
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: () {},
),
);
}
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',
),
),
() {},
() {},
() {},
),
);
}
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: () {},
),
);
}
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',
),
),
),
);
}

0 comments on commit 5329f62

Please sign in to comment.