Skip to content

Commit

Permalink
fix asset
Browse files Browse the repository at this point in the history
  • Loading branch information
ulusoyca committed Nov 19, 2024
1 parent 4dffd1c commit a893600
Show file tree
Hide file tree
Showing 47 changed files with 57 additions and 21 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions coffee_maker_navigator_2/assets/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# coffee_maker_navigator_2/assets/pubspec.yaml
name: assets
description: >
Holds the assets for the app. The assets are included in a
separate package, to be able to share it with Widgetbook app.
version: 0.0.0
publish_to: none

environment:
sdk: ">=3.1.0 <4.0.0"

flutter:
assets:
- images/
2 changes: 1 addition & 1 deletion coffee_maker_navigator_2/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class AddWaterScreenBody extends StatelessWidget {
child: Column(
children: [
const Image(
image: AssetImage('lib/assets/images/add_water_description.png'),
image: AssetImage(
'assets/images/add_water_description.png',
package: 'assets',
),
fit: BoxFit.cover,
height: 200,
width: double.infinity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class AddWaterStepOrderNotFound extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Image(
image: AssetImage('lib/assets/images/order_not_found.webp'),
image: AssetImage('assets/images/order_not_found.webp',
package: 'assets'),
fit: BoxFit.cover,
height: 200,
width: double.infinity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class LoginScreenContent extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Image(
image: AssetImage('lib/assets/images/dash_coffee.webp'),
image: AssetImage('assets/images/dash_coffee.webp',
package: 'assets'),
fit: BoxFit.cover,
height: 216,
width: 384,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ We're excited to assist you with the orders. To ensure you get the most out of o
'''),
),
heroImage: const Image(
image: AssetImage('lib/assets/images/welcome_modal.webp'),
image: AssetImage('assets/images/welcome_modal.webp',
package: 'assets'),
fit: BoxFit.cover,
),
pageTitle: const Padding(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const String _imagePath = 'lib/assets/images/coffee_maker_state';
const String _imagePath = 'assets/images/coffee_maker_state';

enum CoffeeMakerStep {
grind(
stepName: 'Grind',
stepNumber: 0,
actionName: 'Start grinding',
assetName: '${_imagePath}_grind.jpg',
assetName: '${_imagePath}_grind.webp',
tutorialTitle: 'Tips for grinding',
queryParamName: 'grind',
tutorialContent: '''
Expand All @@ -17,7 +17,7 @@ The process of finding the perfect grind is not just about the size but also abo
stepName: 'Add water',
stepNumber: 1,
actionName: 'Add water',
assetName: '${_imagePath}_water.jpg',
assetName: '${_imagePath}_water.webp',
tutorialTitle: 'Adding water to coffee',
queryParamName: 'water',
tutorialContent: '''
Expand All @@ -30,7 +30,7 @@ Moreover, the quality of water used is paramount. The water source's pH level an
stepName: 'Ready',
stepNumber: 2,
actionName: 'Ready',
assetName: '${_imagePath}_ready.jpg',
assetName: '${_imagePath}_ready.webp',
tutorialTitle: 'Serving coffee',
queryParamName: 'ready',
tutorialContent: '''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class OrderNotFoundModal extends WoltModalSheetPage {
),
),
heroImage: const Image(
image: AssetImage('lib/assets/images/order_not_found.webp'),
image: AssetImage('assets/images/order_not_found.webp',
package: 'assets'),
fit: BoxFit.cover,
),
pageTitle: ModalSheetTitle(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const String _assetPath = 'lib/assets/images/';
const String _assetPath = 'assets/images/';

enum ExtraRecommendation {
bananaBread(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class _ExtraRecommendationTileState extends State<ExtraRecommendationTile> {
borderRadius: BorderRadius.circular(12.0),
child: Image(
image: AssetImage(
widget.recommendation.imageAssetPath),
widget.recommendation.imageAssetPath,
package: 'assets',
),
fit: BoxFit.cover),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ class ServeOrOfferModalPage extends WoltModalSheetPage {
required String coffeeOrderId,
}) : super(
heroImage: const Image(
image: AssetImage('lib/assets/images/coffee_is_ready.png'),
image: AssetImage(
'assets/images/coffee_is_ready.png',
package: 'assets',
),
fit: BoxFit.cover,
),
stickyActionBar: Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class CoffeeOrderListItemTile extends StatelessWidget {
child: Stack(
children: [
Image(
image: AssetImage(step.assetName),
image: AssetImage(
step.assetName,
package: 'assets',
),
fit: BoxFit.cover,
width: double.infinity,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class SingleTutorialScreen extends StatelessWidget {
Image(
height: 200,
width: double.infinity,
image: AssetImage(coffeeMakerStep.assetName),
image: AssetImage(
coffeeMakerStep.assetName,
package: 'assets',
),
fit: BoxFit.cover,
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class _TutorialsScreenState extends State<TutorialsScreen> {
height: 200,
width: double.infinity,
image: AssetImage(
'lib/assets/images/welcome_modal.webp'),
'assets/images/welcome_modal.webp',
package: 'assets',
),
fit: BoxFit.cover,
),
],
Expand Down
5 changes: 2 additions & 3 deletions coffee_maker_navigator_2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ dependencies:
path: ..
demo_ui_components:
path: ../demo_ui_components
assets:
path: assets

dev_dependencies:
flutter_lints: ^2.0.1
test: ^1.18.2

flutter:
uses-material-design: true

assets:
- lib/assets/images/
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:widgetbook/widgetbook.dart' as _i1;
import 'package:widgetbook_workspace/src/view/widgets/orders_screen_content.dart'
as _i3;
import 'package:widgetbook_workspace/src/button/wolt_elevated_button.dart'
as _i2;
import 'package:widgetbook_workspace/src/view/widgets/orders_screen_content.dart'
as _i3;

final directories = <_i1.WidgetbookNode>[
_i1.WidgetbookFolder(
Expand Down
2 changes: 2 additions & 0 deletions coffee_maker_navigator_2/widgetbook/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies:
path: ../
demo_ui_components:
path: ../../demo_ui_components
assets:
path: ../assets

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit a893600

Please sign in to comment.