From f61abbb99e18e9bf4d372968d10abe1c1f653142 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Fri, 26 Jan 2024 17:46:11 +0800 Subject: [PATCH 1/9] refactor: move packages to deriv_ui --- .../example/android/build.gradle | 2 +- .../example/android/build.gradle | 2 +- .../plugins/GeneratedPluginRegistrant.java | 2 +- .../deriv_rudderstack/example/pubspec.lock | 38 +- packages/deriv_rudderstack/pubspec.lock | 38 +- packages/deriv_theme/pubspec.lock | 38 +- .../plugins/GeneratedPluginRegistrant.java | 4 +- packages/deriv_ui/example/.gitignore | 44 ++ packages/deriv_ui/example/.metadata | 36 + packages/deriv_ui/example/README.md | 16 + packages/deriv_ui/example/android/.gitignore | 13 + .../deriv_ui/example/android/app/build.gradle | 67 ++ .../android/app/src/debug/AndroidManifest.xml | 7 + .../android/app/src/main/AndroidManifest.xml | 33 + .../com/example/example/MainActivity.kt | 6 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + .../app/src/main/res/values/styles.xml | 18 + .../app/src/profile/AndroidManifest.xml | 7 + .../deriv_ui/example/android/build.gradle | 31 + .../example/android/gradle.properties | 3 + .../deriv_ui/example/android/settings.gradle | 20 + packages/deriv_ui/example/ios/.gitignore | 34 + .../ios/Flutter/AppFrameworkInfo.plist | 26 + .../example/ios/Flutter/Debug.xcconfig | 2 + .../example/ios/Flutter/Release.xcconfig | 2 + packages/deriv_ui/example/ios/Podfile | 44 ++ .../ios/Runner.xcodeproj/project.pbxproj | 614 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 98 +++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../example/ios/Runner/AppDelegate.swift | 13 + .../AppIcon.appiconset/Contents.json | 122 ++++ .../Icon-App-1024x1024@1x.png | Bin 0 -> 10932 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 295 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 450 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 282 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 462 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 704 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 586 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 1674 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 762 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 1226 bytes .../Icon-App-83.5x83.5@2x.png | Bin 0 -> 1418 bytes .../LaunchImage.imageset/Contents.json | 23 + .../LaunchImage.imageset/LaunchImage.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/README.md | 5 + .../Runner/Base.lproj/LaunchScreen.storyboard | 37 ++ .../ios/Runner/Base.lproj/Main.storyboard | 26 + .../deriv_ui/example/ios/Runner/Info.plist | 49 ++ .../ios/Runner/Runner-Bridging-Header.h | 1 + .../example/ios/RunnerTests/RunnerTests.swift | 12 + .../deriv_ui/example/lib/banner/main.dart | 24 + .../example/lib/date_range_picker/main.dart | 63 ++ .../lib/expandable_bottom_sheet/main.dart | 25 + .../expandable_bottom_sheet/pages/home.dart | 51 ++ packages/deriv_ui/example/pubspec.yaml | 92 +++ packages/deriv_ui/example/web/favicon.png | Bin 0 -> 917 bytes .../deriv_ui/example/web/icons/Icon-192.png | Bin 0 -> 5292 bytes .../deriv_ui/example/web/icons/Icon-512.png | Bin 0 -> 8252 bytes .../example/web/icons/Icon-maskable-192.png | Bin 0 -> 5594 bytes .../example/web/icons/Icon-maskable-512.png | Bin 0 -> 20998 bytes packages/deriv_ui/example/web/index.html | 59 ++ packages/deriv_ui/example/web/manifest.json | 35 + packages/deriv_ui/lib/l10n/app_en.arb | 16 + .../generated/date_range_localizations.dart | 202 ++++++ .../date_range_localizations_en.dart | 45 ++ .../presentation/widgets/banner/banner.dart | 2 + .../widgets/banner/constants.dart | 4 + .../banner/default_collapse_button.dart | 31 + .../widgets/banner/stacked_banner.dart | 379 +++++++++++ .../core/date_input_formatter.dart | 69 ++ .../widgets/date_range_picker/core/debug.dart | 50 ++ .../widgets/date_range_picker/core/enums.dart | 32 + .../date_range_picker/core/extensions.dart | 8 + .../date_range_picker/core/helpers.dart | 102 +++ .../date_range_picker/date_range_picker.dart | 351 ++++++++++ .../deriv_date_range_picker.dart | 14 + .../models/date_range_model.dart | 18 + .../models/input_date_model.dart | 16 + .../widgets/animated_popup.dart | 85 +++ .../widgets/calendar_date_range.dart | 210 ++++++ .../widgets/calendar_keyboard_navigator.dart | 152 +++++ .../widgets/date_range_text_field.dart | 176 +++++ .../date_range_picker/widgets/day_header.dart | 51 ++ .../widgets/focused_date.dart | 22 + .../widgets/highlight_painter.dart | 63 ++ .../widgets/input_date_range.dart | 341 ++++++++++ .../date_range_picker/widgets/month_item.dart | 376 +++++++++++ .../widgets/month_item_grid.dart | 69 ++ .../widgets/month_item_grid_delegate.dart | 22 + .../widgets/selected_date_range.dart | 113 ++++ .../core/utils/device_info.dart | 21 + .../expandable_bottom_sheet_controller.dart | 91 +++ .../deriv_expandable_bottom_sheet.dart | 2 + .../presentation/widgets/custom_tooltip.dart | 93 +++ .../widgets/expandable_bottom_sheet.dart | 381 +++++++++++ .../expandable_bottom_sheet_hint_button.dart | 37 ++ ...expandable_bottom_sheet_lower_content.dart | 23 + .../expandable_bottom_sheet_title.dart | 33 + .../expandable_bottom_sheet_title_bar.dart | 106 +++ .../expandable_bottom_sheet_toggler.dart | 32 + ...expandable_bottom_sheet_upper_content.dart | 54 ++ .../expandable_bottom_sheet_provider.dart | 96 +++ .../lib/presentation/widgets/widgets.dart | 3 + packages/deriv_ui/pubspec.yaml | 4 + .../widgets/banner/stacked_banner_test.dart | 46 ++ .../core/date_input_formatter_test.dart | 45 ++ .../date_range_picker/core/debug_test.dart | 42 ++ .../date_range_picker/core/helper_test.dart | 114 ++++ .../date_range_picker_test.dart | 319 +++++++++ .../core/utils/device_info_test.dart | 25 + ...pandable_bottom_sheet_controller_test.dart | 75 +++ .../deriv_expandable_bottom_sheet_test.dart | 272 ++++++++ ...expandable_bottom_sheet_provider_test.dart | 30 + packages/deriv_ui/test/pump_app.dart | 18 + 132 files changed, 6889 insertions(+), 62 deletions(-) create mode 100644 packages/deriv_ui/example/.gitignore create mode 100644 packages/deriv_ui/example/.metadata create mode 100644 packages/deriv_ui/example/README.md create mode 100644 packages/deriv_ui/example/android/.gitignore create mode 100644 packages/deriv_ui/example/android/app/build.gradle create mode 100644 packages/deriv_ui/example/android/app/src/debug/AndroidManifest.xml create mode 100644 packages/deriv_ui/example/android/app/src/main/AndroidManifest.xml create mode 100644 packages/deriv_ui/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt create mode 100644 packages/deriv_ui/example/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 packages/deriv_ui/example/android/app/src/main/res/drawable/launch_background.xml create mode 100644 packages/deriv_ui/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 packages/deriv_ui/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 packages/deriv_ui/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 packages/deriv_ui/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 packages/deriv_ui/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 packages/deriv_ui/example/android/app/src/main/res/values-night/styles.xml create mode 100644 packages/deriv_ui/example/android/app/src/main/res/values/styles.xml create mode 100644 packages/deriv_ui/example/android/app/src/profile/AndroidManifest.xml create mode 100644 packages/deriv_ui/example/android/build.gradle create mode 100644 packages/deriv_ui/example/android/gradle.properties create mode 100644 packages/deriv_ui/example/android/settings.gradle create mode 100644 packages/deriv_ui/example/ios/.gitignore create mode 100644 packages/deriv_ui/example/ios/Flutter/AppFrameworkInfo.plist create mode 100644 packages/deriv_ui/example/ios/Flutter/Debug.xcconfig create mode 100644 packages/deriv_ui/example/ios/Flutter/Release.xcconfig create mode 100644 packages/deriv_ui/example/ios/Podfile create mode 100644 packages/deriv_ui/example/ios/Runner.xcodeproj/project.pbxproj create mode 100644 packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 packages/deriv_ui/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100644 packages/deriv_ui/example/ios/Runner.xcworkspace/contents.xcworkspacedata create mode 100644 packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 packages/deriv_ui/example/ios/Runner/AppDelegate.swift create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png create mode 100644 packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md create mode 100644 packages/deriv_ui/example/ios/Runner/Base.lproj/LaunchScreen.storyboard create mode 100644 packages/deriv_ui/example/ios/Runner/Base.lproj/Main.storyboard create mode 100644 packages/deriv_ui/example/ios/Runner/Info.plist create mode 100644 packages/deriv_ui/example/ios/Runner/Runner-Bridging-Header.h create mode 100644 packages/deriv_ui/example/ios/RunnerTests/RunnerTests.swift create mode 100644 packages/deriv_ui/example/lib/banner/main.dart create mode 100644 packages/deriv_ui/example/lib/date_range_picker/main.dart create mode 100644 packages/deriv_ui/example/lib/expandable_bottom_sheet/main.dart create mode 100644 packages/deriv_ui/example/lib/expandable_bottom_sheet/pages/home.dart create mode 100644 packages/deriv_ui/example/pubspec.yaml create mode 100644 packages/deriv_ui/example/web/favicon.png create mode 100644 packages/deriv_ui/example/web/icons/Icon-192.png create mode 100644 packages/deriv_ui/example/web/icons/Icon-512.png create mode 100644 packages/deriv_ui/example/web/icons/Icon-maskable-192.png create mode 100644 packages/deriv_ui/example/web/icons/Icon-maskable-512.png create mode 100644 packages/deriv_ui/example/web/index.html create mode 100644 packages/deriv_ui/example/web/manifest.json create mode 100644 packages/deriv_ui/lib/l10n/app_en.arb create mode 100644 packages/deriv_ui/lib/l10n/generated/date_range_localizations.dart create mode 100644 packages/deriv_ui/lib/l10n/generated/date_range_localizations_en.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/banner/banner.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/banner/constants.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/banner/default_collapse_button.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/banner/stacked_banner.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/date_input_formatter.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/debug.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/enums.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/extensions.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/helpers.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/date_range_picker.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/deriv_date_range_picker.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/date_range_model.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/input_date_model.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/animated_popup.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_date_range.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_keyboard_navigator.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/date_range_text_field.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/day_header.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/focused_date.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/highlight_painter.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/input_date_range.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid_delegate.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/selected_date_range.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/device_info.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart create mode 100644 packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/banner/stacked_banner_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/date_range_picker/core/date_input_formatter_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/date_range_picker/core/debug_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/date_range_picker/core/helper_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/date_range_picker/date_range_picker_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/device_info_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart create mode 100644 packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart create mode 100644 packages/deriv_ui/test/pump_app.dart diff --git a/packages/deriv_date_range_picker/example/android/build.gradle b/packages/deriv_date_range_picker/example/android/build.gradle index 58a8c74b1..713d7f6e6 100644 --- a/packages/deriv_date_range_picker/example/android/build.gradle +++ b/packages/deriv_date_range_picker/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/packages/deriv_expandable_bottom_sheet/example/android/build.gradle b/packages/deriv_expandable_bottom_sheet/example/android/build.gradle index 58a8c74b1..713d7f6e6 100644 --- a/packages/deriv_expandable_bottom_sheet/example/android/build.gradle +++ b/packages/deriv_expandable_bottom_sheet/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index 4325fcb20..f6ffee652 100644 --- a/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -17,7 +17,7 @@ public final class GeneratedPluginRegistrant { public static void registerWith(@NonNull FlutterEngine flutterEngine) { try { flutterEngine.getPlugins().add(new com.deriv.deriv_rudderstack.DerivRudderstackPlugin()); - } catch(Exception e) { + } catch (Exception e) { Log.e(TAG, "Error registering plugin deriv_rudderstack, com.deriv.deriv_rudderstack.DerivRudderstackPlugin", e); } } diff --git a/packages/deriv_rudderstack/example/pubspec.lock b/packages/deriv_rudderstack/example/pubspec.lock index 1d8d0ec9e..dc0e49e9a 100644 --- a/packages/deriv_rudderstack/example/pubspec.lock +++ b/packages/deriv_rudderstack/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" deriv_rudderstack: dependency: "direct main" description: @@ -66,30 +66,22 @@ packages: description: flutter source: sdk version: "0.0.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -115,10 +107,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -155,10 +147,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -167,6 +159,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.2" diff --git a/packages/deriv_rudderstack/pubspec.lock b/packages/deriv_rudderstack/pubspec.lock index 9b554c600..4f37adc72 100644 --- a/packages/deriv_rudderstack/pubspec.lock +++ b/packages/deriv_rudderstack/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" fake_async: dependency: transitive description: @@ -59,30 +59,22 @@ packages: description: flutter source: sdk version: "0.0.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -108,10 +100,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -148,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -160,6 +152,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.2" diff --git a/packages/deriv_theme/pubspec.lock b/packages/deriv_theme/pubspec.lock index 9b554c600..4f37adc72 100644 --- a/packages/deriv_theme/pubspec.lock +++ b/packages/deriv_theme/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" fake_async: dependency: transitive description: @@ -59,30 +59,22 @@ packages: description: flutter source: sdk version: "0.0.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -108,10 +100,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -148,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -160,6 +152,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.2" diff --git a/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index e9dfbb328..1c1840926 100644 --- a/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -1,7 +1,7 @@ package io.flutter.plugins; import io.flutter.plugin.common.PluginRegistry; -import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin; +import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin; import io.flutter.plugins.urllauncher.UrlLauncherPlugin; import io.flutter.plugins.webviewflutter.WebViewFlutterPlugin; @@ -13,7 +13,7 @@ public static void registerWith(PluginRegistry registry) { if (alreadyRegisteredWith(registry)) { return; } - InAppWebViewFlutterPlugin.registerWith(registry.registrarFor("com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin")); + InAppWebViewFlutterPlugin.registerWith(registry.registrarFor("com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin")); UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); WebViewFlutterPlugin.registerWith(registry.registrarFor("io.flutter.plugins.webviewflutter.WebViewFlutterPlugin")); } diff --git a/packages/deriv_ui/example/.gitignore b/packages/deriv_ui/example/.gitignore new file mode 100644 index 000000000..24476c5d1 --- /dev/null +++ b/packages/deriv_ui/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/deriv_ui/example/.metadata b/packages/deriv_ui/example/.metadata new file mode 100644 index 000000000..10640d4b5 --- /dev/null +++ b/packages/deriv_ui/example/.metadata @@ -0,0 +1,36 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "2f708eb8396e362e280fac22cf171c2cb467343c" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + - platform: android + create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + - platform: ios + create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + - platform: web + create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/deriv_ui/example/README.md b/packages/deriv_ui/example/README.md new file mode 100644 index 000000000..2b3fce4c8 --- /dev/null +++ b/packages/deriv_ui/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/deriv_ui/example/android/.gitignore b/packages/deriv_ui/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/deriv_ui/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/deriv_ui/example/android/app/build.gradle b/packages/deriv_ui/example/android/app/build.gradle new file mode 100644 index 000000000..ceb79eae5 --- /dev/null +++ b/packages/deriv_ui/example/android/app/build.gradle @@ -0,0 +1,67 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "com.example.example" + compileSdkVersion 34 + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies {} diff --git a/packages/deriv_ui/example/android/app/src/debug/AndroidManifest.xml b/packages/deriv_ui/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/deriv_ui/example/android/app/src/main/AndroidManifest.xml b/packages/deriv_ui/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..19b862ec8 --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/packages/deriv_ui/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/deriv_ui/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 000000000..e793a000d --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/packages/deriv_ui/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/deriv_ui/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/deriv_ui/example/android/app/src/main/res/drawable/launch_background.xml b/packages/deriv_ui/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/deriv_ui/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/deriv_ui/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/deriv_ui/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/deriv_ui/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/deriv_ui/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/android/app/src/main/res/values-night/styles.xml b/packages/deriv_ui/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..06952be74 --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/deriv_ui/example/android/app/src/main/res/values/styles.xml b/packages/deriv_ui/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..cb1ef8805 --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/deriv_ui/example/android/app/src/profile/AndroidManifest.xml b/packages/deriv_ui/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/deriv_ui/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/deriv_ui/example/android/build.gradle b/packages/deriv_ui/example/android/build.gradle new file mode 100644 index 000000000..f7eb7f63c --- /dev/null +++ b/packages/deriv_ui/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/deriv_ui/example/android/gradle.properties b/packages/deriv_ui/example/android/gradle.properties new file mode 100644 index 000000000..94adc3a3f --- /dev/null +++ b/packages/deriv_ui/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/deriv_ui/example/android/settings.gradle b/packages/deriv_ui/example/android/settings.gradle new file mode 100644 index 000000000..55c4ca8b1 --- /dev/null +++ b/packages/deriv_ui/example/android/settings.gradle @@ -0,0 +1,20 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + + plugins { + id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + } +} + +include ":app" + +apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/packages/deriv_ui/example/ios/.gitignore b/packages/deriv_ui/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/deriv_ui/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/deriv_ui/example/ios/Flutter/AppFrameworkInfo.plist b/packages/deriv_ui/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..9625e105d --- /dev/null +++ b/packages/deriv_ui/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/packages/deriv_ui/example/ios/Flutter/Debug.xcconfig b/packages/deriv_ui/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/deriv_ui/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/deriv_ui/example/ios/Flutter/Release.xcconfig b/packages/deriv_ui/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/deriv_ui/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/deriv_ui/example/ios/Podfile b/packages/deriv_ui/example/ios/Podfile new file mode 100644 index 000000000..fdcc671eb --- /dev/null +++ b/packages/deriv_ui/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/deriv_ui/example/ios/Runner.xcodeproj/project.pbxproj b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..75c0e507d --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,614 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807E294A63A400263BE5 /* Frameworks */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1430; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/deriv_ui/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/deriv_ui/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..87131a09b --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_ui/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/deriv_ui/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1d526a16e --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/deriv_ui/example/ios/Runner/AppDelegate.swift b/packages/deriv_ui/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 GIT binary patch literal 10932 zcmeHN2~<R zh`|8`A_PQ1nSu(UMFx?8j8PC!!VDphaL#`F42fd#7Vlc`zIE4n%Y~eiz4y1j|NDpi z?<@|pSJ-HM`qifhf@m%MamgwK83`XpBA<+azdF#2QsT{X@z0A9Bq>~TVErigKH1~P zRX-!h-f0NJ4Mh++{D}J+K>~~rq}d%o%+4dogzXp7RxX4C>Km5XEI|PAFDmo;DFm6G zzjVoB`@qW98Yl0Kvc-9w09^PrsobmG*Eju^=3f?0o-t$U)TL1B3;sZ^!++3&bGZ!o-*6w?;oOhf z=A+Qb$scV5!RbG+&2S}BQ6YH!FKb0``VVX~T$dzzeSZ$&9=X$3)_7Z{SspSYJ!lGE z7yig_41zpQ)%5dr4ff0rh$@ky3-JLRk&DK)NEIHecf9c*?Z1bUB4%pZjQ7hD!A0r-@NF(^WKdr(LXj|=UE7?gBYGgGQV zidf2`ZT@pzXf7}!NH4q(0IMcxsUGDih(0{kRSez&z?CFA0RVXsVFw3^u=^KMtt95q z43q$b*6#uQDLoiCAF_{RFc{!H^moH_cmll#Fc^KXi{9GDl{>%+3qyfOE5;Zq|6#Hb zp^#1G+z^AXfRKaa9HK;%b3Ux~U@q?xg<2DXP%6k!3E)PA<#4$ui8e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;RyKmY{a8G{2BHG%w!^T|Njr!h9TO2LaP^_f22Q1=l$QiU84ao zHe_#{S6;qrC6w~7{y(hs-?-j?lbOfgH^E=XcSgnwW*eEz{_Z<_xN#0001NP)t-s|Ns9~ z#rXRE|M&d=0au&!`~QyF`q}dRnBDt}*!qXo`c{v z{Djr|@Adh0(D_%#_&mM$D6{kE_x{oE{l@J5@%H*?%=t~i_`ufYOPkAEn!pfkr2$fs z652Tz0001XNklqeeKN4RM4i{jKqmiC$?+xN>3Apn^ z0QfuZLym_5b<*QdmkHjHlj811{If)dl(Z2K0A+ekGtrFJb?g|wt#k#pV-#A~bK=OT ts8>{%cPtyC${m|1#B1A6#u!Q;umknL1chzTM$P~L002ovPDHLkV1lTfnu!1a literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..797d452e458972bab9d994556c8305db4c827017 GIT binary patch literal 406 zcmV;H0crk;P))>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed2d933e1120817fe9182483a228007b18ab6ae GIT binary patch literal 450 zcmV;z0X_bSP)iGWQ_5NJQ_~rNh*z)}eT%KUb z`7gNk0#AwF^#0T0?hIa^`~Ck;!}#m+_uT050aTR(J!bU#|IzRL%^UsMS#KsYnTF*!YeDOytlP4VhV?b} z%rz_<=#CPc)tU1MZTq~*2=8~iZ!lSa<{9b@2Jl;?IEV8)=fG217*|@)CCYgFze-x? zIFODUIA>nWKpE+bn~n7;-89sa>#DR>TSlqWk*!2hSN6D~Qb#VqbP~4Fk&m`@1$JGr zXPIdeRE&b2Thd#{MtDK$px*d3-Wx``>!oimf%|A-&-q*6KAH)e$3|6JV%HX{Hig)k suLT-RhftRq8b9;(V=235Wa|I=027H2wCDra;{X5v07*qoM6N<$f;9x^2LJ#7 literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd7b0099ca80c806f8fe495613e8d6c69460d76 GIT binary patch literal 282 zcmV+#0p(^bcu7P-R4C8Q z&e;xxFbF_Vrezo%_kH*OKhshZ6BFpG-Y1e10`QXJKbND7AMQ&cMj60B5TNObaZxYybcN07*qoM6N<$g3m;S%K!iX literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fe730945a01f64a61e2235dbe3f45b08f7729182 GIT binary patch literal 462 zcmV;<0WtoGP)-}iV`2<;=$?g5M=KQbZ{F&YRNy7Nn@%_*5{gvDM0aKI4?ESmw z{NnZg)A0R`+4?NF_RZexyVB&^^ZvN!{I28tr{Vje;QNTz`dG&Jz0~Ek&f2;*Z7>B|cg}xYpxEFY+0YrKLF;^Q+-HreN0P{&i zK~zY`?b7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2c literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..502f463a9bc882b461c96aadf492d1729e49e725 GIT binary patch literal 586 zcmV-Q0=4~#P)+}#`wDE{8-2Mebf5<{{PqV{TgVcv*r8?UZ3{-|G?_}T*&y;@cqf{ z{Q*~+qr%%p!1pS*_Uicl#q9lc(D`!D`LN62sNwq{oYw(Wmhk)k<@f$!$@ng~_5)Ru z0Z)trIA5^j{DIW^c+vT2%lW+2<(RtE2wR;4O@)Tm`Xr*?A(qYoM}7i5Yxw>D(&6ou zxz!_Xr~yNF+waPe00049Nkl*;a!v6h%{rlvIH#gW3s8p;bFr=l}mRqpW2h zw=OA%hdyL~z+UHOzl0eKhEr$YYOL-c-%Y<)=j?(bzDweB7{b+%_ypvm_cG{SvM=DK zhv{K@m>#Bw>2W$eUI#iU)Wdgs8Y3U+A$Gd&{+j)d)BmGKx+43U_!tik_YlN)>$7G! zhkE!s;%oku3;IwG3U^2kw?z+HM)jB{@zFhK8P#KMSytSthr+4!c(5c%+^UBn`0X*2 zy3(k600_CSZj?O$Qu%&$;|TGUJrptR(HzyIx>5E(2r{eA(<6t3e3I0B)7d6s7?Z5J zZ!rtKvA{MiEBm&KFtoifx>5P^Z=vl)95XJn()aS5%ad(s?4-=Tkis9IGu{`Fy8r+H07*qoM6N<$f20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0ec303439225b78712f49115768196d8d76f6790 GIT binary patch literal 862 zcmV-k1EKthP)20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5fea27c705180eb716271f41b582e76dcbd90 GIT binary patch literal 1674 zcmV;526g#~P){YQnis^a@{&-nmRmq)<&%Mztj67_#M}W?l>kYSliK<%xAp;0j{!}J0!o7b zE>q9${Lb$D&h7k=+4=!ek^n+`0zq>LL1O?lVyea53S5x`Nqqo2YyeuIrQrJj9XjOp z{;T5qbj3}&1vg1VK~#9!?b~^C5-}JC@Pyrv-6dSEqJqT}#j9#dJ@GzT@B8}x zU&J@bBI>f6w6en+CeI)3^kC*U?}X%OD8$Fd$H&LV$H&LV$H&LV#|K5~mLYf|VqzOc zkc7qL~0sOYuM{tG`rYEDV{DWY`Z8&)kW*hc2VkBuY+^Yx&92j&StN}Wp=LD zxoGxXw6f&8sB^u})h@b@z0RBeD`K7RMR9deyL(ZJu#39Z>rT)^>v}Khq8U-IbIvT> z?4pV9qGj=2)TNH3d)=De<+^w;>S7m_eFKTvzeaBeir45xY!^m!FmxnljbSS_3o=g( z->^wC9%qkR{kbGnW8MfFew_o9h3(r55Is`L$8KI@d+*%{=Nx+FXJ98L0PjFIu;rGnnfY zn1R5Qnp<{Jq0M1vX=X&F8gtLmcWv$1*M@4ZfF^9``()#hGTeKeP`1!iED ztNE(TN}M5}3Bbc*d=FIv`DNv&@|C6yYj{sSqUj5oo$#*0$7pu|Dd2TLI>t5%I zIa4Dvr(iayb+5x=j*Vum9&irk)xV1`t509lnPO0%skL8_1c#Xbamh(2@f?4yUI zhhuT5<#8RJhGz4%b$`PJwKPAudsm|at?u;*hGgnA zU1;9gnxVBC)wA(BsB`AW54N{|qmikJR*%x0c`{LGsSfa|NK61pYH(r-UQ4_JXd!Rsz)=k zL{GMc5{h138)fF5CzHE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-z1KXab|Ka2oXhX5f% z`$|e!000AhNklrxs)5QTeTVRiEmz~MKK1WAjCw(c-JK6eox;2O)?`? zTG`AHia671e^vgmp!llKp|=5sVHk#C7=~epA~VAf-~%aPC=%Qw01h8mnSZ|p?hz91 z7p83F3%LVu9;S$tSI$C^%^yud1dfTM_6p2|+5Ejp$bd`GDvbR|xit>i!ZD&F>@CJrPmu*UjD&?DfZs=$@e3FQA(vNiU+$A*%a} z?`XcG2jDxJ_ZQ#Md`H{4Lpf6QBDp81_KWZ6Tk#yCy1)32zO#3<7>b`eT7UyYH1eGz z;O(rH$=QR*L%%ZcBpc=eGua?N55nD^K(8<#gl2+pN_j~b2MHs4#mcLmv%DkspS-3< zpI1F=^9siI0s-;IN_IrA;5xm~3?3!StX}pUv0vkxMaqm+zxrg7X7(I&*N~&dEd0kD z-FRV|g=|QuUsuh>-xCI}vD2imzYIOIdcCVV=$Bz@*u0+Bs<|L^)32nN*=wu3n%Ynw z@1|eLG>!8ruU1pFXUfb`j>(=Gy~?Rn4QJ-c3%3T|(Frd!bI`9u&zAnyFYTqlG#&J7 zAkD(jpw|oZLNiA>;>hgp1KX7-wxC~31II47gc zHcehD6Uxlf%+M^^uN5Wc*G%^;>D5qT{>=uxUhX%WJu^Z*(_Wq9y}npFO{Hhb>s6<9 zNi0pHXWFaVZnb)1+RS&F)xOv6&aeILcI)`k#0YE+?e)5&#r7J#c`3Z7x!LpTc01dx zrdC3{Z;joZ^KN&))zB_i)I9fWedoN>Zl-6_Iz+^G&*ak2jpF07*qoM6N<$f;w%0(f|Me literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0467bf12aa4d28f374bb26596605a46dcbb3e7c8 GIT binary patch literal 1418 zcmV;51$Fv~P)q zKfU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K)q>w?p^C6J2ZC!+UppiK6&y3Kmbv&O!oYF z34$0Z;QO!JOY#!`qyGH<3Pd}Pt@q*A0V=3SVtWKRR8d8Z&@)3qLPA19LPA19LPEUC YUoZo%k(ykuW&i*H07*qoM6N<$f+CH{y8r+H literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/deriv_ui/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/deriv_ui/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_ui/example/ios/Runner/Base.lproj/Main.storyboard b/packages/deriv_ui/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/deriv_ui/example/ios/Runner/Info.plist b/packages/deriv_ui/example/ios/Runner/Info.plist new file mode 100644 index 000000000..5458fc418 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/deriv_ui/example/ios/Runner/Runner-Bridging-Header.h b/packages/deriv_ui/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/deriv_ui/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/deriv_ui/example/ios/RunnerTests/RunnerTests.swift b/packages/deriv_ui/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..86a7c3b1b --- /dev/null +++ b/packages/deriv_ui/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/packages/deriv_ui/example/lib/banner/main.dart b/packages/deriv_ui/example/lib/banner/main.dart new file mode 100644 index 000000000..439ea0f52 --- /dev/null +++ b/packages/deriv_ui/example/lib/banner/main.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; + +void main() => runApp(const App()); + +/// Sample app that shows how to use the [DerivBanner] widget. +class App extends StatefulWidget { + /// Initializes a [DerivBanner] widget. + const App({Key? key}) : super(key: key); + + @override + State createState() => _AppState(); +} + +class _AppState extends State { + @override + Widget build(BuildContext context) => MaterialApp( + home: Scaffold( + appBar: AppBar( + elevation: 0, + title: const Text('Plugin example app'), + ), + ), + ); +} diff --git a/packages/deriv_ui/example/lib/date_range_picker/main.dart b/packages/deriv_ui/example/lib/date_range_picker/main.dart new file mode 100644 index 000000000..d4ae2458d --- /dev/null +++ b/packages/deriv_ui/example/lib/date_range_picker/main.dart @@ -0,0 +1,63 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyHomePage()); +} + +class MyHomePage extends StatelessWidget { + const MyHomePage({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return const MaterialApp( + localizationsDelegates: [ + DateRangeLocalizations.delegate, + ], + supportedLocales: DateRangeLocalizations.supportedLocales, + home: DatePickerPage(title: 'Date Picker'), + ); + } +} + +class DatePickerPage extends StatefulWidget { + final String title; + const DatePickerPage({super.key, required this.title}); + + @override + State createState() => _DatePickerPageState(); +} + +class _DatePickerPageState extends State { + DateRangeModel date = DateRangeModel( + startDate: DateTime(2021, 1, 2), endDate: DateTime(2021, 1, 26)); + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: Center( + child: TextButton( + onPressed: () async { + final dateChosen = await showDialog( + context: context, + builder: (_) => DerivDateRangePicker( + context: context, + currentDate: DateTime.now(), + minAllowedDate: DateTime(2021, 1, 1), + maxAllowedDate: DateTime(2021, 12, 31), + initialStartDate: date.startDate, + initialEndDate: date.endDate, + mode: DateRangePickerMode.calendar, + )); + setState(() { + date = dateChosen ?? date; + }); + }, + child: Text('${date.startDate} - ${date.endDate}'), + ), + ), + ); + } +} diff --git a/packages/deriv_ui/example/lib/expandable_bottom_sheet/main.dart b/packages/deriv_ui/example/lib/expandable_bottom_sheet/main.dart new file mode 100644 index 000000000..771fc9fb8 --- /dev/null +++ b/packages/deriv_ui/example/lib/expandable_bottom_sheet/main.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; + +import 'pages/home.dart'; + +void main() { + runApp(const MyApp()); +} + +/// Example application that shows how to use Expandable Bottom Sheet. +class MyApp extends StatelessWidget { + /// This is a const constructor that takes a key. + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) => MaterialApp( + title: 'Expandable Bottom Sheet Demo', + theme: ThemeData( + bottomSheetTheme: BottomSheetThemeData( + // Needed for bottom sheet, otherwise, + // sharp edges and different background color will appear at the top of the sheet. + backgroundColor: Colors.black.withOpacity(0), + ), + ), + home: const Home()); +} diff --git a/packages/deriv_ui/example/lib/expandable_bottom_sheet/pages/home.dart b/packages/deriv_ui/example/lib/expandable_bottom_sheet/pages/home.dart new file mode 100644 index 000000000..3f97bd81a --- /dev/null +++ b/packages/deriv_ui/example/lib/expandable_bottom_sheet/pages/home.dart @@ -0,0 +1,51 @@ +/// This imports the required packages. +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; + +/// This is a home screen widget that displays a button to show the expandable bottom sheet. +class Home extends StatelessWidget { + /// This is a const constructor that takes a key. + const Home({Key? key}) : super(key: key); + + /// This function displays the expandable bottom sheet when the button is clicked. + Future _showExpandableBottomSheet(BuildContext context) => + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext context) => SafeArea( + child: ExpandableBottomSheet( + labelContractDetails: 'Test Label Contract Details', + upperContent: Container( + height: 200, + child: const Text( + 'Example Upper Content', + style: TextStyle(fontSize: 24), + ), + ), + lowerContent: Container( + height: 200, + child: const Text( + 'Example Lower Content', + style: TextStyle(fontSize: 24), + ), + ), + ), + ), + ); + + @override + Widget build(BuildContext context) => Scaffold( + appBar: AppBar( + title: const Text('Expandable Bottom Sheet Demo'), + ), + body: MediaQuery( + data: const MediaQueryData(), + child: Center( + child: ElevatedButton( + child: const Text('Show Expandable Bottom Sheet'), + onPressed: () => _showExpandableBottomSheet(context), + ), + ), + ), + ); +} diff --git a/packages/deriv_ui/example/pubspec.yaml b/packages/deriv_ui/example/pubspec.yaml new file mode 100644 index 000000000..2cadcab53 --- /dev/null +++ b/packages/deriv_ui/example/pubspec.yaml @@ -0,0 +1,92 @@ +name: example +description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=3.1.3 <4.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + deriv_ui: + path: ../ + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + + deriv_lint: + git: + url: git@github.com:regentmarkets/flutter-deriv-packages.git + path: packages/deriv_lint + ref: deriv_lint-v1.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/deriv_ui/example/web/favicon.png b/packages/deriv_ui/example/web/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa46ac1ae21512746f852a42ba87e4165dfdd1 GIT binary patch literal 917 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@P(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1a|PZ!4!3&Gl8 zTYqUsf!gYFyJnXpu0!n&N*SYAX-%d(5gVjrHJWqXQshj@!Zm{!01WsQrH~9=kTxW#6SvuapgMqt>$=j#%eyGrQzr zP{L-3gsMA^$I1&gsBAEL+vxi1*Igl=8#8`5?A-T5=z-sk46WA1IUT)AIZHx1rdUrf zVJrJn<74DDw`j)Ki#gt}mIT-Q`XRa2-jQXQoI%w`nb|XblvzK${ZzlV)m-XcwC(od z71_OEC5Bt9GEXosOXaPTYOia#R4ID2TiU~`zVMl08TV_C%DnU4^+HE>9(CE4D6?Fz oujB08i7adh9xk7*FX66dWH6F5TM;?E2b5PlUHx3vIVCg!0Dx9vYXATM literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/web/icons/Icon-192.png b/packages/deriv_ui/example/web/icons/Icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..b749bfef07473333cf1dd31e9eed89862a5d52aa GIT binary patch literal 5292 zcmZ`-2T+sGz6~)*FVZ`aW+(v>MIm&M-g^@e2u-B-DoB?qO+b1Tq<5uCCv>ESfRum& zp%X;f!~1{tzL__3=gjVJ=j=J>+nMj%ncXj1Q(b|Ckbw{Y0FWpt%4y%$uD=Z*c-x~o zE;IoE;xa#7Ll5nj-e4CuXB&G*IM~D21rCP$*xLXAK8rIMCSHuSu%bL&S3)8YI~vyp@KBu9Ph7R_pvKQ@xv>NQ`dZp(u{Z8K3yOB zn7-AR+d2JkW)KiGx0hosml;+eCXp6+w%@STjFY*CJ?udJ64&{BCbuebcuH;}(($@@ znNlgBA@ZXB)mcl9nbX#F!f_5Z=W>0kh|UVWnf!At4V*LQP%*gPdCXd6P@J4Td;!Ur z<2ZLmwr(NG`u#gDEMP19UcSzRTL@HsK+PnIXbVBT@oHm53DZr?~V(0{rsalAfwgo zEh=GviaqkF;}F_5-yA!1u3!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!+ORD)f$DZFwgKBafEZmeXQMAsq9sxP9A)7zOYnkHT9JU zRA`umgmP9d6=PHmFIgx=0$(sjb>+0CHG)K@cPG{IxaJ&Ueo8)0RWgV9+gO7+Bl1(F z7!BslJ2MP*PWJ;x)QXbR$6jEr5q3 z(3}F@YO_P1NyTdEXRLU6fp?9V2-S=E+YaeLL{Y)W%6`k7$(EW8EZSA*(+;e5@jgD^I zaJQ2|oCM1n!A&-8`;#RDcZyk*+RPkn_r8?Ak@agHiSp*qFNX)&i21HE?yuZ;-C<3C zwJGd1lx5UzViP7sZJ&|LqH*mryb}y|%AOw+v)yc`qM)03qyyrqhX?ub`Cjwx2PrR! z)_z>5*!*$x1=Qa-0uE7jy0z`>|Ni#X+uV|%_81F7)b+nf%iz=`fF4g5UfHS_?PHbr zB;0$bK@=di?f`dS(j{l3-tSCfp~zUuva+=EWxJcRfp(<$@vd(GigM&~vaYZ0c#BTs z3ijkxMl=vw5AS&DcXQ%eeKt!uKvh2l3W?&3=dBHU=Gz?O!40S&&~ei2vg**c$o;i89~6DVns zG>9a*`k5)NI9|?W!@9>rzJ;9EJ=YlJTx1r1BA?H`LWijk(rTax9(OAu;q4_wTj-yj z1%W4GW&K4T=uEGb+E!>W0SD_C0RR91 literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/web/icons/Icon-512.png b/packages/deriv_ui/example/web/icons/Icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfd48dff1169879ba46840804b412fe02fefd6 GIT binary patch literal 8252 zcmd5=2T+s!lYZ%-(h(2@5fr2dC?F^$C=i-}R6$UX8af(!je;W5yC_|HmujSgN*6?W z3knF*TL1$|?oD*=zPbBVex*RUIKsL<(&Rj9%^UD2IK3W?2j>D?eWQgvS-HLymHo9%~|N2Q{~j za?*X-{b9JRowv_*Mh|;*-kPFn>PI;r<#kFaxFqbn?aq|PduQg=2Q;~Qc}#z)_T%x9 zE|0!a70`58wjREmAH38H1)#gof)U3g9FZ^ zF7&-0^Hy{4X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J6q#eu z!RRU`-)HeqGi_UJZ(n~|PSNsv+Wgl{P-TvaUQ9j?ZCtvb^37U$sFpBrkT{7Jpd?HpIvj2!}RIq zH{9~+gErN2+}J`>Jvng2hwM`=PLNkc7pkjblKW|+Fk9rc)G1R>Ww>RC=r-|!m-u7( zc(a$9NG}w#PjWNMS~)o=i~WA&4L(YIW25@AL9+H9!?3Y}sv#MOdY{bb9j>p`{?O(P zIvb`n?_(gP2w3P#&91JX*md+bBEr%xUHMVqfB;(f?OPtMnAZ#rm5q5mh;a2f_si2_ z3oXWB?{NF(JtkAn6F(O{z@b76OIqMC$&oJ_&S|YbFJ*)3qVX_uNf5b8(!vGX19hsG z(OP>RmZp29KH9Ge2kKjKigUmOe^K_!UXP`von)PR8Qz$%=EmOB9xS(ZxE_tnyzo}7 z=6~$~9k0M~v}`w={AeqF?_)9q{m8K#6M{a&(;u;O41j)I$^T?lx5(zlebpY@NT&#N zR+1bB)-1-xj}R8uwqwf=iP1GbxBjneCC%UrSdSxK1vM^i9;bUkS#iRZw2H>rS<2<$ zNT3|sDH>{tXb=zq7XZi*K?#Zsa1h1{h5!Tq_YbKFm_*=A5-<~j63he;4`77!|LBlo zR^~tR3yxcU=gDFbshyF6>o0bdp$qmHS7D}m3;^QZq9kBBU|9$N-~oU?G5;jyFR7>z hN`IR97YZXIo@y!QgFWddJ3|0`sjFx!m))><{BI=FK%f8s literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/web/icons/Icon-maskable-192.png b/packages/deriv_ui/example/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000000000000000000000000000000000000..eb9b4d76e525556d5d89141648c724331630325d GIT binary patch literal 5594 zcmdT|`#%%j|KDb2V@0DPm$^(Lx5}lO%Yv(=e*7hl@QqKS50#~#^IQPxBmuh|i9sXnt4ch@VT0F7% zMtrs@KWIOo+QV@lSs66A>2pz6-`9Jk=0vv&u?)^F@HZ)-6HT=B7LF;rdj zskUyBfbojcX#CS>WrIWo9D=DIwcXM8=I5D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S>6kw9bY z{7vdev7;A}5fy*ZE23DS{J?8at~xwVk`pEwP5^k?XMQ7u64;KmFJ#POzdG#np~F&H ze-BUh@g54)dsS%nkBb}+GuUEKU~pHcYIg4vSo$J(J|U36bs0Use+3A&IMcR%6@jv$ z=+QI+@wW@?iu}Hpyzlvj-EYeop{f65GX0O%>w#0t|V z1-svWk`hU~m`|O$kw5?Yn5UhI%9P-<45A(v0ld1n+%Ziq&TVpBcV9n}L9Tus-TI)f zd_(g+nYCDR@+wYNQm1GwxhUN4tGMLCzDzPqY$~`l<47{+l<{FZ$L6(>J)|}!bi<)| zE35dl{a2)&leQ@LlDxLQOfUDS`;+ZQ4ozrleQwaR-K|@9T{#hB5Z^t#8 zC-d_G;B4;F#8A2EBL58s$zF-=SCr`P#z zNCTnHF&|X@q>SkAoYu>&s9v@zCpv9lLSH-UZzfhJh`EZA{X#%nqw@@aW^vPcfQrlPs(qQxmC|4tp^&sHy!H!2FH5eC{M@g;ElWNzlb-+ zxpfc0m4<}L){4|RZ>KReag2j%Ot_UKkgpJN!7Y_y3;Ssz{9 z!K3isRtaFtQII5^6}cm9RZd5nTp9psk&u1C(BY`(_tolBwzV_@0F*m%3G%Y?2utyS zY`xM0iDRT)yTyYukFeGQ&W@ReM+ADG1xu@ruq&^GK35`+2r}b^V!m1(VgH|QhIPDE X>c!)3PgKfL&lX^$Z>Cpu&6)6jvi^Z! literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/web/icons/Icon-maskable-512.png b/packages/deriv_ui/example/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000000000000000000000000000000000000..d69c56691fbdb0b7efa65097c7cc1edac12a6d3e GIT binary patch literal 20998 zcmeFZ_gj-)&^4Nb2tlbLMU<{!p(#yjqEe+=0IA_oih%ScH9@5#MNp&}Y#;;(h=A0@ zh7{>lT2MkSQ344eAvrhici!td|HJuyvJm#Y_w1Q9Yu3!26dNlO-oxUDK_C#XnW^Co z5C{VN6#{~B0)K2j7}*1Xq(Nqemv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-#m;QC*&6vkp&8699G3)Bq0*kFZXINw=b9OVaed(3(3kS|IZ)CM? zJdnW&%t8MveBuK21uiYj)_a{Fnw0OErMzMN?d$QoPwkhOwcP&p+t>P)4tHlYw-pPN z^oJ=uc$Sl>pv@fZH~ZqxSvdhF@F1s=oZawpr^-#l{IIOGG=T%QXjtwPhIg-F@k@uIlr?J->Ia zpEUQ*=4g|XYn4Gez&aHr*;t$u3oODPmc2Ku)2Og|xjc%w;q!Zz+zY)*3{7V8bK4;& zYV82FZ+8?v)`J|G1w4I0fWdKg|2b#iaazCv;|?(W-q}$o&Y}Q5d@BRk^jL7#{kbCK zSgkyu;=DV+or2)AxCBgq-nj5=@n^`%T#V+xBGEkW4lCqrE)LMv#f;AvD__cQ@Eg3`~x| zW+h9mofSXCq5|M)9|ez(#X?-sxB%Go8};sJ?2abp(Y!lyi>k)|{M*Z$c{e1-K4ky` MPgg&ebxsLQ025IeI{*Lx literal 0 HcmV?d00001 diff --git a/packages/deriv_ui/example/web/index.html b/packages/deriv_ui/example/web/index.html new file mode 100644 index 000000000..45cf2ca30 --- /dev/null +++ b/packages/deriv_ui/example/web/index.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + + + + + diff --git a/packages/deriv_ui/example/web/manifest.json b/packages/deriv_ui/example/web/manifest.json new file mode 100644 index 000000000..096edf8fe --- /dev/null +++ b/packages/deriv_ui/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/packages/deriv_ui/lib/l10n/app_en.arb b/packages/deriv_ui/lib/l10n/app_en.arb new file mode 100644 index 000000000..fe4898fc5 --- /dev/null +++ b/packages/deriv_ui/lib/l10n/app_en.arb @@ -0,0 +1,16 @@ +{ + "@@locale": "en", + "labelStartDate": "Start Date", + "labelEndDate": "End Date", + "labelSelectedDateRange": "Selected Date Range", + "labelActionCancel": "Cancel", + "labelActionOk": "OK", + "labelSemanticEditIcon": "Edit", + "labelEdit": "Edit", + "labelSemanticConfirm": "Confirm", + "labelConfirm": "Confirm", + "labelSemanticCalendar": "Calendar", + "labelCalendar": "Calendar", + "labelSemanticClose": "Close", + "labelClose": "Close" +} diff --git a/packages/deriv_ui/lib/l10n/generated/date_range_localizations.dart b/packages/deriv_ui/lib/l10n/generated/date_range_localizations.dart new file mode 100644 index 000000000..3a85c4b4f --- /dev/null +++ b/packages/deriv_ui/lib/l10n/generated/date_range_localizations.dart @@ -0,0 +1,202 @@ +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:intl/intl.dart' as intl; + +import 'date_range_localizations_en.dart'; + +/// Callers can lookup localized strings with an instance of DateRangeLocalizations +/// returned by `DateRangeLocalizations.of(context)`. +/// +/// Applications need to include `DateRangeLocalizations.delegate()` in their app's +/// `localizationDelegates` list, and the locales they support in the app's +/// `supportedLocales` list. For example: +/// +/// ```dart +/// import 'generated/date_range_localizations.dart'; +/// +/// return MaterialApp( +/// localizationsDelegates: DateRangeLocalizations.localizationsDelegates, +/// supportedLocales: DateRangeLocalizations.supportedLocales, +/// home: MyApplicationHome(), +/// ); +/// ``` +/// +/// ## Update pubspec.yaml +/// +/// Please make sure to update your pubspec.yaml to include the following +/// packages: +/// +/// ```yaml +/// dependencies: +/// # Internationalization support. +/// flutter_localizations: +/// sdk: flutter +/// intl: any # Use the pinned version from flutter_localizations +/// +/// # Rest of dependencies +/// ``` +/// +/// ## iOS Applications +/// +/// iOS applications define key application metadata, including supported +/// locales, in an Info.plist file that is built into the application bundle. +/// To configure the locales supported by your app, you’ll need to edit this +/// file. +/// +/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file. +/// Then, in the Project Navigator, open the Info.plist file under the Runner +/// project’s Runner folder. +/// +/// Next, select the Information Property List item, select Add Item from the +/// Editor menu, then select Localizations from the pop-up menu. +/// +/// Select and expand the newly-created Localizations item then, for each +/// locale your application supports, add a new item and select the locale +/// you wish to add from the pop-up menu in the Value field. This list should +/// be consistent with the languages listed in the DateRangeLocalizations.supportedLocales +/// property. +abstract class DateRangeLocalizations { + DateRangeLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + + final String localeName; + + static DateRangeLocalizations of(BuildContext context) { + return Localizations.of(context, DateRangeLocalizations)!; + } + + static const LocalizationsDelegate delegate = _DateRangeLocalizationsDelegate(); + + /// A list of this localizations delegate along with the default localizations + /// delegates. + /// + /// Returns a list of localizations delegates containing this delegate along with + /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, + /// and GlobalWidgetsLocalizations.delegate. + /// + /// Additional delegates can be added by appending to this list in + /// MaterialApp. This list does not have to be used at all if a custom list + /// of delegates is preferred or required. + static const List> localizationsDelegates = >[ + delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; + + /// A list of this localizations delegate's supported locales. + static const List supportedLocales = [ + Locale('en') + ]; + + /// No description provided for @labelStartDate. + /// + /// In en, this message translates to: + /// **'Start Date'** + String get labelStartDate; + + /// No description provided for @labelEndDate. + /// + /// In en, this message translates to: + /// **'End Date'** + String get labelEndDate; + + /// No description provided for @labelSelectedDateRange. + /// + /// In en, this message translates to: + /// **'Selected Date Range'** + String get labelSelectedDateRange; + + /// No description provided for @labelActionCancel. + /// + /// In en, this message translates to: + /// **'Cancel'** + String get labelActionCancel; + + /// No description provided for @labelActionOk. + /// + /// In en, this message translates to: + /// **'OK'** + String get labelActionOk; + + /// No description provided for @labelSemanticEditIcon. + /// + /// In en, this message translates to: + /// **'Edit'** + String get labelSemanticEditIcon; + + /// No description provided for @labelEdit. + /// + /// In en, this message translates to: + /// **'Edit'** + String get labelEdit; + + /// No description provided for @labelSemanticConfirm. + /// + /// In en, this message translates to: + /// **'Confirm'** + String get labelSemanticConfirm; + + /// No description provided for @labelConfirm. + /// + /// In en, this message translates to: + /// **'Confirm'** + String get labelConfirm; + + /// No description provided for @labelSemanticCalendar. + /// + /// In en, this message translates to: + /// **'Calendar'** + String get labelSemanticCalendar; + + /// No description provided for @labelCalendar. + /// + /// In en, this message translates to: + /// **'Calendar'** + String get labelCalendar; + + /// No description provided for @labelSemanticClose. + /// + /// In en, this message translates to: + /// **'Close'** + String get labelSemanticClose; + + /// No description provided for @labelClose. + /// + /// In en, this message translates to: + /// **'Close'** + String get labelClose; +} + +class _DateRangeLocalizationsDelegate extends LocalizationsDelegate { + const _DateRangeLocalizationsDelegate(); + + @override + Future load(Locale locale) { + return SynchronousFuture(lookupDateRangeLocalizations(locale)); + } + + @override + bool isSupported(Locale locale) => ['en'].contains(locale.languageCode); + + @override + bool shouldReload(_DateRangeLocalizationsDelegate old) => false; +} + +DateRangeLocalizations lookupDateRangeLocalizations(Locale locale) { + + + // Lookup logic when only language code is specified. + switch (locale.languageCode) { + case 'en': return DateRangeLocalizationsEn(); + } + + throw FlutterError( + 'DateRangeLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.' + ); +} diff --git a/packages/deriv_ui/lib/l10n/generated/date_range_localizations_en.dart b/packages/deriv_ui/lib/l10n/generated/date_range_localizations_en.dart new file mode 100644 index 000000000..dba106e01 --- /dev/null +++ b/packages/deriv_ui/lib/l10n/generated/date_range_localizations_en.dart @@ -0,0 +1,45 @@ +import 'date_range_localizations.dart'; + +/// The translations for English (`en`). +class DateRangeLocalizationsEn extends DateRangeLocalizations { + DateRangeLocalizationsEn([String locale = 'en']) : super(locale); + + @override + String get labelStartDate => 'Start Date'; + + @override + String get labelEndDate => 'End Date'; + + @override + String get labelSelectedDateRange => 'Selected Date Range'; + + @override + String get labelActionCancel => 'Cancel'; + + @override + String get labelActionOk => 'OK'; + + @override + String get labelSemanticEditIcon => 'Edit'; + + @override + String get labelEdit => 'Edit'; + + @override + String get labelSemanticConfirm => 'Confirm'; + + @override + String get labelConfirm => 'Confirm'; + + @override + String get labelSemanticCalendar => 'Calendar'; + + @override + String get labelCalendar => 'Calendar'; + + @override + String get labelSemanticClose => 'Close'; + + @override + String get labelClose => 'Close'; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/banner.dart b/packages/deriv_ui/lib/presentation/widgets/banner/banner.dart new file mode 100644 index 000000000..870f5c74e --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/banner/banner.dart @@ -0,0 +1,2 @@ +export 'constants.dart'; +export 'stacked_banner.dart'; diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/constants.dart b/packages/deriv_ui/lib/presentation/widgets/banner/constants.dart new file mode 100644 index 000000000..a8d95d12b --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/banner/constants.dart @@ -0,0 +1,4 @@ +import 'package:flutter/widgets.dart'; + +/// The default background color of the collapse button of [StackedBanner]. +const Color bannerButtonColor = Color.fromRGBO(255, 255, 255, 0.08); diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/default_collapse_button.dart b/packages/deriv_ui/lib/presentation/widgets/banner/default_collapse_button.dart new file mode 100644 index 000000000..ed28e88a2 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/banner/default_collapse_button.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +import 'constants.dart'; + +/// The default collapse button which is shown in the bottom of stacked banner +/// list when it's expanded. +class DefaultCollapseButton extends StatelessWidget { + /// Initializes [DefaultCollapseButton]. + const DefaultCollapseButton({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: const Color(0xFF0E0E0E), + ), + margin: const EdgeInsets.symmetric(horizontal: 8), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: bannerButtonColor, + ), + alignment: Alignment.center, + height: 32, + child: const Text( + 'SHOW LESS', + style: TextStyle(fontWeight: FontWeight.w500), + ), + ), + ); +} diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/stacked_banner.dart b/packages/deriv_ui/lib/presentation/widgets/banner/stacked_banner.dart new file mode 100644 index 000000000..39122c575 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/banner/stacked_banner.dart @@ -0,0 +1,379 @@ +import 'package:flutter/material.dart'; + +import 'default_collapse_button.dart'; + +/// Add item to stacked banner callback. +typedef OnAddRemoveBannerItem = Function(Widget); + +/// Trade banner controller. +class StackedBannerController { + /// Adds an item to the stacked banner. + void addItem(Widget item) => _onAddItem?.call(item); + OnAddRemoveBannerItem? _onAddItem; + + /// Removes an item to the stacked banner. + void removeItem(Widget item) => _onRemoveItem?.call(item); + OnAddRemoveBannerItem? _onRemoveItem; + + /// Collapse banner. + void removeAllBanners() => _onRemoveAllBanners?.call(); + VoidCallback? _onRemoveAllBanners; + + /// Expands banner. + void expandBanner() => _onExpandBanner?.call(); + VoidCallback? _onExpandBanner; + + /// Collapse banner. + void collapseBanner() => _onCollapseBanner?.call(); + VoidCallback? _onCollapseBanner; +} + +/// A widget that handles items that is passed to it, and can show them in two +/// collapsed (stacked on top of each other) and expaned mode. +/// +/// This widget can be added to [Overlay] and once it's added it can be +/// controllered by the [StackedBannerController] instance that is passed to it. +/// To add items or expand/collapse. e.g: +/// +/// Overlay.of(context)!.insert( +/// OverlayEntry( +/// builder: (_) => StackedBanner( +/// controller: bannerController, +/// ), +/// ), +/// ); +/// +/// and for adding banner items to it: +/// bannerController.addItem(newItem); +/// +class StackedBanner extends StatefulWidget { + /// Initializes the class. + const StackedBanner({ + required this.controller, + this.topPadding = 0, + this.isExpanded, + this.maxCollapsedItems = 3, + this.collapseButtonBuilder, + this.bannerHeight = 64, + this.bannerVerticalPadding = 8, + this.bannerHorizontalPadding = 4, + this.onDismissed, + this.animationDuration = const Duration(milliseconds: 250), + this.maxBannersCount = 5, + }) : assert(maxBannersCount > 0), + assert(maxBannersCount >= maxCollapsedItems); + + /// The top padding for the stacked banner. + final double topPadding; + + /// The callback triggered when the list of banner items is either expanded or collapsed. + final Function({required bool isExpanded})? isExpanded; + + /// Will be called when banners are dismissed. + final VoidCallback? onDismissed; + + /// Stacked banner controller. + final StackedBannerController controller; + + /// Max number of items to show when the banner is in collapsed mode. + final int maxCollapsedItems; + + /// Maximum number of banners. + /// + /// Default is 5. means that if there are 5 banners, and a new banner is added + /// the oldest one will be removed. + final int maxBannersCount; + + /// The builder method to get the widget of the item that is shown at the end + /// of stacked banner list and clicking on it collapses the list. + final WidgetBuilder? collapseButtonBuilder; + + /// Banner item's height. + /// + /// it's more optimized to all banner items have a specific and the same + /// height comparing to having different heights and [StackedBanner] widget + /// having to calculate it for each item. + final double bannerHeight; + + /// Banner vertical padding. + final double bannerVerticalPadding; + + /// Banner horizontal padding. + final double bannerHorizontalPadding; + + /// The duration for sliding/collapsing/expanding animtions of banner itesm. + final Duration animationDuration; + + @override + _StackedBannerState createState() => _StackedBannerState(); +} + +class _StackedBannerState extends State + with TickerProviderStateMixin { + int _stackIndex = 0; + + late final AnimationController _slidingController; + late final AnimationController _listExpansionController; + late final AnimationController _dismissAnimationController; + + late final Animation _lastCardTopOffsetValue; + + final List _bannerItems = []; + + final GlobalKey _collapsedItemsKey = GlobalKey(); + + Size? _collapsedSize; + + /// Minimum number of visible banner items when the banner is expanded. + /// + /// When there are less items than this, the banner should be collapsed. + static const int _minExpandedItems = 2; + + // This method should get called everytime the banners list is updated. + void _onBannerListUpdated() { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (_bannerItems.length < _minExpandedItems) { + _collapseList(); + } + }); + } + + @override + void initState() { + super.initState(); + + _assignControllerValues(); + + _setupAnimationControllers(); + + WidgetsBinding.instance.addPostFrameCallback((_) { + _collapsedSize = + (_collapsedItemsKey.currentContext!.findRenderObject() as RenderBox) + .size; + }); + } + + void _setupAnimationControllers() { + _slidingController = AnimationController( + vsync: this, + duration: widget.animationDuration, + )..addListener(() => setState(() {})); + + _listExpansionController = AnimationController( + vsync: this, + duration: widget.animationDuration, + )..addListener(() => setState(() {})); + + _dismissAnimationController = AnimationController( + vsync: this, + duration: widget.animationDuration, + )..addListener(() => setState(() {})); + + _lastCardTopOffsetValue = Tween( + begin: -100, + end: widget.topPadding, + ).animate( + CurvedAnimation(parent: _slidingController, curve: Curves.easeIn), + ); + } + + void _assignControllerValues() { + widget.controller._onAddItem = (Widget item) async { + _bannerItems.add(item); + + if (_dismissAnimationController.status == AnimationStatus.dismissed) { + // When stacked banner is not dismissed yet. normal newItemAnimation + await newItemAnimation(); + } else { + await _dismissAnimationController.reverse(from: 1); + } + _onBannerListUpdated(); + }; + + widget.controller._onRemoveItem = (Widget item) { + setState(() => _bannerItems.remove(item)); + _onBannerListUpdated(); + }; + + widget.controller._onRemoveAllBanners = () { + setState(() => _bannerItems.clear()); + _onBannerListUpdated(); + }; + + widget.controller._onExpandBanner = _expandStack; + + widget.controller._onCollapseBanner = _collapseList; + } + + @override + Widget build(BuildContext context) => SafeArea( + child: IndexedStack( + index: _stackIndex, + children: [ + GestureDetector( + onTap: _expandStack, + onVerticalDragUpdate: _updateBannerDismissHeight, + onVerticalDragEnd: _dismissOrFlingBack, + child: Container( + key: _collapsedItemsKey, + child: _buildStackedView(MediaQuery.of(context).size), + ), + ), + _buildExpandedView(), + ], + ), + ); + + Widget _buildStackedView(Size screenSize) => Stack( + children: [ + ...List.generate( + _bannerItems.length, + (int index) => _buildStackItem( + _bannerItems[index], + index, + screenSize, + ), + ), + ], + ); + + Widget _buildExpandedView() => ListView.separated( + padding: EdgeInsets.only(top: widget.topPadding), + reverse: true, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + if (index == 0) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: GestureDetector( + onTap: _collapseList, + child: widget.collapseButtonBuilder?.call(context) ?? + const DefaultCollapseButton(), + ), + ); + } + + return _bannerItems[index - 1]; + }, + separatorBuilder: (_, __) => const SizedBox(height: 8), + itemCount: _bannerItems.length + 1, + ); + + Widget _buildStackItem(Widget child, int index, Size screenSize) { + final double horizontalOffset = _getHorizontalOffset(index); + + return AnimatedPositioned( + child: child, + duration: widget.animationDuration, + top: _getTopOffset(index) - + (_dismissAnimationController.value * screenSize.height), + left: horizontalOffset, + right: horizontalOffset, + ); + } + + void _updateBannerDismissHeight(DragUpdateDetails details) { + final double movePercent = details.delta.dy / _collapsedSize!.height; + _dismissAnimationController.value = + _dismissAnimationController.value - movePercent; + } + + Future _dismissOrFlingBack(DragEndDetails details) async { + if (_dismissAnimationController.value > 0.05) { + await _dismissAnimationController.forward( + from: _dismissAnimationController.value, + ); + + widget.onDismissed?.call(); + } else { + await _dismissAnimationController.reverse( + from: _dismissAnimationController.value, + ); + } + } + + Future _expandStack() async { + _removeExtraBanners(); + + if (_bannerItems.length < _minExpandedItems) { + return; + } + + await _listExpansionController.forward(); + await Future.delayed(widget.animationDuration); + + setState(() => _stackIndex = 1); + + widget.isExpanded?.call(isExpanded: true); + } + + void _removeExtraBanners() { + if (_bannerItems.length > widget.maxBannersCount) { + _bannerItems.removeRange(0, _bannerItems.length - widget.maxBannersCount); + } + } + + Future _collapseList() async { + _stackIndex = 0; + + await _listExpansionController.reverse(); + widget.isExpanded?.call(isExpanded: false); + } + + double _getTopOffset(int index) { + if (_listExpansionController.isAnimating || + _listExpansionController.isCompleted) { + return widget.topPadding + + (_topBannerIndex - index) * + (widget.bannerHeight + widget.bannerVerticalPadding); + } + + final bool itemsExceedsMaxCollapsed = + _bannerItems.length > widget.maxCollapsedItems && + index < _bannerItems.length - widget.maxCollapsedItems; + + final int virtualIndex = itemsExceedsMaxCollapsed + ? _bannerItems.length - widget.maxCollapsedItems + : index; + + if (virtualIndex == _topBannerIndex && _slidingController.isAnimating) { + return _lastCardTopOffsetValue.value; + } else { + if (virtualIndex == _bannerItems.length - 1) { + return widget.topPadding; + } else { + return widget.topPadding + + (_topBannerIndex - virtualIndex) * widget.bannerVerticalPadding; + } + } + } + + double _getHorizontalOffset(int index) { + if (_listExpansionController.isAnimating || + _listExpansionController.isCompleted || + index == _topBannerIndex) { + return 0; + } else { + return (_bannerItems.length - index) * widget.bannerHorizontalPadding; + } + } + + Future newItemAnimation() async { + if (_slidingController.isCompleted) { + _slidingController.reset(); + } + + await _slidingController.forward(); + } + + int get _topBannerIndex => _bannerItems.length - 1; + + @override + void dispose() { + _slidingController.dispose(); + _listExpansionController.dispose(); + _dismissAnimationController.dispose(); + + super.dispose(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/date_input_formatter.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/date_input_formatter.dart new file mode 100644 index 000000000..3e786e790 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/date_input_formatter.dart @@ -0,0 +1,69 @@ +import 'dart:math'; + +import 'package:flutter/services.dart'; + +/// Creates a [TextInputFormatter] that formats text as a hyphened date. +class DateInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, + TextEditingValue newValue, + ) { + final String hyphenedDate = _getHyphenedDate(newValue.text, oldValue.text); + + return newValue.copyWith( + text: hyphenedDate, + selection: TextSelection.fromPosition( + _getUpdatedCursorPosition( + oldValue, + hyphenedDate, + ), + )); + } + + /// Converts the input to hyphened date format. + /// Example: 01012021 -> 01-01-2021 + String _getHyphenedDate(String newValue, String oldValue) { + const String _separator = '-'; + const int _maxChars = 10; + + final bool _isErasing = newValue.length < oldValue.length; + final bool _isComplete = newValue.length > _maxChars; + + if (!_isErasing && _isComplete) { + return oldValue; + } + + final String numericValue = _removeNonNumericChar(newValue); + final List result = []; + + for (int i = 0; i < numericValue.length; i++) { + result.add(numericValue[i]); + + if ((i == 1 || i == 3) && i != numericValue.length - 1) { + result.add(_separator); + } + } + + return result.join(); + } + + /// Removes all non-numeric characters from the input. + String _removeNonNumericChar(String input) => + input.replaceAll(RegExp(r'[^0-9]+'), ''); + + /// Calculates the updated cursor position based on the changes made during formatting. + TextPosition _getUpdatedCursorPosition( + TextEditingValue oldValue, + String text, + ) { + final int endOffset = max( + oldValue.text.length - oldValue.selection.end, + 0, + ); + + final int selectionEnd = text.length - endOffset; + + return TextPosition(offset: selectionEnd); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/debug.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/debug.dart new file mode 100644 index 000000000..272e31a88 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/debug.dart @@ -0,0 +1,50 @@ +import 'package:deriv_ui/l10n/generated/date_range_localizations.dart'; +import 'package:flutter/material.dart'; + +/// Asserts that the given context has a [Localizations] ancestor that contains +/// a [DateRangeLocalizations] delegate. +/// +/// Used to make sure that they are +/// only used in contexts where they have access to localizations. +/// +/// To call this function, use the following pattern, typically in the +/// relevant Widget's build method: +/// +/// ```dart +/// assert(debugCheckHasDateRangeLocalizations(context)); +/// ``` +/// +/// Always place this before any early returns, so that the invariant is checked +/// in all cases. This prevents bugs from hiding until a particular codepath is +/// hit. +/// +/// This function has the side-effect of establishing an inheritance +/// relationship with the nearest [Localizations] widget (see +/// [BuildContext.dependOnInheritedWidgetOfExactType]). This is ok if the caller +/// always also calls [Localizations.of] or [Localizations.localeOf]. +/// +/// Does nothing if asserts are disabled. Always returns true. +bool debugCheckHasDateRangeLocalizations(BuildContext context) { + assert(() { + if (Localizations.of( + context, DateRangeLocalizations) == + null) { + throw FlutterError.fromParts([ + ErrorSummary('No DateRangeLocalizations found.'), + ErrorDescription( + '${context.widget.runtimeType} widgets require DateRangeLocalizations ' + 'to be provided by a Localizations widget ancestor.', + ), + ErrorHint( + 'To introduce a DateRangeLocalizations, ' + 'add a Localization widget with a ' + 'DateRangeLocalizations delegate.', + ), + ...context.describeMissingAncestor( + expectedAncestorType: DateRangeLocalizations), + ]); + } + return true; + }()); + return true; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/enums.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/enums.dart new file mode 100644 index 000000000..3acc95225 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/enums.dart @@ -0,0 +1,32 @@ +/// Date range Picker mode to determine if range picker starts in calendar or input mode. +enum DateRangePickerMode { + /// Calendar mode. + calendar, + + /// Input mode. + input, +} + +/// Enum for date range picker days. +enum DaysItemEnum { + /// Sun. + sun, + + /// Mon. + mon, + + /// Tue. + tue, + + /// Wed. + wed, + + /// Thu. + thu, + + /// Fri. + fri, + + /// Sat. + sat, +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/extensions.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/extensions.dart new file mode 100644 index 000000000..52cadfbf8 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/extensions.dart @@ -0,0 +1,8 @@ +import 'package:deriv_ui/l10n/generated/date_range_localizations.dart'; +import 'package:flutter/material.dart'; + +/// Extension for [BuildContext] to get localization. +extension ContextExtension on BuildContext { + /// Get localization. + DateRangeLocalizations? get localization => DateRangeLocalizations.of(this); +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/helpers.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/helpers.dart new file mode 100644 index 000000000..59100f044 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/helpers.dart @@ -0,0 +1,102 @@ +import '../models/input_date_model.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +/// Returns a [DateTime] with just the date of the original, but no time set. +DateTime getDateFromDateTime(DateTime date) => + DateTime(date.year, date.month, date.day); + +/// Returns true if the two [DateTime] objects have the same day, month, and year, or are both null. +bool isSameDay({required DateTime? firstDate, required DateTime? secondDate}) => + firstDate?.year == secondDate?.year && + firstDate?.month == secondDate?.month && + firstDate?.day == secondDate?.day; + +/// Returns true if the two [DateTime] objects have the same month, and year, or are both null. +bool isSameMonth({ + required DateTime? firstDate, + required DateTime? secondDate, +}) => + firstDate?.year == secondDate?.year && + firstDate?.month == secondDate?.month; + +/// Determines the number of months between two [DateTime] objects. +int monthDelta({required DateTime startDate, required DateTime endDate}) => + (endDate.year - startDate.year) * 12 + endDate.month - startDate.month; + +/// Returns a [DateTime] with the added number of months and truncates any day and time information. +DateTime addMonthsToMonthDate({ + required DateTime monthDate, + required int monthsToAdd, +}) => + DateTime(monthDate.year, monthDate.month + monthsToAdd); + +/// Returns a [DateTime] with the added number of days and no time set. +DateTime addDaysToDate({required DateTime date, required int days}) => + DateTime(date.year, date.month, date.day + days); + +/// Computes the offset from the first day of the week that the first day of the [month] falls on. +int firstDayOffset({ + required int year, + required int month, + required MaterialLocalizations localizations, +}) { + final int weekdayFromMonday = DateTime(year, month).weekday - 1; + final int firstDayOfWeekIndex = (localizations.firstDayOfWeekIndex - 1) % 7; + + return (weekdayFromMonday - firstDayOfWeekIndex) % 7; +} + +/// Returns the number of days in a month, according to the proleptic Gregorian calendar. +int getDaysInMonth({ + required int year, + required int month, +}) { + if (month == DateTime.february) { + final bool isLeapYear = + (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0); + + return isLeapYear ? 29 : 28; + } + + const List daysInMonth = [ + 31, + -1, + 31, + 30, + 31, + 30, + 31, + 31, + 30, + 31, + 30, + 31 + ]; + + return daysInMonth[month - 1]; +} + +/// Pareses a String to DateTime. Returns an instance of [InputDateModel]. +InputDateModel parseDate({ + required String? date, + String dateFormat = 'dd-MM-yyyy', +}) { + if (date == null || date.isEmpty) { + return InputDateModel(); + } + + try { + final List dateList = date.split('-'); + + if (dateList.length == 3 && dateList[2].length != 4) { + return InputDateModel(isValidOrNull: false); + } + + return InputDateModel( + dateTime: DateFormat(dateFormat).parseStrict(date), + ); + } on Exception catch (_) { + return InputDateModel(isValidOrNull: false); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/date_range_picker.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/date_range_picker.dart new file mode 100644 index 000000000..bddde68db --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/date_range_picker.dart @@ -0,0 +1,351 @@ +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:deriv_ui/deriv_ui.dart'; + +/// {@template date_range_picker} +/// Deriv Theme based date range picker. +/// +/// When the date picker is first displayed, it will show the month of +/// [initialStartDate], with [initialStartDate] to [initialEndDate] selected. +/// +/// The [minAllowedDate] is the earliest allowable date. The [maxAllowedDate] is the latest +/// allowable date. [initialStartDate] and [initialEndDate] must either fall between these dates, +/// or be equal to one of them. For each of these [DateTime] parameters, only +/// their dates are considered. Their time fields are ignored. They must all +/// be non-null. +/// +/// The [currentDate] represents the current day (i.e. today). This +/// date will be highlighted in the day grid. If null, the date of +/// `DateTime.now()` will be used. +/// +/// The [context], [useRootNavigator] and [routeSettings] arguments are passed to +/// [showDialog], the documentation for which discusses how it is used. [context] +/// and [useRootNavigator] must be non-null. +/// +/// The following optional string parameters allow you to override the default +/// text used for various parts of the dialog: +/// +/// * [cancelText], label on the cancel button. +/// * [confirmText], label on the ok button. +/// * [fieldStartLabelText], label for the start date text input field. +/// * [fieldEndLabelText], label for the end date text input field. +/// * [labelSelectedDateRange], label for the selected date range. +/// * [semanticLabelEditIcon], semantic label for the edit icon. +/// * [semanticLabelClose], semantic label for the close icon. +/// * [semanticLabelConfirm], semantic label for the confirm icon. +/// * [semanticLabelCalendar], semantic label for the calendar icon. +/// * [toolTipEdit], tooltip for the edit icon. +/// * [toolTipClose], tooltip for the close icon. +/// * [toolTipConfirm], tooltip for the confirm icon. +/// * [toolTipCalendar], tooltip for the calendar icon. + +/// For example: +/// ```dart +/// showDialog( +/// context: context, +/// builder: (context) => DerivDateRangePicker( +/// currentDate: DateTime.now(), +/// minAllowedDate: DateTime(2021, 1, 1), +/// maxAllowedDate: DateTime(2021, 12, 31), +/// initialStartDate: DateTime(2021, 1, 1), +/// initialEndDate: DateTime(2021, 1, 28), +/// mode: DateRangPickerMode.calendar, +/// )); +/// +/// ``` +/// +/// This will open a dialog with a calendar view. Once the user selects a date range and +/// closes the dialog, [DateRangeModel] will be returned through which you can access the `startDate` and `endDate` +/// of the range. +/// +/// {@endtemplate} +class DerivDateRangePicker extends StatefulWidget { + ///{@macro date_range_picker} + DerivDateRangePicker({ + required BuildContext context, + required this.minAllowedDate, + required this.maxAllowedDate, + this.labelSelectedDateRange, + this.currentDate, + this.cancelText, + this.confirmText, + this.semanticLabelEditIcon, + this.semanticLabelClose, + this.initialStartDate, + this.initialEndDate, + this.mode = DateRangePickerMode.calendar, + this.toolTipEdit, + this.toolTipClose, + this.semanticLabelConfirm, + this.toolTipConfirm, + this.fieldStartLabelText, + this.fieldEndLabelText, + this.semanticLabelCalendar, + this.toolTipCalendar, + Key? key, + }) : assert(minAllowedDate.isBefore(maxAllowedDate)), + assert( + initialEndDate == null || initialEndDate.isBefore(maxAllowedDate)), + assert(initialStartDate == null || + initialEndDate == null || + initialStartDate.isBefore(initialEndDate)), + assert(debugCheckHasDateRangeLocalizations(context)), + super(key: key); + + /// The [DateTime] representing today. It will be highlighted in the day grid. + final DateTime? currentDate; + + /// The earliest allowed [DateTime] that the user can select. + final DateTime minAllowedDate; + + /// The latest allowed [DateTime] that the user can select. + final DateTime maxAllowedDate; + + /// The [DateTime] that represents the start of the initial date range selection. + final DateTime? initialStartDate; + + /// The [DateTime] that represents the end of the initial date range selection. + final DateTime? initialEndDate; + + /// Date range Picker mode determine range picker starts in calendar or input mode. + /// + /// Default value is [DateRangePickerMode.calendar]. + final DateRangePickerMode mode; + + /// Label for start date text field. + final String? fieldStartLabelText; + + /// Label for end date text field. + final String? fieldEndLabelText; + + /// Label for selected date range. + final String? labelSelectedDateRange; + + /// Label for cancel button in [DateRangePickerMode.input]. + final String? cancelText; + + /// Label for confirm button in [DateRangePickerMode.input]. + final String? confirmText; + + /// Semantic label for edit icon. + final String? semanticLabelEditIcon; + + /// Text that describes the action that will occur when the edit button is long pressed. + final String? toolTipEdit; + + /// Semantic label for close icon. + final String? semanticLabelClose; + + /// Text that describes the action that will occur when the close button is long pressed. + final String? toolTipClose; + + /// Semantic label for confirm icon. + final String? semanticLabelConfirm; + + /// Text that describes the action that will occur when the confirm button is long pressed. + final String? toolTipConfirm; + + /// Semantic label for Calendar icon. + final String? semanticLabelCalendar; + + /// Text that describes the action that will occur when the Calendar icon is long pressed. + final String? toolTipCalendar; + + @override + _DerivDateRangePickerState createState() => _DerivDateRangePickerState(); +} + +class _DerivDateRangePickerState extends State { + DateTime? selectedStartDate; + DateTime? selectedEndDate; + + bool showCalendar = true; + @override + void initState() { + super.initState(); + + selectedStartDate = widget.initialStartDate; + selectedEndDate = widget.initialEndDate; + + SchedulerBinding.instance.addPostFrameCallback((_) { + if (widget.mode == DateRangePickerMode.input) { + showDateRangeInputDialog(); + } + }); + } + + @override + Widget build(BuildContext context) => Visibility( + visible: showCalendar, + child: Scaffold( + backgroundColor: context.theme.colors.prominent, + appBar: _buildAppBar(), + body: _buildCalendar(), + ), + ); + + AppBar _buildAppBar() => AppBar( + elevation: 0, + leading: IconButton( + icon: Icon( + Icons.close, + semanticLabel: widget.semanticLabelClose ?? + context.localization!.labelSemanticClose, + color: context.theme.colors.general, + ), + tooltip: widget.toolTipClose ?? context.localization!.labelClose, + onPressed: () => Navigator.pop(context), + ), + actions: [ + Padding( + padding: const EdgeInsets.all(ThemeProvider.margin08), + child: IconButton( + icon: Icon( + Icons.check, + semanticLabel: widget.semanticLabelConfirm ?? + context.localization!.labelSemanticConfirm, + color: context.theme.colors.general.withOpacity( + getOpacity(isEnabled: _isSaveEnabled()), + ), + ), + tooltip: + widget.toolTipConfirm ?? context.localization!.labelConfirm, + onPressed: _isSaveEnabled() ? _setSelectedDate : null, + ), + ), + ], + ); + + Widget _buildCalendar() => Column( + children: [ + Container( + color: context.theme.colors.secondary, + padding: const EdgeInsets.only( + left: ThemeProvider.margin72, + bottom: ThemeProvider.margin16, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.symmetric( + vertical: ThemeProvider.margin08, + ), + child: Text( + widget.labelSelectedDateRange ?? + context.localization!.labelSelectedDateRange, + style: context.theme.textStyle( + textStyle: TextStyles.overline, + color: context.theme.colors.general, + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SelectedDateRange( + fieldStartLabelText: widget.fieldStartLabelText ?? + context.localization!.labelStartDate, + fieldEndLabelText: widget.fieldEndLabelText ?? + context.localization!.labelEndDate, + currentDate: widget.currentDate ?? DateTime.now(), + startDate: selectedStartDate, + endDate: selectedEndDate, + ), + _buildEditButton(), + ], + ), + ], + ), + ), + Expanded( + child: CalendarDateRange( + currentDate: widget.currentDate ?? DateTime.now(), + firstDate: widget.minAllowedDate, + lastDate: widget.maxAllowedDate, + initialStartDate: selectedStartDate, + initialEndDate: selectedEndDate, + onStartDateChanged: (DateTime date) => + setState(() => selectedStartDate = date), + onEndDateChanged: (DateTime? date) => + setState(() => selectedEndDate = date), + ), + ), + ], + ); + + Widget _buildEditButton() => Container( + padding: const EdgeInsets.only( + right: ThemeProvider.margin08, + ), + child: ClipOval( + child: Material( + color: Colors.transparent, + child: IconButton( + icon: Icon( + Icons.edit, + semanticLabel: widget.semanticLabelEditIcon ?? + context.localization!.labelSemanticEditIcon, + color: context.theme.colors.general, + ), + tooltip: widget.toolTipEdit ?? context.localization!.labelEdit, + onPressed: showDateRangeInputDialog, + ), + ), + ), + ); + + Future showDateRangeInputDialog() async { + setState(() => showCalendar = false); + + final DateRangeModel? datePickerResult = await showDialog( + context: context, + builder: (BuildContext context) => AnimatedPopupDialog( + child: InputDateRange( + fieldStartLabelText: widget.fieldStartLabelText, + fieldEndLabelText: widget.fieldEndLabelText, + cancelText: + widget.cancelText ?? context.localization!.labelActionCancel, + confirmText: + widget.confirmText ?? context.localization!.labelActionOk, + labelSelectedDateRange: widget.labelSelectedDateRange, + semanticCalendarLabel: widget.semanticLabelCalendar, + toolTipCalendar: widget.toolTipCalendar, + currentDate: widget.currentDate ?? DateTime.now(), + minAllowedDate: widget.minAllowedDate, + maxAllowedDate: widget.maxAllowedDate, + initialStartDate: selectedStartDate, + initialEndDate: selectedEndDate, + ), + ), + ); + + if (datePickerResult == null) { + return; + } + + setState(() { + showCalendar = datePickerResult.showCalendar ?? true; + + selectedStartDate = datePickerResult.startDate; + selectedEndDate = datePickerResult.endDate; + }); + + if (!showCalendar) { + _setSelectedDate(); + } + } + + void _setSelectedDate() => Navigator.pop( + context, + selectedStartDate == null && selectedEndDate == null + ? null + : DateRangeModel( + startDate: selectedStartDate, + endDate: selectedEndDate, + ), + ); + + bool _isSaveEnabled() => selectedStartDate != null || selectedEndDate != null; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/deriv_date_range_picker.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/deriv_date_range_picker.dart new file mode 100644 index 000000000..10c7d7921 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/deriv_date_range_picker.dart @@ -0,0 +1,14 @@ +export 'package:deriv_ui/l10n/generated/date_range_localizations.dart'; +export 'package:deriv_ui/l10n/generated/date_range_localizations_en.dart'; +export 'core/date_input_formatter.dart'; +export 'core/debug.dart'; +export 'core/enums.dart'; +export 'core/extensions.dart'; +export 'core/helpers.dart'; +export 'date_range_picker.dart'; +export 'models/date_range_model.dart'; +export 'models/input_date_model.dart'; +export 'widgets/animated_popup.dart'; +export 'widgets/calendar_date_range.dart'; +export 'widgets/input_date_range.dart'; +export 'widgets/selected_date_range.dart'; diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/date_range_model.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/date_range_model.dart new file mode 100644 index 000000000..dfc7dd659 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/date_range_model.dart @@ -0,0 +1,18 @@ +/// Date range model. +class DateRangeModel { + /// Initializes date range model. + DateRangeModel({ + this.startDate, + this.endDate, + this.showCalendar, + }); + + /// Selected start date. + final DateTime? startDate; + + /// Selected end date. + final DateTime? endDate; + + /// Returns to calendar after setting date. + final bool? showCalendar; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/input_date_model.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/input_date_model.dart new file mode 100644 index 000000000..9220c2397 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/input_date_model.dart @@ -0,0 +1,16 @@ +/// A data class to represent information after parsing a string to date. +class InputDateModel { + /// Constructor initializing. + InputDateModel({ + this.isValidOrNull = true, + this.dateTime, + }); + + /// Flag to represent whether the input string is in valid format or null. + /// + /// Default to `true`. + bool isValidOrNull; + + /// Valid DateTime generated from the string. + DateTime? dateTime; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/animated_popup.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/animated_popup.dart new file mode 100644 index 000000000..6e8102bc5 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/animated_popup.dart @@ -0,0 +1,85 @@ +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; + +/// Animated popup dialog, to be used as the container of the popup dialogs with animation. +class AnimatedPopupDialog extends StatefulWidget { + /// Initializes animated popup dialog + const AnimatedPopupDialog({ + required this.child, + this.animationDuration = const Duration(milliseconds: 150), + Key? key, + }) : super(key: key); + + /// Content of this dialog. + final Widget child; + + /// Animation Duration. + final Duration animationDuration; + + @override + State createState() => _AnimatedPopupDialogState(); +} + +class _AnimatedPopupDialogState extends State + with SingleTickerProviderStateMixin { + late AnimationController controller; + late Animation scaleAnimation; + + @override + void initState() { + super.initState(); + + controller = + AnimationController(vsync: this, duration: widget.animationDuration); + scaleAnimation = CurvedAnimation(parent: controller, curve: Curves.easeOut); + + controller + ..addListener(() => setState(() {})) + ..forward(); + } + + @override + Widget build(BuildContext context) => Center( + child: ScaleTransition( + scale: scaleAnimation, + child: Container( + margin: EdgeInsets.symmetric( + horizontal: _calculateHorizontalPadding(context), + vertical: ThemeProvider.margin08, + ), + child: Card( + elevation: ThemeProvider.margin04, + color: context.theme.colors.primary, + child: Container( + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(ThemeProvider.borderRadius04), + ), + ), + child: Padding( + padding: const EdgeInsets.all(ThemeProvider.margin02), + child: widget.child, + ), + ), + ), + ), + ), + ); + + double _calculateHorizontalPadding(BuildContext context) { + final double screenWidth = MediaQuery.of(context).size.width; + + if (screenWidth > 900) { + return 0.25 * screenWidth; + } else if (screenWidth > 750) { + return 0.2 * screenWidth; + } else if (screenWidth < 400) { + return 0.02 * screenWidth; + } else if (screenWidth < 500) { + return 0.05 * screenWidth; + } else { + return 0.1 * screenWidth; + } + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_date_range.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_date_range.dart new file mode 100644 index 000000000..be6ca86a7 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_date_range.dart @@ -0,0 +1,210 @@ +import 'dart:math' as math; + +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; + +part 'calendar_keyboard_navigator.dart'; +part 'day_header.dart'; +part 'focused_date.dart'; +part 'highlight_painter.dart'; +part 'month_item.dart'; +part 'month_item_grid.dart'; +part 'month_item_grid_delegate.dart'; + +const Duration _monthScrollDuration = Duration(milliseconds: 200); + +const double _monthItemHeaderHeight = ThemeProvider.margin48; +const double _monthItemFooterHeight = ThemeProvider.margin16; +const double _monthItemRowHeight = ThemeProvider.margin48; +const double _monthItemSpaceBetweenRows = ThemeProvider.margin08; +const double _horizontalPadding = ThemeProvider.margin08; +const double _maxCalendarWidthLandscape = 384; +const double _maxCalendarWidthPortrait = 480; + +/// Displays a scrollable calendar grid that allows a user to select a range of dates. +class CalendarDateRange extends StatefulWidget { + /// Creates a scrollable calendar grid for picking date ranges. + CalendarDateRange({ + required DateTime currentDate, + required DateTime firstDate, + required DateTime lastDate, + required this.onStartDateChanged, + required this.onEndDateChanged, + Key? key, + DateTime? initialStartDate, + DateTime? initialEndDate, + }) : initialStartDate = initialStartDate != null + ? getDateFromDateTime(initialStartDate) + : null, + initialEndDate = + initialEndDate != null ? getDateFromDateTime(initialEndDate) : null, + firstDate = getDateFromDateTime(firstDate), + lastDate = getDateFromDateTime(lastDate), + currentDate = getDateFromDateTime(currentDate), + super(key: key); + + /// The earliest allowable [DateTime] that the user can select. + final DateTime firstDate; + + /// The latest allowable [DateTime] that the user can select. + final DateTime lastDate; + + /// Called when the user changes the start date of the selected range. + final ValueChanged onStartDateChanged; + + /// Called when the user changes the end date of the selected range. + final ValueChanged? onEndDateChanged; + + /// The [DateTime] representing today. It will be highlighted in the day grid. + final DateTime currentDate; + + /// The [DateTime] that represents the start of the initial date range selection. + final DateTime? initialStartDate; + + /// The [DateTime] that represents the end of the initial date range selection. + final DateTime? initialEndDate; + + @override + _CalendarDateRangeState createState() => _CalendarDateRangeState(); +} + +class _CalendarDateRangeState extends State { + final GlobalKey scrollViewKey = GlobalKey(); + + DateTime? startDate; + DateTime? endDate; + + int initialMonthIndex = 0; + late bool showWeekBottomDivider; + + late ScrollController controller; + + @override + void initState() { + super.initState(); + + controller = ScrollController()..addListener(_scrollListener); + + startDate = widget.initialStartDate; + endDate = widget.initialEndDate; + + final DateTime initialDate = + widget.initialStartDate ?? widget.initialEndDate ?? widget.currentDate; + + if (widget.firstDate.isBefore(initialDate) && + (widget.lastDate.isAfter(initialDate) || + widget.lastDate.isAtSameMomentAs(initialDate))) { + initialMonthIndex = monthDelta( + startDate: widget.firstDate, + endDate: initialDate, + ); + } + + showWeekBottomDivider = initialMonthIndex != 0; + } + + @override + Widget build(BuildContext context) { + const Key sliverAfterKey = Key('SILVER_AFTER_KEY'); + + return Column( + children: [ + _DayHeader(), + if (showWeekBottomDivider) const Divider(height: 0), + Expanded( + child: _CalendarKeyboardNavigator( + firstDate: widget.firstDate, + lastDate: widget.lastDate, + initialFocusedDay: + startDate ?? widget.initialStartDate ?? widget.currentDate, + child: CustomScrollView( + key: scrollViewKey, + controller: controller, + center: sliverAfterKey, + slivers: [ + SliverList( + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) => _buildMonthItem( + index: index, + beforeInitialMonth: true, + ), + childCount: initialMonthIndex, + ), + ), + SliverList( + key: sliverAfterKey, + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) => _buildMonthItem( + index: index, + beforeInitialMonth: false, + ), + childCount: _numberOfMonths - initialMonthIndex, + ), + ), + ], + ), + ), + ), + ], + ); + } + + Widget _buildMonthItem({ + required int index, + required bool beforeInitialMonth, + }) { + final int monthIndex = beforeInitialMonth + ? initialMonthIndex - index - 1 + : initialMonthIndex + index; + + final DateTime month = addMonthsToMonthDate( + monthDate: widget.firstDate, + monthsToAdd: monthIndex, + ); + + return _MonthItem( + currentDate: widget.currentDate, + selectedDateStart: startDate, + selectedDateEnd: endDate, + firstDate: widget.firstDate, + lastDate: widget.lastDate, + displayedMonth: month, + onChanged: _updateSelection, + ); + } + + void _scrollListener() { + if (controller.offset <= controller.position.minScrollExtent) { + setState(() => showWeekBottomDivider = false); + } else if (!showWeekBottomDivider) { + setState(() => showWeekBottomDivider = true); + } + } + + void _updateSelection(DateTime date) { + setState(() { + if (startDate != null && endDate == null && !date.isBefore(startDate!)) { + widget.onEndDateChanged?.call(endDate = date); + } else { + widget.onStartDateChanged.call(startDate = date); + + if (endDate != null) { + widget.onEndDateChanged?.call(endDate = null); + } + } + }); + } + + int get _numberOfMonths => + monthDelta(startDate: widget.firstDate, endDate: widget.lastDate) + 1; + + @override + void dispose() { + controller.dispose(); + + super.dispose(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_keyboard_navigator.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_keyboard_navigator.dart new file mode 100644 index 000000000..d9295a27d --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_keyboard_navigator.dart @@ -0,0 +1,152 @@ +part of 'calendar_date_range.dart'; + +class _CalendarKeyboardNavigator extends StatefulWidget { + const _CalendarKeyboardNavigator({ + required this.child, + required this.initialFocusedDay, + required this.firstDate, + required this.lastDate, + Key? key, + }) : super(key: key); + + final Widget child; + final DateTime initialFocusedDay; + final DateTime firstDate; + final DateTime lastDate; + + @override + _CalendarKeyboardNavigatorState createState() => + _CalendarKeyboardNavigatorState(); +} + +class _CalendarKeyboardNavigatorState + extends State<_CalendarKeyboardNavigator> { + Map? shortcutMap; + Map>? actionMap; + late FocusNode dayGridFocus; + TraversalDirection? dayTraversalDirection; + DateTime? focusedDay; + + @override + void initState() { + super.initState(); + + shortcutMap = { + LogicalKeySet(LogicalKeyboardKey.arrowLeft): + const DirectionalFocusIntent(TraversalDirection.left), + LogicalKeySet(LogicalKeyboardKey.arrowRight): + const DirectionalFocusIntent(TraversalDirection.right), + LogicalKeySet(LogicalKeyboardKey.arrowDown): + const DirectionalFocusIntent(TraversalDirection.down), + LogicalKeySet(LogicalKeyboardKey.arrowUp): + const DirectionalFocusIntent(TraversalDirection.up), + }; + + actionMap = >{ + NextFocusIntent: + CallbackAction(onInvoke: _handleGridNextFocus), + PreviousFocusIntent: CallbackAction( + onInvoke: _handleGridPreviousFocus), + DirectionalFocusIntent: CallbackAction( + onInvoke: _handleDirectionFocus), + }; + + dayGridFocus = FocusNode(debugLabel: 'Day Grid'); + } + + @override + Widget build(BuildContext context) => FocusableActionDetector( + shortcuts: shortcutMap, + actions: actionMap, + focusNode: dayGridFocus, + onFocusChange: _handleGridFocusChange, + child: _FocusedDate( + date: dayGridFocus.hasFocus ? focusedDay : null, + scrollDirection: dayGridFocus.hasFocus ? dayTraversalDirection : null, + child: widget.child, + ), + ); + + void _handleGridFocusChange(bool focused) => setState(() { + if (focused) { + focusedDay ??= widget.initialFocusedDay; + } + }); + + void _handleGridNextFocus(NextFocusIntent intent) => dayGridFocus + ..requestFocus() + ..nextFocus(); + + void _handleGridPreviousFocus(PreviousFocusIntent intent) => dayGridFocus + ..requestFocus() + ..previousFocus(); + + void _handleDirectionFocus(DirectionalFocusIntent intent) { + assert(focusedDay != null); + + setState(() { + final DateTime? nextDate = _nextDateInDirection( + date: focusedDay!, + direction: intent.direction, + ); + + if (nextDate != null) { + focusedDay = nextDate; + dayTraversalDirection = intent.direction; + } + }); + } + + static const Map _directionOffset = + { + TraversalDirection.up: -DateTime.daysPerWeek, + TraversalDirection.right: 1, + TraversalDirection.down: DateTime.daysPerWeek, + TraversalDirection.left: -1, + }; + + int _dayDirectionOffset({ + required TraversalDirection traversalDirection, + required TextDirection textDirection, + }) { + TraversalDirection? currentTraversalDirection; + + if (textDirection == TextDirection.rtl) { + if (traversalDirection == TraversalDirection.left) { + currentTraversalDirection = TraversalDirection.right; + } else if (traversalDirection == TraversalDirection.right) { + currentTraversalDirection = TraversalDirection.left; + } + } + + return _directionOffset[currentTraversalDirection!]!; + } + + DateTime? _nextDateInDirection({ + required DateTime date, + required TraversalDirection direction, + }) { + final TextDirection textDirection = Directionality.of(context); + final DateTime nextDate = addDaysToDate( + date: date, + days: _dayDirectionOffset( + traversalDirection: direction, + textDirection: textDirection, + ), + ); + + if (!nextDate.isBefore(widget.firstDate) && + !nextDate.isAfter(widget.lastDate)) { + return nextDate; + } + + return null; + } + + @override + void dispose() { + dayGridFocus.dispose(); + + super.dispose(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/date_range_text_field.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/date_range_text_field.dart new file mode 100644 index 000000000..49440cca3 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/date_range_text_field.dart @@ -0,0 +1,176 @@ +part of 'input_date_range.dart'; + +typedef _DateRangeTextFieldHandler = void Function( + InputDateModel, + InputDateModel, +); + +/// Date range text field widget. +class _DateRangeTextField extends StatefulWidget { + /// Initializes date range text field. + const _DateRangeTextField({ + required this.initialStartDate, + required this.initialEndDate, + required this.isStartDateValid, + required this.isEndDateValid, + required this.onEditingComplete, + required this.dateFormat, + required this.fieldStartLabelText, + required this.fieldEndLabelText, + Key? key, + }) : super(key: key); + + /// Label for start date text field. + final String fieldStartLabelText; + + /// Label for end date text field. + final String fieldEndLabelText; + + /// Initial start date. + final DateTime? initialStartDate; + + /// Initial end date. + final DateTime? initialEndDate; + + /// The accepted Date format for the TextField + final String dateFormat; + + /// `true` if the selected start-date is valid + final bool isStartDateValid; + + /// `true` if the selected end-date is valid + final bool isEndDateValid; + + /// On editing complete handler. + final _DateRangeTextFieldHandler? onEditingComplete; + + @override + _DateRangeTextFieldState createState() => _DateRangeTextFieldState(); +} + +class _DateRangeTextFieldState extends State<_DateRangeTextField> { + late DateFormat dateFormatter; + DateTime? startDate; + DateTime? endDate; + + final TextEditingController startDateInputController = + TextEditingController(); + final TextEditingController endDateInputController = TextEditingController(); + + @override + void initState() { + super.initState(); + + dateFormatter = DateFormat(widget.dateFormat); + startDate = widget.initialStartDate; + endDate = widget.initialEndDate; + + _setInputControllers(); + } + + @override + Widget build(BuildContext context) => Row( + children: [ + _buildDateTextField( + hintText: widget.dateFormat.toUpperCase(), + labelText: widget.fieldStartLabelText, + controller: startDateInputController, + isValidDate: widget.isStartDateValid, + ), + const SizedBox(width: ThemeProvider.margin08), + _buildDateTextField( + hintText: widget.dateFormat.toUpperCase(), + labelText: widget.fieldEndLabelText, + controller: endDateInputController, + isValidDate: widget.isEndDateValid, + ), + ], + ); + + Widget _buildDateTextField({ + required String hintText, + required String labelText, + required TextEditingController? controller, + required bool isValidDate, + }) => + Expanded( + child: TextField( + inputFormatters: [ + DateInputFormatter(), + LengthLimitingTextInputFormatter(10) + ], + controller: controller, + keyboardType: TextInputType.number, + cursorColor: isValidDate + ? context.theme.colors.blue + : context.theme.colors.coral, + textInputAction: controller == startDateInputController + ? TextInputAction.next + : TextInputAction.done, + style: context.theme.textStyle( + textStyle: TextStyles.subheading, + color: context.theme.colors.general, + ), + decoration: InputDecoration( + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: isValidDate + ? context.theme.colors.hover + : context.theme.colors.coral, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: isValidDate + ? context.theme.colors.blue + : context.theme.colors.coral, + ), + ), + hintText: hintText, + hintStyle: context.theme.textStyle( + textStyle: TextStyles.subheading, + color: context.theme.colors.disabled, + ), + labelText: labelText, + labelStyle: context.theme.textStyle( + textStyle: TextStyles.subheading, + color: isValidDate + ? context.theme.colors.blue + : context.theme.colors.coral, + ), + ), + onChanged: (_) { + _updateDates(); + }, + ), + ); + + void _updateDates() { + final InputDateModel startDateModel = parseDate( + date: startDateInputController.text, + ); + final InputDateModel endDateModel = parseDate( + date: endDateInputController.text, + ); + + widget.onEditingComplete?.call( + startDateModel, + endDateModel, + ); + } + + void _setInputControllers() { + startDateInputController.text = + startDate == null ? '' : dateFormatter.format(startDate!); + endDateInputController.text = + endDate == null ? '' : dateFormatter.format(endDate!); + } + + @override + void dispose() { + startDateInputController.dispose(); + endDateInputController.dispose(); + + super.dispose(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/day_header.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/day_header.dart new file mode 100644 index 000000000..6844dfbe0 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/day_header.dart @@ -0,0 +1,51 @@ +part of 'calendar_date_range.dart'; + +class _DayHeader extends StatelessWidget { + @override + Widget build(BuildContext context) => Container( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).orientation == Orientation.landscape + ? _maxCalendarWidthLandscape + : _maxCalendarWidthPortrait, + maxHeight: _monthItemRowHeight, + ), + child: GridView.custom( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + gridDelegate: _monthItemGridDelegate, + childrenDelegate: SliverChildListDelegate( + _getHeader(context), + addRepaintBoundaries: false, + ), + ), + ); + + List _getHeader(BuildContext context) { + final MaterialLocalizations localizations = + MaterialLocalizations.of(context); + + final List headerItems = []; + + for (int i = localizations.firstDayOfWeekIndex; true; i = (i + 1) % 7) { + final String weekday = localizations.narrowWeekdays[i]; + + headerItems.add( + Center( + child: Text( + weekday, + style: context.theme.textStyle( + textStyle: TextStyles.body1, + color: context.theme.colors.disabled, + ), + ), + ), + ); + + if (i == (localizations.firstDayOfWeekIndex - 1) % 7) { + break; + } + } + + return [Container(), ...headerItems, Container()]; + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/focused_date.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/focused_date.dart new file mode 100644 index 000000000..afdfe59d7 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/focused_date.dart @@ -0,0 +1,22 @@ +part of 'calendar_date_range.dart'; + +/// InheritedWidget indicating what the current focused date is for its children. +class _FocusedDate extends InheritedWidget { + const _FocusedDate({ + required Widget child, + required this.date, + required this.scrollDirection, + Key? key, + }) : super(key: key, child: child); + + final DateTime? date; + final TraversalDirection? scrollDirection; + + @override + bool updateShouldNotify(_FocusedDate oldWidget) => + !isSameDay(firstDate: date, secondDate: oldWidget.date) || + scrollDirection != oldWidget.scrollDirection; + + static _FocusedDate? of(BuildContext context) => + context.dependOnInheritedWidgetOfExactType<_FocusedDate>(); +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/highlight_painter.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/highlight_painter.dart new file mode 100644 index 000000000..f3ecd9d53 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/highlight_painter.dart @@ -0,0 +1,63 @@ +part of 'calendar_date_range.dart'; + +/// This custom painter will add a background highlight to its child. +class _HighlightPainter extends CustomPainter { + _HighlightPainter({ + required this.color, + required this.textDirection, + this.style = _HighlightPainterStyle.none, + }); + + final Color color; + final _HighlightPainterStyle style; + final TextDirection textDirection; + + @override + void paint(Canvas canvas, Size size) { + if (style == _HighlightPainterStyle.none) { + return; + } + + final Paint paint = Paint() + ..color = color + ..style = PaintingStyle.fill; + + final Rect rectLeft = Rect.fromLTWH(0, 0, size.width / 2, size.height); + final Rect rectRight = + Rect.fromLTWH(size.width / 2, 0, size.width / 2, size.height); + + switch (style) { + case _HighlightPainterStyle.highlightTrailing: + canvas.drawRect( + textDirection == TextDirection.ltr ? rectRight : rectLeft, + paint, + ); + break; + case _HighlightPainterStyle.highlightLeading: + canvas.drawRect( + textDirection == TextDirection.ltr ? rectLeft : rectRight, + paint, + ); + break; + case _HighlightPainterStyle.highlightAll: + canvas.drawRect( + Rect.fromLTWH(0, 0, size.width, size.height), + paint, + ); + break; + + default: + break; + } + } + + @override + bool shouldRepaint(CustomPainter oldDelegate) => false; +} + +enum _HighlightPainterStyle { + none, + highlightLeading, + highlightTrailing, + highlightAll, +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/input_date_range.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/input_date_range.dart new file mode 100644 index 000000000..1e196237a --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/input_date_range.dart @@ -0,0 +1,341 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:intl/intl.dart'; + +part 'date_range_text_field.dart'; + +/// Date input range widget. +class InputDateRange extends StatefulWidget { + /// Initializes date range input widget. + const InputDateRange({ + required this.currentDate, + this.minAllowedDate, + this.maxAllowedDate, + this.initialStartDate, + this.initialEndDate, + this.fieldStartLabelText, + this.fieldEndLabelText, + this.semanticCalendarLabel, + this.toolTipCalendar, + this.cancelText, + this.confirmText, + this.labelSelectedDateRange, + Key? key, + }) : super(key: key); + + /// Label text for the start date field. + final String? fieldStartLabelText; + + /// Label text for the end date field. + final String? fieldEndLabelText; + + /// Semantic label for the calendar icon. + final String? semanticCalendarLabel; + + /// Text that appears when the user long-presses the calendar icon. + final String? toolTipCalendar; + + /// Text for the cancel button. + final String? cancelText; + + /// Text for the confirm button. + final String? confirmText; + + /// Label for selected date range. + final String? labelSelectedDateRange; + + /// The [DateTime] representing today. + final DateTime currentDate; + + /// The earliest allowed [DateTime] that the user can select. + final DateTime? minAllowedDate; + + /// The latest allowed [DateTime] that the user can select. + final DateTime? maxAllowedDate; + + /// The [DateTime] that represents the start of the initial date range selection. + final DateTime? initialStartDate; + + /// The [DateTime] that represents the end of the initial date range selection. + final DateTime? initialEndDate; + + @override + _InputDateRangeState createState() => _InputDateRangeState(); +} + +class _InputDateRangeState extends State { + late DateTime? startDate; + late DateTime? endDate; + late bool isStartDateValid; + late bool isEndDateValid; + + @override + void initState() { + super.initState(); + + startDate = widget.initialStartDate; + endDate = widget.initialEndDate; + isStartDateValid = true; + isEndDateValid = true; + } + + @override + Widget build(BuildContext context) => WillPopScope( + child: GestureDetector( + child: Container( + color: context.theme.colors.primary, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _buildTitle(), + _buildDateInput(), + _buildActions(), + ], + ), + ), + onTap: () => FocusScope.of(context).requestFocus(FocusNode()), + ), + onWillPop: () async { + _onCancelTap(); + + return true; + }, + ); + + Widget _buildTitle() => Container( + color: context.theme.colors.secondary, + padding: const EdgeInsets.only( + top: ThemeProvider.margin16, + left: ThemeProvider.margin24, + right: ThemeProvider.margin16, + bottom: ThemeProvider.margin16, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.symmetric( + vertical: ThemeProvider.margin08, + ), + child: Text( + widget.labelSelectedDateRange ?? + context.localization!.labelSelectedDateRange, + style: context.theme.textStyle( + textStyle: TextStyles.overline, + color: context.theme.colors.general, + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SelectedDateRange( + fieldStartLabelText: widget.fieldStartLabelText ?? + context.localization!.labelStartDate, + fieldEndLabelText: widget.fieldEndLabelText ?? + context.localization!.labelEndDate, + currentDate: widget.currentDate, + startDate: isStartDateValid ? startDate : null, + endDate: isEndDateValid ? endDate : null, + ), + _buildCalendarButton(), + ], + ), + ], + ), + ); + + Widget _buildDateInput() => Padding( + padding: const EdgeInsets.only( + left: ThemeProvider.margin24, + top: ThemeProvider.margin16, + right: ThemeProvider.margin24, + ), + child: _DateRangeTextField( + fieldStartLabelText: widget.fieldStartLabelText ?? + context.localization!.labelStartDate, + fieldEndLabelText: + widget.fieldEndLabelText ?? context.localization!.labelEndDate, + dateFormat: 'dd-MM-yyyy', + initialStartDate: startDate, + initialEndDate: endDate, + isStartDateValid: isStartDateValid, + isEndDateValid: isEndDateValid, + onEditingComplete: _onEditingComplete, + ), + ); + + Widget _buildCalendarButton() => ClipOval( + child: Material( + color: Colors.transparent, + child: IconButton( + icon: Icon( + Icons.date_range, + semanticLabel: widget.semanticCalendarLabel, + color: context.theme.colors.general.withOpacity( + getOpacity( + isEnabled: _isDateValidForCalendar(), + ), + ), + ), + tooltip: widget.toolTipCalendar, + onPressed: () { + if (_isDateValidForCalendar()) { + _onConfirmTap(true); + } + }, + ), + ), + ); + + Widget _buildActions() => ButtonBar( + children: [ + TextButton( + onPressed: _onCancelTap, + child: Text( + widget.cancelText ?? context.localization!.labelActionCancel, + style: context.theme.textStyle( + textStyle: TextStyles.button, + color: context.theme.colors.coral, + ), + ), + ), + TextButton( + child: Text( + widget.confirmText ?? context.localization!.labelActionOk, + style: context.theme.textStyle( + textStyle: TextStyles.button, + color: _isDateValidForApply() + ? context.theme.colors.coral + : context.theme.colors.active, + ), + ), + onPressed: () { + if (_isDateValidForApply()) { + _onConfirmTap(false); + } + }, + ), + ], + ); + + void _onConfirmTap(bool showCalendar) => _applySelectedDateRange( + DateRangeModel( + startDate: startDate, + endDate: endDate, + showCalendar: showCalendar, + ), + ); + + void _onEditingComplete( + InputDateModel startDateModel, + InputDateModel endDateModel, + ) => + setState(() { + startDate = + startDateModel.isValidOrNull ? startDateModel.dateTime : null; + endDate = endDateModel.isValidOrNull ? endDateModel.dateTime : null; + + _checkStartAndEndDateValidity( + startDateModel.isValidOrNull, + endDateModel.isValidOrNull, + ); + }); + + void _onCancelTap() => + _applySelectedDateRange(DateRangeModel(showCalendar: false)); + + void _applySelectedDateRange(DateRangeModel datePickerResult) => + Navigator.pop(context, datePickerResult); + + bool _isDateValidForCalendar() => isStartDateValid && isEndDateValid; + + bool _isDateValidForApply() => + (_isStartDateAfterOrSameAsMinAllowableDate() && + _isStartDateBeforeOrSameAsMaxAllowableDate() && + _isStartDateBeforeOrSameAsEndDate() && + _isEndDateBeforeOrSameAsMaxAllowableDate()) || + (_hasOneValidDate() && isStartDateValid && isEndDateValid); + + bool _isStartDateAfterOrSameAsMinAllowableDate() => + startDate != null && + widget.minAllowedDate != null && + (startDate!.isAfter(widget.minAllowedDate!) || + startDate!.isAtSameMomentAs(widget.minAllowedDate!)); + + bool _isStartDateBeforeOrSameAsMaxAllowableDate() => + startDate != null && + widget.maxAllowedDate != null && + (startDate!.isBefore(widget.maxAllowedDate!) || + startDate!.isAtSameMomentAs(widget.maxAllowedDate!)); + + bool _isStartDateBeforeOrSameAsEndDate() => + startDate != null && + endDate != null && + (startDate!.isBefore(endDate!) || startDate!.isAtSameMomentAs(endDate!)); + + bool _isEndDateBeforeOrSameAsMaxAllowableDate() => + endDate != null && + widget.maxAllowedDate != null && + (endDate!.isBefore(widget.maxAllowedDate!) || + endDate!.isAtSameMomentAs(widget.maxAllowedDate!)); + + bool _isEndDateAfterOrSameAsMinAllowableDate() => + endDate != null && + widget.minAllowedDate != null && + (endDate!.isAfter(widget.minAllowedDate!) || + endDate!.isAtSameMomentAs(widget.minAllowedDate!)); + + bool _hasOneValidDate() { + if (startDate != null && endDate == null) { + return _isStartDateAfterOrSameAsMinAllowableDate() && + _isStartDateBeforeOrSameAsMaxAllowableDate(); + } else if (startDate == null && endDate != null) { + return _isEndDateBeforeOrSameAsMaxAllowableDate() && + _isEndDateAfterOrSameAsMinAllowableDate(); + } else { + return false; + } + } + + void _checkStartAndEndDateValidity( + bool startDateIsValidOrNull, + bool endDateIsValidOrNull, + ) { + if (startDateIsValidOrNull) { + if (startDate != null) { + if (endDate != null) { + isStartDateValid = _isStartDateAfterOrSameAsMinAllowableDate() && + _isStartDateBeforeOrSameAsMaxAllowableDate() && + _isStartDateBeforeOrSameAsEndDate(); + } else { + isStartDateValid = _isStartDateAfterOrSameAsMinAllowableDate() && + _isStartDateBeforeOrSameAsMaxAllowableDate(); + } + } else { + isStartDateValid = true; + } + } else { + isStartDateValid = false; + } + + if (endDateIsValidOrNull) { + if (endDate != null) { + if (startDate != null) { + isEndDateValid = _isEndDateBeforeOrSameAsMaxAllowableDate() && + _isEndDateAfterOrSameAsMinAllowableDate() && + _isStartDateBeforeOrSameAsEndDate(); + } else { + isEndDateValid = _isEndDateBeforeOrSameAsMaxAllowableDate() && + _isEndDateAfterOrSameAsMinAllowableDate(); + } + } else { + isEndDateValid = true; + } + } else { + isEndDateValid = false; + } + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item.dart new file mode 100644 index 000000000..07a9167d7 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item.dart @@ -0,0 +1,376 @@ +part of 'calendar_date_range.dart'; + +/// Displays the days of a given month and allows choosing a date range. +class _MonthItem extends StatefulWidget { + const _MonthItem({ + required this.currentDate, + required this.selectedDateStart, + required this.selectedDateEnd, + required this.firstDate, + required this.lastDate, + required this.displayedMonth, + required this.onChanged, + Key? key, + }) : super(key: key); + + final DateTime currentDate; + + final DateTime? selectedDateStart; + final DateTime? selectedDateEnd; + + final DateTime firstDate; + final DateTime lastDate; + + final DateTime displayedMonth; + + final ValueChanged onChanged; + + @override + _MonthItemState createState() => _MonthItemState(); +} + +class _MonthItemState extends State<_MonthItem> { + late List dayFocusNodes; + + @override + void initState() { + super.initState(); + + final int daysInMonth = getDaysInMonth( + year: widget.displayedMonth.year, + month: widget.displayedMonth.month, + ); + + dayFocusNodes = List.generate( + daysInMonth, + (int index) => + FocusNode(skipTraversal: true, debugLabel: 'Day ${index + 1}'), + ); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + final DateTime? focusedDate = _FocusedDate.of(context)?.date; + + if (focusedDate != null && + isSameMonth( + firstDate: widget.displayedMonth, secondDate: focusedDate)) { + dayFocusNodes[focusedDate.day - 1].requestFocus(); + } + } + + @override + Widget build(BuildContext context) { + final MaterialLocalizations localizations = + MaterialLocalizations.of(context); + + final int year = widget.displayedMonth.year; + final int month = widget.displayedMonth.month; + final int daysInMonth = getDaysInMonth(year: year, month: month); + final int dayOffset = + firstDayOffset(year: year, month: month, localizations: localizations); + final int weeks = ((daysInMonth + dayOffset) / DateTime.daysPerWeek).ceil(); + final double gridHeight = + weeks * _monthItemRowHeight + (weeks - 1) * _monthItemSpaceBetweenRows; + final List dayItems = []; + + for (int i = 0; true; i += 1) { + final int day = i - dayOffset + 1; + + if (day > daysInMonth) { + break; + } + + if (day < 1) { + dayItems.add(Container()); + } else { + final DateTime dayToBuild = DateTime(year, month, day); + final Widget dayItem = + _buildDayItem(context: context, dayToBuild: dayToBuild); + + dayItems.add(dayItem); + } + } + + final List paddedDayItems = []; + + for (int i = 0; i < weeks; i++) { + final int start = i * DateTime.daysPerWeek; + + final int end = math.min( + start + DateTime.daysPerWeek, + dayItems.length, + ); + + final List weekList = dayItems.sublist(start, end); + + final DateTime dateAfterLeadingPadding = + DateTime(year, month, start - dayOffset + 1); + + final bool isLeadingInRange = _isLeadingInRange( + dayOffset: dayOffset, + index: i, + dateAfterLeadingPadding: dateAfterLeadingPadding, + ); + + weekList.insert( + 0, + _buildEdgeContainer(context: context, isHighlighted: isLeadingInRange), + ); + + if (end < dayItems.length || + (end == dayItems.length && + dayItems.length % DateTime.daysPerWeek == 0)) { + final DateTime dateBeforeTrailingPadding = + DateTime(year, month, end - dayOffset); + + final bool isTrailingInRange = widget.selectedDateStart != null && + widget.selectedDateEnd != null && + !dateBeforeTrailingPadding.isBefore(widget.selectedDateStart!) && + dateBeforeTrailingPadding.isBefore(widget.selectedDateEnd!); + + weekList.add( + _buildEdgeContainer( + context: context, + isHighlighted: isTrailingInRange, + ), + ); + } + + paddedDayItems.addAll(weekList); + } + + final double maxWidth = _getMaxWidth(context); + + return Column( + children: [ + Container( + constraints: BoxConstraints(maxWidth: maxWidth), + height: _monthItemHeaderHeight, + padding: + const EdgeInsets.symmetric(horizontal: ThemeProvider.margin24), + alignment: AlignmentDirectional.centerStart, + child: ExcludeSemantics( + child: Text( + localizations.formatMonthYear(widget.displayedMonth), + style: context.theme.textStyle( + textStyle: TextStyles.body1, + color: context.theme.colors.general, + ), + ), + ), + ), + Container( + constraints: BoxConstraints( + maxWidth: maxWidth, + maxHeight: gridHeight, + ), + child: GridView.custom( + physics: const NeverScrollableScrollPhysics(), + gridDelegate: _monthItemGridDelegate, + childrenDelegate: SliverChildListDelegate( + paddedDayItems, + addRepaintBoundaries: false, + ), + ), + ), + const SizedBox(height: _monthItemFooterHeight), + ], + ); + } + + Widget _buildDayItem({ + required BuildContext context, + required DateTime dayToBuild, + }) { + final MaterialLocalizations localizations = + MaterialLocalizations.of(context); + + final TextDirection textDirection = Directionality.of(context); + final Color highlightColor = _highlightColor(context); + final int day = dayToBuild.day; + + final bool isDisabled = dayToBuild.isAfter(widget.lastDate) || + dayToBuild.isBefore(widget.firstDate); + + TextStyle itemStyle = context.theme.textStyle( + textStyle: TextStyles.body1, + color: context.theme.colors.general, + ); + + BoxDecoration? decoration; + + final bool isRangeSelected = + widget.selectedDateStart != null && widget.selectedDateEnd != null; + final bool isSelectedDayStart = widget.selectedDateStart != null && + dayToBuild.isAtSameMomentAs(widget.selectedDateStart!); + final bool isSelectedDayEnd = widget.selectedDateEnd != null && + dayToBuild.isAtSameMomentAs(widget.selectedDateEnd!); + final bool isInRange = isRangeSelected && + dayToBuild.isAfter(widget.selectedDateStart!) && + dayToBuild.isBefore(widget.selectedDateEnd!); + + _HighlightPainter? highlightPainter; + + if (isSelectedDayStart || isSelectedDayEnd) { + itemStyle = context.theme.textStyle( + textStyle: itemStyle, color: context.theme.colors.prominent); + + decoration = BoxDecoration( + color: context.theme.colors.coral, + shape: BoxShape.circle, + ); + + if (isRangeSelected && + widget.selectedDateStart != widget.selectedDateEnd) { + final _HighlightPainterStyle style = isSelectedDayStart + ? _HighlightPainterStyle.highlightTrailing + : _HighlightPainterStyle.highlightLeading; + + highlightPainter = _HighlightPainter( + color: highlightColor, + style: style, + textDirection: textDirection, + ); + } + } else if (isInRange) { + highlightPainter = _HighlightPainter( + color: highlightColor, + style: _HighlightPainterStyle.highlightAll, + textDirection: textDirection, + ); + } + if (isDisabled) { + itemStyle = context.theme.textStyle( + textStyle: itemStyle, color: context.theme.colors.disabled); + } else if (isSameDay( + firstDate: widget.currentDate, secondDate: dayToBuild)) { + itemStyle = context.theme.textStyle( + textStyle: itemStyle, color: context.theme.colors.prominent); + + decoration = isSelectedDayStart || isSelectedDayEnd + ? BoxDecoration( + color: context.theme.colors.coral, + shape: BoxShape.circle, + ) + : BoxDecoration( + border: Border.all(color: context.theme.colors.coral), + shape: BoxShape.circle, + ); + } + + String semanticLabel = + '${localizations.formatDecimal(day)}, ${localizations.formatFullDate(dayToBuild)}'; + + if (isSelectedDayStart) { + semanticLabel = + localizations.dateRangeStartDateSemanticLabel(semanticLabel); + } else if (isSelectedDayEnd) { + semanticLabel = + localizations.dateRangeEndDateSemanticLabel(semanticLabel); + } + + Widget dayWidget = Container( + decoration: decoration, + child: Center( + child: Semantics( + label: semanticLabel, + selected: isSelectedDayStart || isSelectedDayEnd, + child: ExcludeSemantics( + child: Text( + localizations.formatDecimal(day), + style: itemStyle, + ), + ), + ), + ), + ); + + if (highlightPainter != null) { + dayWidget = CustomPaint( + painter: highlightPainter, + child: dayWidget, + ); + } + + if (!isDisabled) { + dayWidget = InkResponse( + focusNode: dayFocusNodes[day - 1], + onTap: () => widget.onChanged(dayToBuild), + radius: _monthItemRowHeight / 2 + 4, + splashColor: context.theme.colors.coral.withOpacity( + getOpacity(isEnabled: false), + ), + onFocusChange: _dayFocusChanged, + child: dayWidget, + ); + } + + return dayWidget; + } + + Widget _buildEdgeContainer({ + required BuildContext context, + required bool isHighlighted, + }) => + Container(color: isHighlighted ? _highlightColor(context) : null); + + Color _highlightColor(BuildContext context) => + context.theme.colors.coral.withOpacity(getOpacity(isEnabled: false)); + + void _dayFocusChanged(bool focused) { + if (focused) { + final TraversalDirection? focusDirection = + _FocusedDate.of(context)?.scrollDirection; + + if (focusDirection != null) { + ScrollPositionAlignmentPolicy policy = + ScrollPositionAlignmentPolicy.explicit; + + switch (focusDirection) { + case TraversalDirection.up: + case TraversalDirection.left: + policy = ScrollPositionAlignmentPolicy.keepVisibleAtStart; + break; + case TraversalDirection.right: + case TraversalDirection.down: + policy = ScrollPositionAlignmentPolicy.keepVisibleAtEnd; + break; + } + + Scrollable.ensureVisible( + primaryFocus!.context!, + duration: _monthScrollDuration, + alignmentPolicy: policy, + ); + } + } + } + + bool _isLeadingInRange({ + required int dayOffset, + required int index, + required DateTime dateAfterLeadingPadding, + }) => + !(dayOffset > 0 && index == 0) && + widget.selectedDateStart != null && + widget.selectedDateEnd != null && + dateAfterLeadingPadding.isAfter(widget.selectedDateStart!) && + !dateAfterLeadingPadding.isAfter(widget.selectedDateEnd!); + + double _getMaxWidth(BuildContext context) => + MediaQuery.of(context).orientation == Orientation.landscape + ? _maxCalendarWidthLandscape + : _maxCalendarWidthPortrait; + + @override + void dispose() { + for (final FocusNode node in dayFocusNodes) { + node.dispose(); + } + + super.dispose(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid.dart new file mode 100644 index 000000000..0fe251334 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid.dart @@ -0,0 +1,69 @@ +part of 'calendar_date_range.dart'; + +const _MonthItemGridDelegate _monthItemGridDelegate = _MonthItemGridDelegate(); + +class _MonthSliverGridLayout extends SliverGridLayout { + const _MonthSliverGridLayout({ + required this.crossAxisCount, + required this.dayChildWidth, + required this.edgeChildWidth, + required this.reverseCrossAxis, + }); + + final int crossAxisCount; + final double dayChildWidth; + final double edgeChildWidth; + final bool reverseCrossAxis; + + double get _rowHeight => _monthItemRowHeight + _monthItemSpaceBetweenRows; + + double get _childHeight => _monthItemRowHeight; + + @override + int getMinChildIndexForScrollOffset(double scrollOffset) => + crossAxisCount * (scrollOffset ~/ _rowHeight); + + @override + int getMaxChildIndexForScrollOffset(double scrollOffset) { + final int mainAxisCount = (scrollOffset / _rowHeight).ceil(); + + return math.max(0, crossAxisCount * mainAxisCount - 1); + } + + double _getCrossAxisOffset({ + required double crossAxisStart, + required bool isPadding, + }) => + reverseCrossAxis + ? ((crossAxisCount - 2) * dayChildWidth + 2 * edgeChildWidth) - + crossAxisStart - + (isPadding ? edgeChildWidth : dayChildWidth) + : crossAxisStart; + + @override + SliverGridGeometry getGeometryForChildIndex(int index) { + final int adjustedIndex = index % crossAxisCount; + final bool isEdge = + adjustedIndex == 0 || adjustedIndex == crossAxisCount - 1; + final double crossAxisStart = + math.max(0, (adjustedIndex - 1) * dayChildWidth + edgeChildWidth); + + return SliverGridGeometry( + scrollOffset: (index ~/ crossAxisCount) * _rowHeight, + crossAxisOffset: _getCrossAxisOffset( + crossAxisStart: crossAxisStart, + isPadding: isEdge, + ), + mainAxisExtent: _childHeight, + crossAxisExtent: isEdge ? edgeChildWidth : dayChildWidth, + ); + } + + @override + double computeMaxScrollOffset(int childCount) { + final int mainAxisCount = ((childCount - 1) ~/ crossAxisCount) + 1; + final double mainAxisSpacing = _rowHeight - _childHeight; + + return _rowHeight * mainAxisCount - mainAxisSpacing; + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid_delegate.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid_delegate.dart new file mode 100644 index 000000000..ffdd01764 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid_delegate.dart @@ -0,0 +1,22 @@ +part of 'calendar_date_range.dart'; + +class _MonthItemGridDelegate extends SliverGridDelegate { + const _MonthItemGridDelegate(); + + @override + SliverGridLayout getLayout(SliverConstraints constraints) { + final double tileWidth = + (constraints.crossAxisExtent - 2 * _horizontalPadding) / + DateTime.daysPerWeek; + + return _MonthSliverGridLayout( + crossAxisCount: DateTime.daysPerWeek + 2, + dayChildWidth: tileWidth, + edgeChildWidth: _horizontalPadding, + reverseCrossAxis: axisDirectionIsReversed(constraints.crossAxisDirection), + ); + } + + @override + bool shouldRelayout(_MonthItemGridDelegate oldDelegate) => false; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/selected_date_range.dart b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/selected_date_range.dart new file mode 100644 index 000000000..1fca58353 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/selected_date_range.dart @@ -0,0 +1,113 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +/// Selected date range to show selected start and end date. +class SelectedDateRange extends StatelessWidget { + /// Initializes selected date range. + const SelectedDateRange({ + required this.currentDate, + required this.fieldStartLabelText, + required this.fieldEndLabelText, + this.startDate, + this.endDate, + Key? key, + }) : super(key: key); + + /// Label text for the start date field. + final String fieldStartLabelText; + + /// Label text for the end date field. + final String fieldEndLabelText; + + /// Current date. + final DateTime currentDate; + + /// Start date. + final DateTime? startDate; + + /// End date. + final DateTime? endDate; + + @override + Widget build(BuildContext context) { + final List formattedDateParts = + _getFormattedDateRange(currentDate).split('-'); + + return Expanded( + child: RichText( + overflow: TextOverflow.ellipsis, + text: TextSpan( + text: startDate == null + ? fieldStartLabelText + : formattedDateParts.first, + style: context.theme.textStyle( + textStyle: TextStyles.headlineNormal, + color: context.theme.colors.general.withOpacity( + getOpacity(isEnabled: startDate != null), + ), + ), + children: [ + TextSpan( + text: ' - ', + style: context.theme.textStyle( + textStyle: TextStyles.headlineNormal, + color: context.theme.colors.general.withOpacity( + getOpacity(isEnabled: startDate != null && endDate != null), + ), + ), + ), + TextSpan( + text: + endDate == null ? fieldEndLabelText : formattedDateParts.last, + style: context.theme.textStyle( + textStyle: TextStyles.headlineNormal, + color: context.theme.colors.general.withOpacity( + getOpacity(isEnabled: endDate != null), + ), + ), + ), + ], + ), + ), + ); + } + + String _getFormattedDateRange(DateTime currentDate) { + const String monthDayFormat = 'MMM dd'; + const String monthDayYearFormat = 'MMM dd, yyyy'; + + String? formattedStart; + String? formattedEnd; + + if (startDate != null && endDate != null) { + if (startDate!.year == endDate!.year) { + formattedStart = DateFormat(monthDayFormat).format(startDate!); + formattedEnd = DateFormat(monthDayYearFormat).format(endDate!); + } else { + formattedStart = DateFormat(monthDayYearFormat).format(startDate!); + formattedEnd = DateFormat(monthDayYearFormat).format(endDate!); + } + } else { + if (startDate?.year == currentDate.year || + endDate?.year == currentDate.year) { + formattedStart = startDate == null + ? null + : DateFormat(monthDayFormat).format(startDate!); + formattedEnd = endDate == null + ? null + : DateFormat(monthDayFormat).format(endDate!); + } else { + formattedStart = startDate == null + ? null + : DateFormat(monthDayYearFormat).format(startDate!); + formattedEnd = endDate == null + ? null + : DateFormat(monthDayYearFormat).format(endDate!); + } + } + + return '$formattedStart-$formattedEnd'; + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/device_info.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/device_info.dart new file mode 100644 index 000000000..81093f69c --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/device_info.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +/// Holds device physical information. +class DeviceInfo { + /// device safe area padding. + static EdgeInsets? devicePadding; + + /// Device has notch. + static bool hasTopNotch = false; + + /// base notch value + /// For iOS it's 20 and for Android is 24. 24 can be used for both. + static const double _baseNotchValue = 24; + + /// initializes [DeviceInfo] properties. + static void init(BuildContext context) { + DeviceInfo.devicePadding = MediaQuery.of(context).padding; + DeviceInfo.hasTopNotch = + (DeviceInfo.devicePadding?.top ?? 0) > _baseNotchValue; + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart new file mode 100644 index 000000000..e77560620 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart @@ -0,0 +1,91 @@ +part of '../../presentation/widgets/expandable_bottom_sheet.dart'; + +/// Expandable bottom sheet controller +class ExpandableBottomSheetController { + /// Expandable bottomSheet controller initializer. + ExpandableBottomSheetController({this.animationController}); + + /// Expandable bottomSheet animation controller. + AnimationController? animationController; + + /// Used for enabling/disabling touch events for lower part of [ExpandableBottomSheet]. + bool isLowerContentGestureEnabled = true; + + final StreamController _hintStateStreamController = + StreamController(); + final StreamController _heightStreamController = + StreamController.broadcast(); + final StreamController _isClosedStreamController = + StreamController.broadcast(); + + bool _isHintOpen = false; + double _height = 0; + bool _wasOpen = false; + double _lowerBound = 0; + + /// Expandable bottom sheet hint visibility + bool get isHintOpen => _isHintOpen; + + set isHintOpen(bool value) => + _hintStateStreamController.sink.add(_isHintOpen = value); + + /// Expandable bottom sheet height + double get height => _height; + + set height(double value) => _heightStreamController.sink.add(_height = value); + + /// Closes bottom sheet + void close() { + animationController?.animateBack(0); + _heightStreamController.sink.add(_height = _lowerBound); + isLowerContentGestureEnabled = true; + } + + /// Shows expandable bottom sheet is open or close + bool get isOpen => _height > _lowerBound; + + /// Gets hint state stream + Stream get hintStateStream => _hintStateStreamController.stream; + + /// Gets height stream + Stream get heightStream => _heightStreamController.stream; + + /// Gets isClosed stream + Stream? get isClosedStream => _isClosedStreamController.stream; + + /// Gets lower bound of bottom sheet. (bottom sheet offset) + double get lowerBound => _lowerBound; + + /// Initialize tasks for [ExpandableBottomSheetController] properties. should get called after [animationController] get initialized. + void init() { + animationController?.addListener(() { + final bool isOpen = animationController!.value > 0; + + if (!isOpen && _wasOpen) { + _isClosedStreamController.sink.add(true); + _wasOpen = false; + } + + if (isOpen && !_wasOpen) { + _isClosedStreamController.sink.add(false); + _wasOpen = true; + } + }); + } + + /// Changes lowerBound value of [ExpandableBottomSheet]. + void changeLowerBound(double toValue) { + _lowerBound = toValue; + + if (!isOpen) { + height = _lowerBound; + } + } + + /// Disposes stream controller + void dispose() { + _hintStateStreamController.close(); + _isClosedStreamController.close(); + _heightStreamController.close(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart new file mode 100644 index 000000000..90777ab57 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart @@ -0,0 +1,2 @@ +export 'presentation/widgets/expandable_bottom_sheet.dart'; +export 'core/utils/device_info.dart'; diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart new file mode 100644 index 000000000..4109f5f52 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart @@ -0,0 +1,93 @@ + +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; + +/// Custom Tooltip class. +class CustomTooltip extends StatefulWidget { + /// Initializes the custom tooltip class. + const CustomTooltip({ + required this.message, + required this.child, + required this.tooltipKey, + this.paddingHorizontal, + this.paddingVertical, + this.borderRadius, + this.backgroundColor, + this.textStyle, + this.preferBelow = true, + }); + + /// Message to be displayed in tooltip. + final String message; + + /// Widget that displays tooltip when tapped/ long pressed. + final Widget child; + + /// Unique identifier for Widgets with tooltip. + final GlobalKey tooltipKey; + + /// Horizontal padding for tooltip. + /// + /// Default to `ThemeProvider.margin16`. + final double? paddingHorizontal; + + /// Vertical padding for tooltip. + /// + /// Default to `ThemeProvider.margin08`. + final double? paddingVertical; + + /// Border radius for tooltip. + /// + /// Default to `ThemeProvider.borderRadius08`. + final double? borderRadius; + + /// Background colour for tooltip. + /// + /// Default to `theme.base06Color`. + final Color? backgroundColor; + + /// TextStyle for tooltip message. + /// + /// Default to `TextStyles.caption`. + final TextStyle? textStyle; + + /// Whether the tooltip defaults to being displayed below the widget. + /// + /// Defaults to true. If there is insufficient space to display the tooltip in + /// the preferred direction, the tooltip will be displayed in the opposite + /// direction. + final bool preferBelow; + + @override + _CustomTooltipState createState() => _CustomTooltipState(); +} + +class _CustomTooltipState extends State { + @override + Widget build(BuildContext context) => Tooltip( + key: widget.tooltipKey, + child: InkWell( + child: widget.child, + onTap: () => showToolTipMessage(widget.tooltipKey)), + message: widget.message, + textStyle: widget.textStyle ?? TextStyles.caption, + padding: EdgeInsets.symmetric( + horizontal: widget.paddingHorizontal ?? ThemeProvider.margin16, + vertical: widget.paddingVertical ?? ThemeProvider.margin08, + ), + decoration: BoxDecoration( + color: widget.backgroundColor ?? context.theme.colors.hover, + borderRadius: BorderRadius.circular( + widget.borderRadius ?? ThemeProvider.borderRadius08, + ), + ), + preferBelow: widget.preferBelow, + ); +} + +/// Display the tooltip. +void showToolTipMessage(GlobalKey toolTipKey) { + final dynamic tooltip = toolTipKey.currentState; + + tooltip.ensureTooltipVisible(); +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart new file mode 100644 index 000000000..11991bbe4 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart @@ -0,0 +1,381 @@ +library deriv_expandable_bottom_sheet; + +import 'dart:async'; +import 'dart:math'; + +import '../../core/utils/device_info.dart'; +import 'custom_tooltip.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; + +part '../../core/utils/expandable_bottom_sheet_controller.dart'; +part 'expandable_bottom_sheet_hint_button.dart'; +part 'expandable_bottom_sheet_lower_content.dart'; +part '../../states/expandable_bottom_sheet_provider.dart'; +part 'expandable_bottom_sheet_title.dart'; +part 'expandable_bottom_sheet_title_bar.dart'; +part 'expandable_bottom_sheet_toggler.dart'; +part 'expandable_bottom_sheet_upper_content.dart'; + +/// Expandable bottom sheet widget +class ExpandableBottomSheet extends StatefulWidget { + /// This widget helps showing an expandable bottom sheet with [title], [upperContent] and [lowerContent] parts. + /// + /// All properties are optional. + /// You can set [openMaximized] to true, if you want to open bottom sheet in full size. + /// By default height in minimize state is calculated by [upperContent], + /// but if you set [maxHeight] and [lowerContent], that value will be overridden. + const ExpandableBottomSheet({ + required this.labelContractDetails, + required this.upperContent, + this.title, + this.controller, + this.hint, + this.leftAction, + this.rightAction, + this.onOpen, + this.onClosed, + this.lowerContent, + this.fullScreenMode = false, + this.showToggler = true, + this.maxHeight, + this.openMaximized = false, + this.dismissible = true, + this.changeStateDuration = + const Duration(milliseconds: _defaultChangeStateDuration), + this.onClose, + this.onToggle, + this.onDismiss, + Key? key, + }) : super(key: key); + + /// Label for the contract details + final String labelContractDetails; + + /// Expandable BottomSheet Controller + /// + /// A controller can be passed to the bottom sheet to get control of its functionalities (for example: closing or opening bottom sheet). + final ExpandableBottomSheetController? controller; + + /// Upper content widget + /// + /// This part will be shown in close and open state + final Widget upperContent; + + /// Lower content widget + /// + /// This part will be shown in open state + final Widget? lowerContent; + + /// Expandable bottom sheet title + /// + /// Title part will be invisible if [title] not set + final String? title; + + /// Expandable bottom sheet hint + /// + /// Hint button will be invisible if [hint] or [title] not set + /// If [hint] has been set, [right Action] won't be accessible anymore. + final String? hint; + + /// Action placed on left side of the title + final Widget? leftAction; + + /// Action placed on right side of the title + /// + /// If [hint] has been set, [right Action] won't be accessible anymore. + final Widget? rightAction; + + /// Sets toggler visibility + /// + /// If value sets to `false`, `dragging` and `toggle` actions will be disabled. + /// Default value is `true` + final bool showToggler; + + /// Sets maximum height for expandable bottom sheet + /// + /// Expandable bottom sheet will be full screen if [maxHeight] not set + final double? maxHeight; + + /// Opens expandable bottom sheet in maximized state + /// + /// Default value is `false` + final bool openMaximized; + + /// Defines whether the bottom sheet should get closed when user swipes it down. + /// + /// Default value is `true`. + final bool dismissible; + + /// Defines whether the bottom sheet would be in full-screen mode when its open. + /// + /// Default value is `false`. + final bool fullScreenMode; + + /// Change state animation duration + /// + /// Default value is `350 milliseconds` + final Duration changeStateDuration; + + /// [onOpen] callback + /// This callback will be called when expandable bottom sheet is open + final VoidCallback? onOpen; + + /// [onClose] callback + /// This callback will be called when expandable bottom sheet is close + final VoidCallback? onClose; + + /// [onClosed] callback + /// This callback will be called when expandable bottom sheet already closed. + final VoidCallback? onClosed; + + /// [onToggle] callback + /// This callback will be called when toggle expandable bottom sheet + final VoidCallback? onToggle; + + /// [onDismiss] callback + /// This callback will be called on expandable bottom sheet dismiss + final VoidCallback? onDismiss; + + /// Default value for animation duration of bottom sheet in milliseconds. + static const int _defaultChangeStateDuration = 350; + + @override + _ExpandableBottomSheetState createState() => _ExpandableBottomSheetState(); +} + +class _ExpandableBottomSheetState extends State + with TickerProviderStateMixin { + static const double _velocityThreshold = 100; + + late double _upperContentHeight; + PointerDownEvent? _dragStartDetails; + ExpandableBottomSheetController? _controller; + late AnimationController _animationController; + + @override + void initState() { + super.initState(); + + _animationController = AnimationController( + vsync: this, + duration: const Duration( + milliseconds: ExpandableBottomSheet._defaultChangeStateDuration), + value: 0, + ); + + if (widget.controller == null) { + _controller = ExpandableBottomSheetController( + animationController: _animationController); + } else { + _controller = widget.controller + ?..animationController = _animationController; + } + + _controller?.init(); + _controller?.isClosedStream?.listen((bool isClosed) { + if (isClosed) { + widget.onClosed?.call(); + } + }); + + if (widget.lowerContent != null && widget.openMaximized) { + SchedulerBinding.instance.addPostFrameCallback( + (_) => Future.delayed(Duration.zero, open), + ); + } + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + if (_controller != null && _controller!.isOpen) { + open(withCallback: false); + } else { + close(withCallback: false); + } + } + + @override + Widget build(BuildContext context) { + final double expandableBottomSheetTogglerHeight = + widget.showToggler ? 10 : 0; + + return ExpandableBottomSheetProvider( + controller: _controller, + upperContent: widget.upperContent, + lowerContent: widget.lowerContent, + title: widget.title, + fullScreenMode: widget.fullScreenMode, + openBottomSheet: open, + hint: widget.hint, + leftAction: Padding( + padding: EdgeInsets.only(top: expandableBottomSheetTogglerHeight), + child: widget.leftAction, + ), + rightAction: Padding( + padding: EdgeInsets.only(top: expandableBottomSheetTogglerHeight), + child: widget.rightAction, + ), + showToggler: widget.showToggler, + changeStateDuration: widget.changeStateDuration, + onVerticalDragEnd: widget.showToggler ? _onVerticalDragEnd : null, + onVerticalDragUpdate: widget.showToggler ? _onVerticalDragUpdate : null, + onTogglerTap: widget.showToggler ? _onTogglerTap : null, + child: Container( + decoration: BoxDecoration( + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(ThemeProvider.borderRadius16), + topRight: Radius.circular(ThemeProvider.borderRadius16), + ), + color: context.theme.colors.secondary, + ), + child: ListView( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + children: [ + GestureDetector( + behavior: HitTestBehavior.translucent, + onVerticalDragUpdate: _onVerticalDragUpdate, + onVerticalDragEnd: _onVerticalDragEnd, + child: Column( + children: [ + _ExpandableBottomSheetTitleBar( + labelContractDetails: widget.labelContractDetails, + ), + _ExpandableBottomSheetUpperContent( + onHeightCalculated: (double height) => + _upperContentHeight = height, + onHeightChanged: () => _controller!.height = + _controller!.isOpen ? _getAvailableHeight() : 0, + ), + ], + ), + ), + widget.lowerContent == null + ? const SizedBox.shrink() + : Listener( + onPointerDown: (PointerDownEvent details) => + _dragStartDetails = details, + onPointerMove: _onLowerContentPointerMove, + onPointerUp: (PointerUpEvent details) => + _onVerticalDragEnd(DragEndDetails()), + child: const _ExpandableBottomSheetLowerContent(), + ), + ], + ), + ), + ); + } + + void _onLowerContentPointerMove(PointerMoveEvent details) { + if (_dragStartDetails == null || + !_controller!.isLowerContentGestureEnabled) { + return; + } + + if (_hasPassedScrollThreshold(details)) { + _onVerticalDragUpdate( + DragUpdateDetails( + delta: details.delta, + globalPosition: details.position, + ), + ); + } + } + + void _onVerticalDragUpdate(DragUpdateDetails data) { + if (data.delta.dy != 0.0) { + if (_controller!.height - data.delta.dy > 0 && + _controller!.height - data.delta.dy < _getAvailableHeight()) { + _controller!.height -= data.delta.dy; + _animationController.value = + (_controller!.height - _controller!.lowerBound) / + (_getAvailableHeight() - _controller!.lowerBound); + } + } + } + + void _onVerticalDragEnd(DragEndDetails data) { + if (widget.lowerContent == null) { + if (widget.dismissible) { + close(dismiss: !_controller!.isOpen); + } + } else { + if (data.velocity.pixelsPerSecond.dy.abs() > _velocityThreshold) { + data.primaryVelocity!.isNegative ? open() : close(); + } else { + _controller!.height >= (_getAvailableHeight() / 2) ? open() : close(); + } + } + } + + void _onTogglerTap() { + widget.onToggle?.call(); + + _controller!.isOpen ? close() : open(); + } + + void open({bool withCallback = true}) { + if (withCallback) { + widget.onOpen?.call(); + + _closeHintBubble(); + } + + _animationController.forward(); + _controller!.height = _getAvailableHeight(); + } + + void close({ + bool withCallback = true, + bool dismiss = false, + }) { + if (withCallback) { + dismiss ? widget.onDismiss?.call() : widget.onClose?.call(); + + _closeHintBubble(); + } + + _controller?.close(); + + if (dismiss) { + Navigator.pop(context); + } + } + + void _closeHintBubble() { + if (_controller!.isHintOpen) { + _controller!.isHintOpen = false; + } + } + + bool _hasPassedScrollThreshold(PointerMoveEvent details) => + (details.position.dy - (_dragStartDetails?.position.dy ?? 0)).abs() > 30; + + double _getAppBarHeight() => AppBar().preferredSize.height; + + double _getDeviceAvailableHeight() => + MediaQuery.of(context).size.height - + (DeviceInfo.devicePadding?.top ?? 0) - + (DeviceInfo.devicePadding?.bottom ?? 0); + + double _getAvailableHeight() { + final double availableHeight = + _getDeviceAvailableHeight() - _getAppBarHeight(); + + return (widget.maxHeight == null + ? availableHeight + : min(widget.maxHeight!, availableHeight)) - + _upperContentHeight; + } + + @override + void dispose() { + _controller?.dispose(); + _animationController.dispose(); + super.dispose(); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart new file mode 100644 index 000000000..c7c0431ab --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart @@ -0,0 +1,37 @@ +part of 'expandable_bottom_sheet.dart'; + +class _ExpandableBottomSheetHintButton extends StatelessWidget { + + _ExpandableBottomSheetHintButton({Key? key}) : super(key: key); + + final GlobalKey _hintKey = GlobalKey(); + + @override + Widget build(BuildContext context) { + final ExpandableBottomSheetProvider expandableBottomSheetProvider = + ExpandableBottomSheetProvider.of(context)!; + + return expandableBottomSheetProvider.title == null || + expandableBottomSheetProvider.hint == null + ? const SizedBox.shrink() + : Padding( + padding: + const EdgeInsets.symmetric(vertical: ThemeProvider.margin12), + child: ClipOval( + child: Material( + color: Colors.transparent, + child: CustomTooltip( + message: expandableBottomSheetProvider.hint ?? '', + tooltipKey: _hintKey, + preferBelow: false, + child: Icon( + Icons.info_outline, + size: ThemeProvider.iconSize24, + color: context.theme.colors.disabled, + ), + ), + ), + ), + ); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart new file mode 100644 index 000000000..266c72dc6 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart @@ -0,0 +1,23 @@ +part of 'expandable_bottom_sheet.dart'; + +class _ExpandableBottomSheetLowerContent extends StatelessWidget { + const _ExpandableBottomSheetLowerContent({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final ExpandableBottomSheetProvider provider = + ExpandableBottomSheetProvider.of(context)!; + + return StreamBuilder( + stream: provider.controller?.heightStream, + initialData: provider.controller?.height, + builder: (BuildContext context, AsyncSnapshot snapshot) => + AnimatedContainer( + curve: Curves.easeOut, + duration: provider.changeStateDuration!, + height: snapshot.data, + child: provider.lowerContent, + ), + ); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart new file mode 100644 index 000000000..e8e99ac75 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart @@ -0,0 +1,33 @@ +part of 'expandable_bottom_sheet.dart'; + +class _ExpandableBottomSheetTitle extends StatelessWidget { + const _ExpandableBottomSheetTitle({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final ExpandableBottomSheetProvider expandableBottomSheetProvider = + ExpandableBottomSheetProvider.of(context)!; + + return expandableBottomSheetProvider.title == null + ? const SizedBox.shrink() + : GestureDetector( + behavior: HitTestBehavior.translucent, + onVerticalDragUpdate: + expandableBottomSheetProvider.onVerticalDragUpdate, + onVerticalDragEnd: expandableBottomSheetProvider.onVerticalDragEnd, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 14), + child: Text( + expandableBottomSheetProvider.title!, + style: context.theme.textStyle( + textStyle: TextStyles.subheading, + color: context.theme.colors.prominent, + ), + ), + ), + onTap: expandableBottomSheetProvider.fullScreenMode! + ? null + : expandableBottomSheetProvider.onTogglerTap, + ); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart new file mode 100644 index 000000000..cae3ee5dc --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart @@ -0,0 +1,106 @@ +part of 'expandable_bottom_sheet.dart'; + +class _ExpandableBottomSheetTitleBar extends StatelessWidget { + const _ExpandableBottomSheetTitleBar( + {required this.labelContractDetails, Key? key}) + : super(key: key); + + final String labelContractDetails; + + @override + Widget build(BuildContext context) { + final ExpandableBottomSheetProvider expandableBottomSheetProvider = + ExpandableBottomSheetProvider.of(context)!; + final AnimationController animationController = + expandableBottomSheetProvider.controller!.animationController!; + + return (expandableBottomSheetProvider.fullScreenMode != null && + expandableBottomSheetProvider.fullScreenMode!) + ? AnimatedBuilder( + animation: animationController, + builder: (BuildContext animatedBuilderContext, _) => Column( + children: [ + if (expandableBottomSheetProvider.showToggler) + Align( + heightFactor: 1 - animationController.value, + child: Opacity( + opacity: 1 - animationController.value, + child: const _ExpandableBottomSheetToggler(), + ), + ), + Align( + heightFactor: animationController.value, + child: Opacity( + opacity: animationController.value, + child: AppBar( + elevation: ThemeProvider.zeroMargin, + leading: IconButton( + onPressed: () { + expandableBottomSheetProvider.onTogglerTap?.call(); + expandableBottomSheetProvider.controller?.close(); + }, + icon: const Icon(Icons.expand_more), + ), + title: Text(labelContractDetails), + ), + ), + ), + ], + ), + ) + : _buildTitleBar(expandableBottomSheetProvider); + } + + Widget _buildTitleBar( + ExpandableBottomSheetProvider expandableBottomSheetProvider, + ) { + final double expandableBottomSheetTogglerHeight = + expandableBottomSheetProvider.showToggler ? 20 : 0; + + return StreamBuilder( + stream: expandableBottomSheetProvider.controller?.hintStateStream, + initialData: false, + builder: (BuildContext context, AsyncSnapshot snapshot) => + Container( + width: double.infinity, + child: Stack( + alignment: Alignment.center, + children: [ + Column( + children: [ + if (expandableBottomSheetProvider.showToggler) + const _ExpandableBottomSheetToggler(), + const _ExpandableBottomSheetTitle(), + ], + ), + if (_isLeftActionVisible(expandableBottomSheetProvider)) + Positioned( + child: expandableBottomSheetProvider.leftAction!, + top: expandableBottomSheetTogglerHeight, + left: ThemeProvider.margin16, + ), + if (_isRightActionVisible(expandableBottomSheetProvider)) + Positioned( + child: expandableBottomSheetProvider.rightAction!, + top: expandableBottomSheetTogglerHeight, + right: ThemeProvider.margin16, + ), + Positioned( + child: _ExpandableBottomSheetHintButton(), + top: expandableBottomSheetTogglerHeight, + right: ThemeProvider.margin16, + ), + ], + ), + ), + ); + } + + bool _isLeftActionVisible(ExpandableBottomSheetProvider provider) => + provider.title != null && provider.leftAction != null; + + bool _isRightActionVisible(ExpandableBottomSheetProvider provider) => + provider.title != null && + provider.hint == null && + provider.rightAction != null; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart new file mode 100644 index 000000000..067980bbe --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart @@ -0,0 +1,32 @@ +part of 'expandable_bottom_sheet.dart'; + +class _ExpandableBottomSheetToggler extends StatelessWidget { + const _ExpandableBottomSheetToggler({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final ExpandableBottomSheetProvider expandableBottomSheetProvider = + ExpandableBottomSheetProvider.of(context)!; + + return GestureDetector( + behavior: HitTestBehavior.translucent, + onVerticalDragUpdate: expandableBottomSheetProvider.onVerticalDragUpdate, + onVerticalDragEnd: expandableBottomSheetProvider.onVerticalDragEnd, + child: Center( + child: Container( + margin: const EdgeInsets.symmetric( + vertical: ThemeProvider.margin08, + horizontal: ThemeProvider.margin32, + ), + height: ThemeProvider.margin04, + width: ThemeProvider.margin40, + decoration: BoxDecoration( + color: context.theme.colors.active, + borderRadius: BorderRadius.circular(ThemeProvider.borderRadius04), + ), + ), + ), + onTap: expandableBottomSheetProvider.onTogglerTap, + ); + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart new file mode 100644 index 000000000..2b8451f34 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart @@ -0,0 +1,54 @@ +part of 'expandable_bottom_sheet.dart'; + +/// Function signature for `HeightCalculatedHandler`. +typedef HeightCalculatedHandler = void Function(double); + +class _ExpandableBottomSheetUpperContent extends StatefulWidget { + const _ExpandableBottomSheetUpperContent({ + required this.onHeightCalculated, + this.onHeightChanged, + Key? key, + }) : super(key: key); + + final HeightCalculatedHandler onHeightCalculated; + final VoidCallback? onHeightChanged; + + @override + _ExpandableBottomSheetUpperContentState createState() => + _ExpandableBottomSheetUpperContentState(); +} + +class _ExpandableBottomSheetUpperContentState + extends State<_ExpandableBottomSheetUpperContent> { + @override + Widget build(BuildContext context) { + final Widget? upperContent = + ExpandableBottomSheetProvider.of(context)?.upperContent; + + return Builder( + builder: (BuildContext context) { + SchedulerBinding.instance.addPostFrameCallback( + (_) => widget.onHeightCalculated(context.size!.height), + ); + + return NotificationListener( + onNotification: (_) => _heightChangeHandler(context), + child: SizeChangedLayoutNotifier( + child: upperContent ?? const SizedBox.shrink(), + ), + ); + }, + ); + } + + bool _heightChangeHandler(BuildContext context) { + SchedulerBinding.instance.addPostFrameCallback((_) { + if (mounted) { + widget.onHeightCalculated(context.size!.height); + widget.onHeightChanged?.call(); + } + }); + + return true; + } +} diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart new file mode 100644 index 000000000..8c76a62ee --- /dev/null +++ b/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart @@ -0,0 +1,96 @@ +part of '../presentation/widgets/expandable_bottom_sheet.dart'; + +/// Provider of [ExpandableBottomSheet]. +class ExpandableBottomSheetProvider extends InheritedWidget { + /// Default constructor of [ExpandableBottomSheetProvider]. + const ExpandableBottomSheetProvider({ + required Widget child, + required this.controller, + required this.leftAction, + required this.rightAction, + required this.showToggler, + required this.fullScreenMode, + this.upperContent, + this.lowerContent, + this.title, + this.hint, + this.changeStateDuration, + this.onVerticalDragUpdate, + this.onVerticalDragEnd, + this.onTogglerTap, + this.openBottomSheet, + }) : super(child: child); + + /// Expandable BottomSheet Controller + /// + /// A controller can be passed to the bottom sheet to get control of its functionalities (for example: closing or opening bottom sheet). + final ExpandableBottomSheetController? controller; + + /// Upper content widget + /// + /// This part will be shown in close and open state + final Widget? upperContent; + + /// Lower content widget + /// + /// This part will be shown in open state + final Widget? lowerContent; + + /// Expandable bottom sheet title + /// + /// Title part will be invisible if [title] not set + final String? title; + + /// Expandable bottom sheet hint + /// + /// Hint button will be invisible if [hint] or [title] not set + /// If [hint] has been set, [right Action] won't be accessible anymore. + final String? hint; + + /// Action placed on left side of the title + final Widget? leftAction; + + /// Action placed on right side of the title + /// + /// If [hint] has been set, [right Action] won't be accessible anymore. + final Widget? rightAction; + + /// Sets toggler visibility + /// + /// If value sets to `false`, `dragging` and `toggle` actions will be disabled. + /// Default value is `true` + final bool showToggler; + + /// Defines whether the bottom sheet would be in full-screen mode when its open. + /// + /// Default value is `false`. + final bool? fullScreenMode; + + /// Change state animation duration + /// + /// Default value is `350 milliseconds` + final Duration? changeStateDuration; + + /// [onVerticalDragUpdate] callback + /// This callback will be called when drag gesture updates. + final GestureDragUpdateCallback? onVerticalDragUpdate; + + /// [onVerticalDragEnd] callback + /// This callback will be called when drag gesture end. + final GestureDragEndCallback? onVerticalDragEnd; + + /// [onTogglerTap] callback + /// This callback will be called when toggle expandable bottom sheet + final VoidCallback? onTogglerTap; + + /// [openBottomSheet] callback + /// This callback can be invoke to open bottom sheet. + final VoidCallback? openBottomSheet; + + /// Gets nearest instance of [ExpandableBottomSheetProvider] in widget tree. + static ExpandableBottomSheetProvider? of(BuildContext context) => context + .dependOnInheritedWidgetOfExactType(); + + @override + bool updateShouldNotify(InheritedWidget oldWidget) => true; +} diff --git a/packages/deriv_ui/lib/presentation/widgets/widgets.dart b/packages/deriv_ui/lib/presentation/widgets/widgets.dart index 4be9549dc..d8637e6b9 100644 --- a/packages/deriv_ui/lib/presentation/widgets/widgets.dart +++ b/packages/deriv_ui/lib/presentation/widgets/widgets.dart @@ -12,3 +12,6 @@ export 'popup_alert_dialog.dart'; export 'primary_button.dart'; export 'secondary_button.dart'; export 'text_span_hyperlink.dart'; +export 'banner/banner.dart'; +export 'date_range_picker/deriv_date_range_picker.dart'; +export 'expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart'; diff --git a/packages/deriv_ui/pubspec.yaml b/packages/deriv_ui/pubspec.yaml index e90bfc4ca..279eead69 100644 --- a/packages/deriv_ui/pubspec.yaml +++ b/packages/deriv_ui/pubspec.yaml @@ -10,6 +10,8 @@ environment: dependencies: flutter: sdk: flutter + flutter_localizations: + sdk: flutter deriv_theme: git: @@ -24,6 +26,7 @@ dependencies: ref: deriv_web_view-v0.0.1+1 flutter_svg: ^1.0.3 + intl: ^0.18.0 dev_dependencies: flutter_test: @@ -36,6 +39,7 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: + generate: true # To add assets to your package, add an assets section, like this: assets: - assets/icons/ diff --git a/packages/deriv_ui/test/presentation/widgets/banner/stacked_banner_test.dart b/packages/deriv_ui/test/presentation/widgets/banner/stacked_banner_test.dart new file mode 100644 index 000000000..7473219b4 --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/banner/stacked_banner_test.dart @@ -0,0 +1,46 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('Stacked banner', () { + late StackedBannerController controller; + setUp(() { + controller = StackedBannerController(); + }); + + testWidgets('add item works', (WidgetTester tester) async { + await tester.pumpWidget(_BannerWrapper(controller: controller)); + + controller.addItem(const Text('MockItem1')); + + await tester.pumpAndSettle(); + + expect(find.text('MockItem1'), findsNWidgets(1)); + }); + + testWidgets('remove item works', (WidgetTester tester) async { + await tester.pumpWidget(_BannerWrapper(controller: controller)); + + const Widget item = Text('MockItem1'); + + controller.addItem(item); + + await tester.pumpAndSettle(); + + controller.removeItem(item); + await tester.pumpAndSettle(); + + expect(find.text('MockItem1'), findsNothing); + }); + }); +} + +class _BannerWrapper extends StatelessWidget { + const _BannerWrapper({required this.controller, Key? key}) : super(key: key); + final StackedBannerController controller; + + @override + Widget build(BuildContext context) => + MaterialApp(home: StackedBanner(controller: controller)); +} diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/date_input_formatter_test.dart b/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/date_input_formatter_test.dart new file mode 100644 index 000000000..9e7edfd8d --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/date_input_formatter_test.dart @@ -0,0 +1,45 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('DateInputFormatter', () { + late DateInputFormatter formatter; + + setUp(() { + formatter = DateInputFormatter(); + }); + + test('should format text as a hyphened date', () { + const TextEditingValue oldValue = TextEditingValue(text: '01012021'); + const TextEditingValue newValue = TextEditingValue(text: '01012021'); + final TextEditingValue updatedValue = + formatter.formatEditUpdate(oldValue, newValue); + + expect(updatedValue.text, '01-01-2021'); + }); + + test('should remove non-numeric characters', () { + const TextEditingValue oldValue = TextEditingValue(text: '01-01-2021'); + const TextEditingValue newValue = TextEditingValue( + text: '01a&01-2021x', + selection: TextSelection.collapsed(offset: 14), + ); + + final TextEditingValue formattedValue = + formatter.formatEditUpdate(oldValue, newValue); + + expect(formattedValue.text, '01-01-2021'); + }); + + test('should preserve cursor position', () { + const TextEditingValue oldValue = TextEditingValue( + text: '01012021', selection: TextSelection.collapsed(offset: 4)); + const TextEditingValue newValue = TextEditingValue(text: '01012021'); + final TextEditingValue updatedValue = + formatter.formatEditUpdate(oldValue, newValue); + + expect(updatedValue.selection.baseOffset, 6); + }); + }); +} diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/debug_test.dart b/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/debug_test.dart new file mode 100644 index 000000000..ca83628ff --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/debug_test.dart @@ -0,0 +1,42 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('debugCheckHasDateRangeLocalizations asserts correctly', + (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + localizationsDelegates: const >[ + DateRangeLocalizations.delegate, + ], + home: Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + minAllowedDate: DateTime(2022), + maxAllowedDate: DateTime(2023), + )), + ), + ); + + expect(tester.takeException(), isNull); + }); + + testWidgets( + 'debugCheckHasDateRangeLocalizations throws error when DateRangeLocalizations is not found', + (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + home: Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + minAllowedDate: DateTime(2022), + maxAllowedDate: DateTime(2023), + )), + ), + ); + + final FlutterError error = tester.takeException() as FlutterError; + expect(error.message.contains('No DateRangeLocalizations found.'), true); + }); +} diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/helper_test.dart b/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/helper_test.dart new file mode 100644 index 000000000..6645d8b32 --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/helper_test.dart @@ -0,0 +1,114 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('getDateFromDateTime returns DateTime with only date', () { + final DateTime date = DateTime(2023, 5, 18, 10, 30); + final DateTime result = getDateFromDateTime(date); + + expect(result, DateTime(2023, 5, 18)); + }); + + group('isSameDay', () { + test('returns true when both dates are in the same day, month and year', + () { + final DateTime firstDate = DateTime(2023, 5, 18); + final DateTime secondDate = DateTime(2023, 5, 18, 10, 30); + final bool result = + isSameDay(firstDate: firstDate, secondDate: secondDate); + + expect(result, true); + }); + + test('returns false when dates are in different days', () { + final DateTime firstDate = DateTime(2023, 5, 18); + final DateTime secondDate = DateTime(2023, 5, 19); + final bool result = + isSameDay(firstDate: firstDate, secondDate: secondDate); + + expect(result, false); + }); + }); + + group('isSameMonth', () { + test('returns true when both dates are in the same month', () { + final DateTime firstDate = DateTime(2023, 5, 18); + final DateTime secondDate = DateTime(2023, 5, 28); + final bool result = + isSameMonth(firstDate: firstDate, secondDate: secondDate); + + expect(result, true); + }); + + test('returns false when dates are in different months', () { + final DateTime firstDate = DateTime(2023, 5, 18); + final DateTime secondDate = DateTime(2023, 6, 28); + final bool result = + isSameMonth(firstDate: firstDate, secondDate: secondDate); + + expect(result, false); + }); + }); + + test('monthDelta returns the number of months between two DateTime objects', + () { + final DateTime startDate = DateTime(2023); + final DateTime endDate = DateTime(2023, 3, 15); + final int result = monthDelta(startDate: startDate, endDate: endDate); + + expect(result, 2); + }); + + test('addDaysToDate returns DateTime with added days and no time set', () { + final DateTime date = DateTime(2023, 5, 18); // May 18, 2023 + final DateTime result = addDaysToDate(date: date, days: 5); + + expect(result.year, 2023); + expect(result.month, 5); + expect(result.day, 23); // Adding 5 days to May 18 results in May 23 + expect(result.hour, 0); // No time set + }); + + group('parseDate', () { + test('returns InputDateModel with parsed DateTime', () { + const String date = '18-05-2023'; + final InputDateModel result = parseDate(date: date); + + expect(result.isValidOrNull, true); + expect(result.dateTime, DateTime(2023, 5, 18)); + }); + + test('returns InputDateModel with null DateTime when date is invalid', () { + const String date = '18-05-2023-'; + final InputDateModel result = parseDate(date: date); + + expect(result.isValidOrNull, false); + expect(result.dateTime, null); + }); + + test('returns InputDateModel with null DateTime when date is null', () { + const String date = ''; + final InputDateModel result = parseDate(date: date); + + expect(result.isValidOrNull, true); + expect(result.dateTime, null); + }); + + test( + 'returns InputDateModel with isValidOrNull false when year is not four digits', + () { + const String date = '18-05-23'; // Year is not four digits + final InputDateModel result = parseDate(date: date); + + expect(result.isValidOrNull, false); + expect(result.dateTime, null); + }); + }); + + test('getOpacity returns the appropriate opacity value', () { + const bool isEnabled = true; + final double result = getOpacity(isEnabled: isEnabled); + + expect(result, 1.0); + }); +} diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/date_range_picker_test.dart b/packages/deriv_ui/test/presentation/widgets/date_range_picker/date_range_picker_test.dart new file mode 100644 index 000000000..edbd2a69f --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/date_range_picker/date_range_picker_test.dart @@ -0,0 +1,319 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../../../pump_app.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + late DateRangeLocalizations localization; + + setUpAll(() async => localization = + await DateRangeLocalizations.delegate.load(const Locale('en'))); + + group(' Date Range Picker Calendar Mode =>', () { + testWidgets( + 'should show start and end label if initial start date and initial end date is not set.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11, 20), + maxAllowedDate: DateTime(currentTime.year + 1, 11, 25), + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is RichText && + widget.text.toPlainText() == + '${localization.labelStartDate} - ${localization.labelEndDate}', + ), + findsOneWidget, + ); + }); + + testWidgets( + 'should show start and end date if initial start date and initial end date is set in same year.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + initialStartDate: DateTime(currentTime.year, 11, 10), + initialEndDate: DateTime(currentTime.year, 11, 19), + context: context, + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate((Widget widget) => + widget is RichText && + widget.text.toPlainText() == + 'Nov 10 - Nov 19, ${currentTime.year}'), + findsOneWidget, + ); + }); + + testWidgets( + 'should show start and end date if initial start date and initial end date is set in different years.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + initialStartDate: DateTime(currentTime.year - 1, 11, 10), + initialEndDate: DateTime(currentTime.year, 11, 19), + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is RichText && + widget.text.toPlainText() == + 'Nov 10, ${currentTime.year - 1} - Nov 19, ${currentTime.year}', + ), + findsOneWidget, + ); + }); + + testWidgets( + 'should show start if initial start date is set and initial end date is not set. also, year is not equal to current date year.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + initialStartDate: DateTime(currentTime.year - 1, 11, 10), + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is RichText && + widget.text.toPlainText() == + 'Nov 10, ${currentTime.year - 1} - ${localization.labelEndDate}', + ), + findsOneWidget, + ); + }); + + testWidgets( + 'should show start date if initial start date is set and initial end date is not set. also, year is equal to current date year.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year + 1, 11, 25), + initialStartDate: DateTime(currentTime.year, 11, 10), + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is RichText && + widget.text.toPlainText() == + 'Nov 10 - ${localization.labelEndDate}', + ), + findsOneWidget, + ); + }); + + testWidgets( + 'should show end date if initial end date is set and initial start date is not set. also, year is not equal to current date year.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + initialEndDate: DateTime(currentTime.year - 1, 11, 10), + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is RichText && + widget.text.toPlainText() == + '${localization.labelStartDate} - Nov 10, ${currentTime.year - 1}', + ), + findsOneWidget, + ); + }); + + testWidgets( + 'should show end date if initial end date is set and initial start date is not set. also, year is equal to current date year.', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + initialEndDate: DateTime(currentTime.year, 11, 10), + )), + ); + + expect(find.byType(IconButton), findsNWidgets(3)); + expect(find.byType(DerivDateRangePicker), findsOneWidget); + + expect(find.text(localization.labelSelectedDateRange), findsOneWidget); + + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is RichText && + widget.text.toPlainText() == + '${localization.labelStartDate} - Nov 10', + ), + findsOneWidget, + ); + }); + + testWidgets( + 'should show date range picker input mode when edit button pressed from calendar', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + )), + ); + + final Finder editButton = find.widgetWithIcon(IconButton, Icons.edit); + + await tester.tap(editButton); + await tester.pumpAndSettle(); + + expect(find.byType(InputDateRange), findsOneWidget); + }); + }); + + group(' Date Range Picker Input Mode => ', () { + testWidgets( + 'should open date range picker calendar mode when calendar tapped', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + mode: DateRangePickerMode.input, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + )), + ); + + await tester.pumpAndSettle(); + + final Finder calendarIcon = + find.widgetWithIcon(IconButton, Icons.date_range); + + await tester.tap(calendarIcon); + await tester.pumpAndSettle(); + + expect(find.byType(CalendarDateRange), findsOneWidget); + }); + + testWidgets('should close on cancel button tapped', + (WidgetTester tester) async { + final DateTime currentTime = DateTime.now(); + + await tester.pumpApp( + Builder( + builder: (BuildContext context) => DerivDateRangePicker( + context: context, + mode: DateRangePickerMode.input, + currentDate: currentTime, + minAllowedDate: DateTime(currentTime.year - 1, 11), + maxAllowedDate: DateTime(currentTime.year, 11, 25), + )), + ); + + await tester.pumpAndSettle(); + + final Finder cancelButton = find.widgetWithText( + TextButton, + localization.labelActionCancel, + ); + + await tester.tap(cancelButton); + await tester.pumpAndSettle(); + + expect(find.byType(InputDateRange), findsNothing); + expect(find.byType(DerivDateRangePicker), findsNothing); + }); + }); +} diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/device_info_test.dart b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/device_info_test.dart new file mode 100644 index 000000000..8a8c48eb5 --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/device_info_test.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:deriv_ui/deriv_ui.dart'; + +void main() { + group('Device Info', () { + test('hasTopNotch should be false by default', () { + expect(DeviceInfo.hasTopNotch, false); + }); + + testWidgets('init should initialize devicePadding and hasTopNotch', (WidgetTester tester) async { + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (BuildContext context) { + DeviceInfo.init(context); + return Container(); + }, + ), + )); + + expect(DeviceInfo.devicePadding, isNotNull); + expect(DeviceInfo.hasTopNotch, isNotNull); + }); + }); +} diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart new file mode 100644 index 000000000..be6a138b6 --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart @@ -0,0 +1,75 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + setUpAll(() { + WidgetsFlutterBinding.ensureInitialized(); + }); + + group('ExpandableBottomSheetController', () { + late ExpandableBottomSheetController controller; + + setUp(() { + controller = ExpandableBottomSheetController( + animationController: AnimationController( + vsync: const TestVSync(), + duration: const Duration(milliseconds: 300), + ), + )..init(); + }); + + tearDown(() { + controller.dispose(); + }); + + test('initial values', () { + expect(controller.isLowerContentGestureEnabled, isTrue); + expect(controller.isHintOpen, isFalse); + expect(controller.height, 0); + expect(controller.isOpen, isFalse); + expect(controller.lowerBound, 0); + }); + + test('open/close bottom sheet', () { + controller.changeLowerBound(100); + expect(controller.lowerBound, 100); + + // Open bottom sheet + controller.height = 150; + expect(controller.isOpen, isTrue); + + // Close bottom sheet + controller.close(); + expect(controller.isOpen, isFalse); + }); + + test('hint visibility', () { + expect(controller.isHintOpen, isFalse); + + // Open hint + controller.isHintOpen = true; + expect(controller.isHintOpen, isTrue); + + // Close hint + controller.isHintOpen = false; + expect(controller.isHintOpen, isFalse); + }); + + test('height stream', () async { + final List expectedHeights = [100, 150, 200]; + final List actualHeights = []; + controller.heightStream.listen((double height) { + actualHeights.add(height); + }); + for (final double element in expectedHeights) { + controller.height = element; + } + + await Future.delayed(const Duration()); + + expect(actualHeights, expectedHeights); + }); + + }); +} diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart new file mode 100644 index 000000000..a4c765bff --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart @@ -0,0 +1,272 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group('Expandable Bottom Sheet =>', () { + const String title = 'Expandable Bottom Sheet Title'; + const String hint = 'Expandable Bottom Sheet Hint'; + + testWidgets('should open and close when tap on toggler.', + (WidgetTester tester) async { + late bool isOpen; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + onOpen: () => isOpen = true, + onClose: () => isOpen = false, + labelContractDetails: '', + ); + + final Finder togglerFinder = find.text(title); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.tap(togglerFinder); + await tester.pump(); + + expect(isOpen, isTrue); + + await tester.tap(togglerFinder); + await tester.pump(); + + expect(isOpen, isFalse); + }); + + testWidgets('should open when drag up toggler.', + (WidgetTester tester) async { + late bool isOpen; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + onOpen: () => isOpen = true, + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.drag(find.text(title), const Offset(0, -300)); + await tester.pump(); + + expect(isOpen, isTrue); + }); + + testWidgets('should close when drag down toggler.', + (WidgetTester tester) async { + bool isOpen = true; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + onClose: () => isOpen = false, + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.drag(find.text(title), const Offset(0, -300)); + await tester.pump(); + await tester.drag(find.text(title), const Offset(0, 300)); + await tester.pump(); + + expect(isOpen, isFalse); + }); + + testWidgets('should set title when `title` has value.', ( + WidgetTester tester, + ) async { + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + expect(find.text(title), findsOneWidget); + }); + + testWidgets('should set and open hint when `hint` has value.', ( + WidgetTester tester, + ) async { + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + hint: hint, + upperContent: Container(), + lowerContent: Container(), + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.tap(find.byIcon(Icons.info_outline)); + await tester.pump(); + + expect(find.text(hint), findsOneWidget); + }); + + testWidgets('adding left action and test action execution.', + (WidgetTester tester) async { + bool isExecuted = false; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + leftAction: TextButton( + child: const Text('left action'), + onPressed: () => isExecuted = true, + ), + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.tap(find.byType(TextButton)); + await tester.pump(); + + expect(isExecuted, isTrue); + }); + + testWidgets('adding right action and test action execution.', + (WidgetTester tester) async { + bool isExecuted = false; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + rightAction: TextButton( + child: const Text('right action'), + onPressed: () => isExecuted = true, + ), + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.tap(find.byType(TextButton)); + await tester.pump(); + + expect(isExecuted, isTrue); + }); + + testWidgets('hint should override [rightAction] widget.', + (WidgetTester tester) async { + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + hint: hint, + upperContent: Container(), + lowerContent: Container(), + rightAction: TextButton( + child: const Text('right action'), + onPressed: () {}, + ), + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + expect(find.byType(TextButton), findsNothing); + }); + + testWidgets('should call `onOpen()` callback on bottom sheet open.', + (WidgetTester tester) async { + int timesExecuted = 0; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + onOpen: () => timesExecuted++, + labelContractDetails: '', + ); + + final Finder togglerFinder = find.text(title); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.drag(togglerFinder, const Offset(0, -300)); + await tester.pump(); + + expect(timesExecuted, 1); + + await tester.tap(togglerFinder); + await tester.pump(); + await tester.tap(togglerFinder); + await tester.pump(); + + expect(timesExecuted, 2); + }); + + testWidgets('should call `onClose()` callback on bottom sheet close.', + (WidgetTester tester) async { + int timesExecuted = 0; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + lowerContent: Container(), + onClose: () => timesExecuted++, + labelContractDetails: '', + ); + + final Finder togglerFinder = find.text(title); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.tap(togglerFinder); + await tester.pump(); + + await tester.drag(togglerFinder, const Offset(0, 300)); + await tester.pump(); + + expect(timesExecuted, 1); + + await tester.tap(togglerFinder); + await tester.pump(); + await tester.tap(togglerFinder); + await tester.pump(); + + expect(timesExecuted, 2); + }); + + testWidgets('should call `onDismiss()` callback on bottom sheet dismiss.', + (WidgetTester tester) async { + bool isDismissed = false; + + final ExpandableBottomSheet bottomSheet = ExpandableBottomSheet( + title: title, + upperContent: Container(), + onDismiss: () => isDismissed = true, + labelContractDetails: '', + ); + + await tester.pumpWidget(_TestApp(bottomSheet)); + + await tester.drag(find.text(title), const Offset(0, 100)); + await tester.pump(); + + expect(isDismissed, isTrue); + }); + }); +} + +class _TestApp extends StatelessWidget { + const _TestApp(this.bottomSheet); + + final ExpandableBottomSheet bottomSheet; + + @override + Widget build(BuildContext context) => MaterialApp( + home: Scaffold(bottomSheet: bottomSheet), + ); +} diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart new file mode 100644 index 000000000..e79a4b507 --- /dev/null +++ b/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:deriv_ui/deriv_ui.dart'; + +void main() { + testWidgets('ExpandableBottomSheetProvider should find nearest instance', (WidgetTester tester) async { + final ExpandableBottomSheetController controller = ExpandableBottomSheetController(); + + await tester.pumpWidget( + ExpandableBottomSheetProvider( + controller: controller, + fullScreenMode: null, + leftAction: null, + rightAction: null, + showToggler: true, + child: MaterialApp( + home: Builder( + builder: (BuildContext context) { + final ExpandableBottomSheetProvider? provider = ExpandableBottomSheetProvider.of(context); + expect(provider, isNotNull); + expect(provider!.controller, equals(controller)); + return Container(); + }, + ), + ), + ), + ); + }); + +} diff --git a/packages/deriv_ui/test/pump_app.dart b/packages/deriv_ui/test/pump_app.dart new file mode 100644 index 000000000..27bfdf9d3 --- /dev/null +++ b/packages/deriv_ui/test/pump_app.dart @@ -0,0 +1,18 @@ +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:deriv_theme/deriv_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +extension PumpApp on WidgetTester { + Future pumpApp(Widget widget) => pumpWidget( + DerivThemeProvider( + child: MaterialApp( + localizationsDelegates: const >[ + DateRangeLocalizations.delegate, + ], + supportedLocales: DateRangeLocalizations.supportedLocales, + home: widget, + ), + ), + ); +} From bdd5b0fffb5c95677f998bc518a96b5a50881bf4 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Fri, 26 Jan 2024 18:24:00 +0800 Subject: [PATCH 2/9] chore: revert unwanted changes --- .../example/android/build.gradle | 2 +- .../example/android/build.gradle | 2 +- .../plugins/GeneratedPluginRegistrant.java | 2 +- .../deriv_rudderstack/example/pubspec.lock | 38 +++++++++---------- packages/deriv_rudderstack/pubspec.lock | 38 +++++++++---------- packages/deriv_theme/pubspec.lock | 38 +++++++++---------- .../plugins/GeneratedPluginRegistrant.java | 4 +- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/packages/deriv_date_range_picker/example/android/build.gradle b/packages/deriv_date_range_picker/example/android/build.gradle index 713d7f6e6..58a8c74b1 100644 --- a/packages/deriv_date_range_picker/example/android/build.gradle +++ b/packages/deriv_date_range_picker/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -tasks.register("clean", Delete) { +task clean(type: Delete) { delete rootProject.buildDir } diff --git a/packages/deriv_expandable_bottom_sheet/example/android/build.gradle b/packages/deriv_expandable_bottom_sheet/example/android/build.gradle index 713d7f6e6..58a8c74b1 100644 --- a/packages/deriv_expandable_bottom_sheet/example/android/build.gradle +++ b/packages/deriv_expandable_bottom_sheet/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -tasks.register("clean", Delete) { +task clean(type: Delete) { delete rootProject.buildDir } diff --git a/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index f6ffee652..4325fcb20 100644 --- a/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/packages/deriv_rudderstack/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -17,7 +17,7 @@ public final class GeneratedPluginRegistrant { public static void registerWith(@NonNull FlutterEngine flutterEngine) { try { flutterEngine.getPlugins().add(new com.deriv.deriv_rudderstack.DerivRudderstackPlugin()); - } catch (Exception e) { + } catch(Exception e) { Log.e(TAG, "Error registering plugin deriv_rudderstack, com.deriv.deriv_rudderstack.DerivRudderstackPlugin", e); } } diff --git a/packages/deriv_rudderstack/example/pubspec.lock b/packages/deriv_rudderstack/example/pubspec.lock index dc0e49e9a..1d8d0ec9e 100644 --- a/packages/deriv_rudderstack/example/pubspec.lock +++ b/packages/deriv_rudderstack/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.17.1" deriv_rudderstack: dependency: "direct main" description: @@ -66,22 +66,30 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: @@ -107,10 +115,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -147,10 +155,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.5.1" vector_math: dependency: transitive description: @@ -159,14 +167,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.0.0 <4.0.0" flutter: ">=3.10.2" diff --git a/packages/deriv_rudderstack/pubspec.lock b/packages/deriv_rudderstack/pubspec.lock index 4f37adc72..9b554c600 100644 --- a/packages/deriv_rudderstack/pubspec.lock +++ b/packages/deriv_rudderstack/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.17.1" fake_async: dependency: transitive description: @@ -59,22 +59,30 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: @@ -100,10 +108,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -140,10 +148,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.5.1" vector_math: dependency: transitive description: @@ -152,14 +160,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.0.0 <4.0.0" flutter: ">=3.10.2" diff --git a/packages/deriv_theme/pubspec.lock b/packages/deriv_theme/pubspec.lock index 4f37adc72..9b554c600 100644 --- a/packages/deriv_theme/pubspec.lock +++ b/packages/deriv_theme/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.17.1" fake_async: dependency: transitive description: @@ -59,22 +59,30 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: @@ -100,10 +108,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -140,10 +148,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.5.1" vector_math: dependency: transitive description: @@ -152,14 +160,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.0.0 <4.0.0" flutter: ">=3.10.2" diff --git a/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index 1c1840926..e9dfbb328 100644 --- a/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/packages/deriv_ui/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -1,7 +1,7 @@ package io.flutter.plugins; import io.flutter.plugin.common.PluginRegistry; -import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin; +import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin; import io.flutter.plugins.urllauncher.UrlLauncherPlugin; import io.flutter.plugins.webviewflutter.WebViewFlutterPlugin; @@ -13,7 +13,7 @@ public static void registerWith(PluginRegistry registry) { if (alreadyRegisteredWith(registry)) { return; } - InAppWebViewFlutterPlugin.registerWith(registry.registrarFor("com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin")); + InAppWebViewFlutterPlugin.registerWith(registry.registrarFor("com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin")); UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); WebViewFlutterPlugin.registerWith(registry.registrarFor("io.flutter.plugins.webviewflutter.WebViewFlutterPlugin")); } From 2ad2942300a4fd5c986507acdc575b44c1b3aca3 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Fri, 26 Jan 2024 18:38:31 +0800 Subject: [PATCH 3/9] chore: use correct flutter version in example app --- packages/deriv_ui/example/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deriv_ui/example/pubspec.yaml b/packages/deriv_ui/example/pubspec.yaml index 2cadcab53..4ebb70a83 100644 --- a/packages/deriv_ui/example/pubspec.yaml +++ b/packages/deriv_ui/example/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.1.3 <4.0.0' + sdk: '>=3.0.1 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions From a9bad983c54eff825c48ca35f518bafcfd2982b9 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:40:43 +0800 Subject: [PATCH 4/9] refactor: move to components folder --- packages/deriv_ui/lib/deriv_ui.dart | 3 ++- .../presentation/{widgets => components}/banner/banner.dart | 0 .../presentation/{widgets => components}/banner/constants.dart | 0 .../banner/default_collapse_button.dart | 0 .../{widgets => components}/banner/stacked_banner.dart | 0 packages/deriv_ui/lib/presentation/components/components.dart | 3 +++ .../date_range_picker/core/date_input_formatter.dart | 0 .../{widgets => components}/date_range_picker/core/debug.dart | 0 .../{widgets => components}/date_range_picker/core/enums.dart | 0 .../date_range_picker/core/extensions.dart | 0 .../date_range_picker/core/helpers.dart | 0 .../date_range_picker/date_range_picker.dart | 0 .../date_range_picker/deriv_date_range_picker.dart | 0 .../date_range_picker/models/date_range_model.dart | 0 .../date_range_picker/models/input_date_model.dart | 0 .../date_range_picker/widgets/animated_popup.dart | 0 .../date_range_picker/widgets/calendar_date_range.dart | 0 .../date_range_picker/widgets/calendar_keyboard_navigator.dart | 0 .../date_range_picker/widgets/date_range_text_field.dart | 0 .../date_range_picker/widgets/day_header.dart | 0 .../date_range_picker/widgets/focused_date.dart | 0 .../date_range_picker/widgets/highlight_painter.dart | 0 .../date_range_picker/widgets/input_date_range.dart | 0 .../date_range_picker/widgets/month_item.dart | 0 .../date_range_picker/widgets/month_item_grid.dart | 0 .../date_range_picker/widgets/month_item_grid_delegate.dart | 0 .../date_range_picker/widgets/selected_date_range.dart | 0 .../expandable_bottom_sheet/core/utils/device_info.dart | 0 .../core/utils/expandable_bottom_sheet_controller.dart | 0 .../expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart | 0 .../presentation/widgets/custom_tooltip.dart | 0 .../presentation/widgets/expandable_bottom_sheet.dart | 0 .../widgets/expandable_bottom_sheet_hint_button.dart | 0 .../widgets/expandable_bottom_sheet_lower_content.dart | 0 .../presentation/widgets/expandable_bottom_sheet_title.dart | 0 .../widgets/expandable_bottom_sheet_title_bar.dart | 0 .../presentation/widgets/expandable_bottom_sheet_toggler.dart | 0 .../widgets/expandable_bottom_sheet_upper_content.dart | 0 .../states/expandable_bottom_sheet_provider.dart | 0 packages/deriv_ui/lib/presentation/widgets/widgets.dart | 3 --- .../{widgets => components}/banner/stacked_banner_test.dart | 0 .../date_range_picker/core/date_input_formatter_test.dart | 0 .../date_range_picker/core/debug_test.dart | 0 .../date_range_picker/core/helper_test.dart | 0 .../date_range_picker/date_range_picker_test.dart | 0 .../expandable_bottom_sheet/core/utils/device_info_test.dart | 0 .../core/utils/expandable_bottom_sheet_controller_test.dart | 0 .../deriv_expandable_bottom_sheet_test.dart | 0 .../states/expandable_bottom_sheet_provider_test.dart | 0 49 files changed, 5 insertions(+), 4 deletions(-) rename packages/deriv_ui/lib/presentation/{widgets => components}/banner/banner.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/banner/constants.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/banner/default_collapse_button.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/banner/stacked_banner.dart (100%) create mode 100644 packages/deriv_ui/lib/presentation/components/components.dart rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/core/date_input_formatter.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/core/debug.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/core/enums.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/core/extensions.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/core/helpers.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/date_range_picker.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/deriv_date_range_picker.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/models/date_range_model.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/models/input_date_model.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/animated_popup.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/calendar_date_range.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/calendar_keyboard_navigator.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/date_range_text_field.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/day_header.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/focused_date.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/highlight_painter.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/input_date_range.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/month_item.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/month_item_grid.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/month_item_grid_delegate.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/date_range_picker/widgets/selected_date_range.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/core/utils/device_info.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart (100%) rename packages/deriv_ui/lib/presentation/{widgets => components}/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/banner/stacked_banner_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/date_range_picker/core/date_input_formatter_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/date_range_picker/core/debug_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/date_range_picker/core/helper_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/date_range_picker/date_range_picker_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/expandable_bottom_sheet/core/utils/device_info_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart (100%) rename packages/deriv_ui/test/presentation/{widgets => components}/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart (100%) diff --git a/packages/deriv_ui/lib/deriv_ui.dart b/packages/deriv_ui/lib/deriv_ui.dart index 67cc7fb60..92a1a39f0 100644 --- a/packages/deriv_ui/lib/deriv_ui.dart +++ b/packages/deriv_ui/lib/deriv_ui.dart @@ -1,2 +1,3 @@ export 'presentation/widgets/widgets.dart'; -export 'utils/utils.dart'; \ No newline at end of file +export 'presentation/components/components.dart'; +export 'utils/utils.dart'; diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/banner.dart b/packages/deriv_ui/lib/presentation/components/banner/banner.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/banner/banner.dart rename to packages/deriv_ui/lib/presentation/components/banner/banner.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/constants.dart b/packages/deriv_ui/lib/presentation/components/banner/constants.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/banner/constants.dart rename to packages/deriv_ui/lib/presentation/components/banner/constants.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/default_collapse_button.dart b/packages/deriv_ui/lib/presentation/components/banner/default_collapse_button.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/banner/default_collapse_button.dart rename to packages/deriv_ui/lib/presentation/components/banner/default_collapse_button.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/banner/stacked_banner.dart b/packages/deriv_ui/lib/presentation/components/banner/stacked_banner.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/banner/stacked_banner.dart rename to packages/deriv_ui/lib/presentation/components/banner/stacked_banner.dart diff --git a/packages/deriv_ui/lib/presentation/components/components.dart b/packages/deriv_ui/lib/presentation/components/components.dart new file mode 100644 index 000000000..fb18e7a39 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/components/components.dart @@ -0,0 +1,3 @@ +export 'banner/banner.dart'; +export 'date_range_picker/deriv_date_range_picker.dart'; +export 'expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart'; diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/date_input_formatter.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/core/date_input_formatter.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/date_input_formatter.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/core/date_input_formatter.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/debug.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/core/debug.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/debug.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/core/debug.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/enums.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/core/enums.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/enums.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/core/enums.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/extensions.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/core/extensions.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/extensions.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/core/extensions.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/helpers.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/core/helpers.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/core/helpers.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/core/helpers.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/date_range_picker.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/date_range_picker.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/date_range_picker.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/date_range_picker.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/deriv_date_range_picker.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/deriv_date_range_picker.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/deriv_date_range_picker.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/deriv_date_range_picker.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/date_range_model.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/models/date_range_model.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/date_range_model.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/models/date_range_model.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/input_date_model.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/models/input_date_model.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/models/input_date_model.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/models/input_date_model.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/animated_popup.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/animated_popup.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/animated_popup.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/animated_popup.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_date_range.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_date_range.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_date_range.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_date_range.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_keyboard_navigator.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_keyboard_navigator.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/calendar_keyboard_navigator.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_keyboard_navigator.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/date_range_text_field.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/date_range_text_field.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/date_range_text_field.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/date_range_text_field.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/day_header.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/day_header.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/day_header.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/day_header.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/focused_date.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/focused_date.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/focused_date.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/focused_date.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/highlight_painter.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/highlight_painter.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/highlight_painter.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/highlight_painter.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/input_date_range.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/input_date_range.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/input_date_range.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/input_date_range.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid_delegate.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid_delegate.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/month_item_grid_delegate.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid_delegate.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/selected_date_range.dart b/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/selected_date_range.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/date_range_picker/widgets/selected_date_range.dart rename to packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/selected_date_range.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/device_info.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/device_info.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/device_info.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/device_info.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart rename to packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/widgets.dart b/packages/deriv_ui/lib/presentation/widgets/widgets.dart index d8637e6b9..4be9549dc 100644 --- a/packages/deriv_ui/lib/presentation/widgets/widgets.dart +++ b/packages/deriv_ui/lib/presentation/widgets/widgets.dart @@ -12,6 +12,3 @@ export 'popup_alert_dialog.dart'; export 'primary_button.dart'; export 'secondary_button.dart'; export 'text_span_hyperlink.dart'; -export 'banner/banner.dart'; -export 'date_range_picker/deriv_date_range_picker.dart'; -export 'expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/banner/stacked_banner_test.dart b/packages/deriv_ui/test/presentation/components/banner/stacked_banner_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/banner/stacked_banner_test.dart rename to packages/deriv_ui/test/presentation/components/banner/stacked_banner_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/date_input_formatter_test.dart b/packages/deriv_ui/test/presentation/components/date_range_picker/core/date_input_formatter_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/date_range_picker/core/date_input_formatter_test.dart rename to packages/deriv_ui/test/presentation/components/date_range_picker/core/date_input_formatter_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/debug_test.dart b/packages/deriv_ui/test/presentation/components/date_range_picker/core/debug_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/date_range_picker/core/debug_test.dart rename to packages/deriv_ui/test/presentation/components/date_range_picker/core/debug_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/core/helper_test.dart b/packages/deriv_ui/test/presentation/components/date_range_picker/core/helper_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/date_range_picker/core/helper_test.dart rename to packages/deriv_ui/test/presentation/components/date_range_picker/core/helper_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/date_range_picker/date_range_picker_test.dart b/packages/deriv_ui/test/presentation/components/date_range_picker/date_range_picker_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/date_range_picker/date_range_picker_test.dart rename to packages/deriv_ui/test/presentation/components/date_range_picker/date_range_picker_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/device_info_test.dart b/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/device_info_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/device_info_test.dart rename to packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/device_info_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart b/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart rename to packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart b/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart rename to packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart b/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart rename to packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart From d819135758750be6ebca2dd2d506e84a6931e17d Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:47:05 +0800 Subject: [PATCH 5/9] chore: add README files --- packages/deriv_ui/README.md | 8 +- .../presentation/components/banner/README.md | 18 +++ .../components/date_range_picker/README.md | 47 +++++++ .../expandable_bottom_sheet/README.md | 115 ++++++++++++++++++ 4 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 packages/deriv_ui/lib/presentation/components/banner/README.md create mode 100644 packages/deriv_ui/lib/presentation/components/date_range_picker/README.md create mode 100644 packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/README.md diff --git a/packages/deriv_ui/README.md b/packages/deriv_ui/README.md index 3e1d42dc9..106235759 100644 --- a/packages/deriv_ui/README.md +++ b/packages/deriv_ui/README.md @@ -8,6 +8,12 @@ Here is the detailed structure of the components included in this package: - [Custom Icon Data Model](./lib/models/custom_icon_data_model.dart) +## Components + +- [Banner](./lib/presentation/components/banner/README.md) +- [Date Range Picker](./lib/presentation/components/date_range_picker/README.md) +- [Expandable bottom sheet](./lib/presentation/components/expandable_bottom_sheet/README.md) + ## Widgets - [App Setting Gesture Detector](./lib/presentation/widgets/app_setting_gesture_detector.dart) @@ -30,4 +36,4 @@ Here is the detailed structure of the components included in this package: - [Animation Durations](./lib/utils/animation_durations.dart) - [Color Helper](./lib/utils/color_helper.dart) - [Popup Dialogs Helper](./lib/utils/popup_dialogs_helper.dart) -- [Regex Helpers](./lib/utils/regex_helpers.dart) \ No newline at end of file +- [Regex Helpers](./lib/utils/regex_helpers.dart) diff --git a/packages/deriv_ui/lib/presentation/components/banner/README.md b/packages/deriv_ui/lib/presentation/components/banner/README.md new file mode 100644 index 000000000..5f8d07afe --- /dev/null +++ b/packages/deriv_ui/lib/presentation/components/banner/README.md @@ -0,0 +1,18 @@ +# Deriv Banner + +Deriv Banner is a custom Flutter widget that allows you to display stacked banners in your application. It's designed to be easy to use and customizable to fit your application's theme and style. + +## Usage + +To use the `StackedBanner` widget, simply import the `deriv_ui.dart` file into your Dart code: + +```dart +import 'package:deriv_ui/deriv_ui.dart'; +``` +Then, you can use the StackedBanner widget in your Flutter code like any other widget: +```dart +StackedBanner( + // Your parameters here +), +``` +Please refer to the source code for more details on the available parameters and their usage. diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/README.md b/packages/deriv_ui/lib/presentation/components/date_range_picker/README.md new file mode 100644 index 000000000..69491a154 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/components/date_range_picker/README.md @@ -0,0 +1,47 @@ +# Deriv Date Range Picker + +This component provides a date range picker widget based on deriv theme. + +## Features + +- Provides a date range picker widget based on deriv theme. +- Supports both calendar and input mode. + +## Getting started + +In your library add the following import: + +```dart +import 'package:deriv_ui/deriv_ui.dart'; +``` + +In your MaterialApp add the `DateRangeLocalizations` delegate: + + +```dart +MaterialApp( + localizationsDelegates: [ + DateRangeLocalizations.delegate, + /// ... more localization delegates + ], +) +``` + + +## Usage + +```dart +final dateChosen = await showDialog( + context: context, + builder: (_) => DerivDateRangePicker( + context: context, + currentDate: DateTime.now(), + minAllowedDate: DateTime(2021, 1, 1), + maxAllowedDate: DateTime(2021, 12, 31), + initialStartDate: date.startDate, + initialEndDate: date.endDate, + mode: DateRangePickerMode.calendar, + )); +print(dateChosen); // Instance of 'DateRangeModel' +print(dateChosen.startDate); // Instance of 'DateTime' +``` diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/README.md b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/README.md new file mode 100644 index 000000000..db61fe672 --- /dev/null +++ b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/README.md @@ -0,0 +1,115 @@ +# Deriv Expandable Bottom Sheet +## Overview +The `ExpandableBottomSheet` widget helps to display an expandable bottom sheet with `title`, `upperContent`, and `lowerContent` parts. All properties are optional. It calculates the height in the minimized state based on `upperContent`, but if `maxHeight` and `lowerContent` are set, the value will be overridden. It can also open the bottom sheet in full size if `openMaximized` is set to `true`. + +## Getting started + +Import the `deriv_ui` package in the files where you need to use it: +```dart +import 'package:deriv_ui/deriv_ui.dart'; +``` +## Usage +To use the `ExpandableBottomSheet` widget, create an instance of the widget by calling its constructor and providing the required properties: +```dart +ExpandableBottomSheet( + themeProvider: ThemeProvider(Brightness.light), + labelContractDetails: 'Test Label Contract Details', + upperContent: Container( + height: 200, + child: const Text( + 'Example Upper Content', + style: TextStyle(fontSize: 24), + ), + ), + lowerContent: Container( + height: 200, + child: const Text( + 'Example Lower Content', + style: TextStyle(fontSize: 24), + ), + ), +); + +``` +## Parameters +### Required Parameters +- `themeProvider`: an instance of ThemeProvider class that provides the theme for the bottom sheet. +- `labelContractDetails`: a string that represents the label for the contract details. +- `upperContent`: a widget that represents the upper content part of the bottom sheet. +### Optional Parameters +- `title`: a string that represents the title of the bottom sheet. +- `controller`: an instance of `ExpandableBottomSheetController` class that can be used to get control of the bottom sheet's functionalities. +- `hint`: a string that represents the hint button of the bottom sheet. +- `leftAction`: a widget that represents the action placed on the left side of the title. +- `rightAction`: a widget that represents the action placed on the right side of the title. +- `lowerContent`: a widget that represents the lower content part of the bottom sheet. +- `fullScreenMode`: a boolean value that defines whether the bottom sheet would be in full-screen mode when its open. +- `showToggler`: a boolean value that sets toggler visibility. If the value is set to `false`, `dragging` and `toggle` actions will be disabled. The default value is `true`. +- `maxHeight`: a double value that sets the maximum height for the expandable bottom sheet. The expandable bottom sheet will be full screen if `maxHeight` is not set. +- `openMaximized`: a boolean value that opens the expandable bottom sheet in maximized state. The default value is `false`. +- `dismissible`: a boolean value that defines whether the bottom sheet should get closed when the user swipes it down. The default value is `true`. +- `changeStateDuration`: a `Duration` value that sets the change state animation duration. The default value is `350 milliseconds`. +- `onOpen`: a `VoidCallback` that is called when the expandable bottom sheet is open. +- `onClose`: a `VoidCallback` that is called when the expandable bottom sheet is closed. +- `onClosed`: a `VoidCallback` that is called when the expandable bottom sheet is already closed. +- `onToggle`: a `VoidCallback` that is called when the toggle expandable bottom sheet. +- `onDismiss`: a `VoidCallback` that is called on the expandable bottom sheet dismiss. + +## Example App +Here's an example app demonstrating the usage of the `ExpandableBottomSheet` widget: +```dart +/// This imports the required packages. +import 'package:deriv_ui/deriv_ui.dart'; +import 'package:deriv_theme/theme_provider.dart'; +import 'package:flutter/material.dart'; + +/// This is a home screen widget that displays a button to show the expandable bottom sheet. +class Home extends StatelessWidget { + + /// This is a const constructor that takes a key. + const Home({Key? key}) : super(key: key); + + /// This function displays the expandable bottom sheet when the button is clicked. + Future _showExpandableBottomSheet(BuildContext context) => + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext context) => ExpandableBottomSheet( + labelContractDetails: 'Test Label Contract Details', + themeProvider: const ThemeProvider(Brightness.light), + upperContent: Container( + height: 200, + child: const Text( + 'Example Upper Content', + style: TextStyle(fontSize: 24), + ), + ), + lowerContent: Container( + height: 200, + child: const Text( + 'Example Lower Content', + style: TextStyle(fontSize: 24), + ), + ), + ), + ); + + @override + Widget build(BuildContext context) => + Scaffold( + appBar: AppBar( + title: const Text('Expandable Bottom Sheet Demo'), + ), + body: MediaQuery( + data: const MediaQueryData(), + child: Center( + child: ElevatedButton( + child: const Text('Show Expandable Bottom Sheet'), + onPressed: () => _showExpandableBottomSheet(context), + ), + ), + ), + ); + +} +``` From 255e55dc0d7eed2a848558a73de6a185b5191408 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:50:34 +0800 Subject: [PATCH 6/9] chore: add l10n.yaml file --- packages/deriv_ui/l10n.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/deriv_ui/l10n.yaml diff --git a/packages/deriv_ui/l10n.yaml b/packages/deriv_ui/l10n.yaml new file mode 100644 index 000000000..3a712c052 --- /dev/null +++ b/packages/deriv_ui/l10n.yaml @@ -0,0 +1,7 @@ +arb-dir: lib/l10n +template-arb-file: app_en.arb +output-localization-file: date_range_localizations.dart +output-class: DateRangeLocalizations +output-dir: lib/l10n/generated +synthetic-package: false +nullable-getter: false From 5f2efb95c65da2b19e2728472507779d694f5e83 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:56:02 +0800 Subject: [PATCH 7/9] refactor: folder structure --- .../lib/{presentation => }/components/banner/README.md | 0 packages/deriv_ui/lib/components/banner/banner.dart | 2 ++ .../banner => components/banner/core}/constants.dart | 0 .../banner/widgets}/default_collapse_button.dart | 2 +- .../banner/widgets}/stacked_banner.dart | 0 packages/deriv_ui/lib/components/components.dart | 3 +++ .../components/date_range_picker/README.md | 0 .../date_range_picker/core/date_input_formatter.dart | 0 .../components/date_range_picker/core/debug.dart | 0 .../components/date_range_picker/core/enums.dart | 0 .../components/date_range_picker/core/extensions.dart | 0 .../components/date_range_picker/core/helpers.dart | 0 .../date_range_picker/date_range_picker.dart} | 2 +- .../date_range_picker/models/date_range_model.dart | 0 .../date_range_picker/models/input_date_model.dart | 0 .../date_range_picker/widgets/animated_popup.dart | 0 .../date_range_picker/widgets/calendar_date_range.dart | 0 .../widgets/calendar_keyboard_navigator.dart | 0 .../date_range_picker/widgets}/date_range_picker.dart | 0 .../date_range_picker/widgets/date_range_text_field.dart | 0 .../components/date_range_picker/widgets/day_header.dart | 0 .../components/date_range_picker/widgets/focused_date.dart | 0 .../date_range_picker/widgets/highlight_painter.dart | 0 .../date_range_picker/widgets/input_date_range.dart | 0 .../components/date_range_picker/widgets/month_item.dart | 0 .../date_range_picker/widgets/month_item_grid.dart | 0 .../date_range_picker/widgets/month_item_grid_delegate.dart | 0 .../date_range_picker/widgets/selected_date_range.dart | 0 .../components/expandable_bottom_sheet/README.md | 0 .../expandable_bottom_sheet/core}/device_info.dart | 0 .../core}/expandable_bottom_sheet_controller.dart | 2 +- .../expandable_bottom_sheet/expandable_bottom_sheet.dart | 2 ++ .../states/expandable_bottom_sheet_provider.dart | 2 +- .../expandable_bottom_sheet}/widgets/custom_tooltip.dart | 0 .../widgets/expandable_bottom_sheet.dart | 6 +++--- .../widgets/expandable_bottom_sheet_hint_button.dart | 0 .../widgets/expandable_bottom_sheet_lower_content.dart | 0 .../widgets/expandable_bottom_sheet_title.dart | 0 .../widgets/expandable_bottom_sheet_title_bar.dart | 0 .../widgets/expandable_bottom_sheet_toggler.dart | 0 .../widgets/expandable_bottom_sheet_upper_content.dart | 0 packages/deriv_ui/lib/deriv_ui.dart | 4 ++-- .../deriv_ui/lib/presentation/components/banner/banner.dart | 2 -- .../deriv_ui/lib/presentation/components/components.dart | 3 --- .../deriv_expandable_bottom_sheet.dart | 2 -- packages/deriv_ui/lib/utils/popup_dialogs_helper.dart | 6 +++--- .../widgets/app_setting_gesture_detector.dart | 0 .../lib/{presentation => }/widgets/base_text_field.dart | 0 .../lib/{presentation => }/widgets/custom_alert_dialog.dart | 0 .../lib/{presentation => }/widgets/custom_checkbox.dart | 0 .../lib/{presentation => }/widgets/custom_image.dart | 0 .../lib/{presentation => }/widgets/fullscreen_message.dart | 6 +++--- .../lib/{presentation => }/widgets/info_icon_button.dart | 0 .../lib/{presentation => }/widgets/interaction.dart | 0 .../lib/{presentation => }/widgets/loading_indicator.dart | 0 .../lib/{presentation => }/widgets/picture_badge.dart | 0 .../lib/{presentation => }/widgets/popup_alert_dialog.dart | 4 ++-- .../lib/{presentation => }/widgets/primary_button.dart | 2 +- .../lib/{presentation => }/widgets/secondary_button.dart | 2 +- .../lib/{presentation => }/widgets/text_span_hyperlink.dart | 0 .../deriv_ui/lib/{presentation => }/widgets/widgets.dart | 0 .../banner/widgets}/stacked_banner_test.dart | 0 .../date_range_picker/core/date_input_formatter_test.dart | 0 .../components/date_range_picker/core/debug_test.dart | 0 .../date_range_picker/core/helpers_test.dart} | 0 .../date_range_picker/widgets}/date_range_picker_test.dart | 0 .../expandable_bottom_sheet/core}/device_info_test.dart | 0 .../core}/expandable_bottom_sheet_controller_test.dart | 0 .../states/expandable_bottom_sheet_provider_test.dart | 0 .../widgets/expandable_bottom_sheet_test.dart} | 0 .../widgets/app_setting_gesture_detector_test.dart | 0 .../{presentation => }/widgets/base_text_field_test.dart | 2 +- .../widgets/custom_alert_dialog_test.dart | 2 +- .../{presentation => }/widgets/custom_checkbox_test.dart | 2 +- .../test/{presentation => }/widgets/custom_image_test.dart | 2 +- .../{presentation => }/widgets/fullscreen_message_test.dart | 2 +- .../{presentation => }/widgets/info_icon_button_test.dart | 2 +- .../test/{presentation => }/widgets/interaction_test.dart | 0 .../{presentation => }/widgets/loading_indicator_test.dart | 0 .../test/{presentation => }/widgets/picture_badge_test.dart | 0 .../{presentation => }/widgets/popup_alert_dialog_test.dart | 0 .../{presentation => }/widgets/primary_button_test.dart | 0 .../{presentation => }/widgets/secondary_button_test.dart | 0 .../widgets/text_span_hyperlink_test.dart | 0 84 files changed, 32 insertions(+), 32 deletions(-) rename packages/deriv_ui/lib/{presentation => }/components/banner/README.md (100%) create mode 100644 packages/deriv_ui/lib/components/banner/banner.dart rename packages/deriv_ui/lib/{presentation/components/banner => components/banner/core}/constants.dart (100%) rename packages/deriv_ui/lib/{presentation/components/banner => components/banner/widgets}/default_collapse_button.dart (96%) rename packages/deriv_ui/lib/{presentation/components/banner => components/banner/widgets}/stacked_banner.dart (100%) create mode 100644 packages/deriv_ui/lib/components/components.dart rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/README.md (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/core/date_input_formatter.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/core/debug.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/core/enums.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/core/extensions.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/core/helpers.dart (100%) rename packages/deriv_ui/lib/{presentation/components/date_range_picker/deriv_date_range_picker.dart => components/date_range_picker/date_range_picker.dart} (92%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/models/date_range_model.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/models/input_date_model.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/animated_popup.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/calendar_date_range.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/calendar_keyboard_navigator.dart (100%) rename packages/deriv_ui/lib/{presentation/components/date_range_picker => components/date_range_picker/widgets}/date_range_picker.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/date_range_text_field.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/day_header.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/focused_date.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/highlight_painter.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/input_date_range.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/month_item.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/month_item_grid.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/month_item_grid_delegate.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/date_range_picker/widgets/selected_date_range.dart (100%) rename packages/deriv_ui/lib/{presentation => }/components/expandable_bottom_sheet/README.md (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/core/utils => components/expandable_bottom_sheet/core}/device_info.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/core/utils => components/expandable_bottom_sheet/core}/expandable_bottom_sheet_controller.dart (97%) create mode 100644 packages/deriv_ui/lib/components/expandable_bottom_sheet/expandable_bottom_sheet.dart rename packages/deriv_ui/lib/{presentation => }/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart (97%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/custom_tooltip.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet.dart (98%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet_hint_button.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet_lower_content.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet_title.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet_title_bar.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet_toggler.dart (100%) rename packages/deriv_ui/lib/{presentation/components/expandable_bottom_sheet/presentation => components/expandable_bottom_sheet}/widgets/expandable_bottom_sheet_upper_content.dart (100%) delete mode 100644 packages/deriv_ui/lib/presentation/components/banner/banner.dart delete mode 100644 packages/deriv_ui/lib/presentation/components/components.dart delete mode 100644 packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart rename packages/deriv_ui/lib/{presentation => }/widgets/app_setting_gesture_detector.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/base_text_field.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/custom_alert_dialog.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/custom_checkbox.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/custom_image.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/fullscreen_message.dart (95%) rename packages/deriv_ui/lib/{presentation => }/widgets/info_icon_button.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/interaction.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/loading_indicator.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/picture_badge.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/popup_alert_dialog.dart (97%) rename packages/deriv_ui/lib/{presentation => }/widgets/primary_button.dart (94%) rename packages/deriv_ui/lib/{presentation => }/widgets/secondary_button.dart (95%) rename packages/deriv_ui/lib/{presentation => }/widgets/text_span_hyperlink.dart (100%) rename packages/deriv_ui/lib/{presentation => }/widgets/widgets.dart (100%) rename packages/deriv_ui/test/{presentation/components/banner => components/banner/widgets}/stacked_banner_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/components/date_range_picker/core/date_input_formatter_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/components/date_range_picker/core/debug_test.dart (100%) rename packages/deriv_ui/test/{presentation/components/date_range_picker/core/helper_test.dart => components/date_range_picker/core/helpers_test.dart} (100%) rename packages/deriv_ui/test/{presentation/components/date_range_picker => components/date_range_picker/widgets}/date_range_picker_test.dart (100%) rename packages/deriv_ui/test/{presentation/components/expandable_bottom_sheet/core/utils => components/expandable_bottom_sheet/core}/device_info_test.dart (100%) rename packages/deriv_ui/test/{presentation/components/expandable_bottom_sheet/core/utils => components/expandable_bottom_sheet/core}/expandable_bottom_sheet_controller_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart (100%) rename packages/deriv_ui/test/{presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart => components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_test.dart} (100%) rename packages/deriv_ui/test/{presentation => }/widgets/app_setting_gesture_detector_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/base_text_field_test.dart (97%) rename packages/deriv_ui/test/{presentation => }/widgets/custom_alert_dialog_test.dart (97%) rename packages/deriv_ui/test/{presentation => }/widgets/custom_checkbox_test.dart (95%) rename packages/deriv_ui/test/{presentation => }/widgets/custom_image_test.dart (97%) rename packages/deriv_ui/test/{presentation => }/widgets/fullscreen_message_test.dart (97%) rename packages/deriv_ui/test/{presentation => }/widgets/info_icon_button_test.dart (96%) rename packages/deriv_ui/test/{presentation => }/widgets/interaction_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/loading_indicator_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/picture_badge_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/popup_alert_dialog_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/primary_button_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/secondary_button_test.dart (100%) rename packages/deriv_ui/test/{presentation => }/widgets/text_span_hyperlink_test.dart (100%) diff --git a/packages/deriv_ui/lib/presentation/components/banner/README.md b/packages/deriv_ui/lib/components/banner/README.md similarity index 100% rename from packages/deriv_ui/lib/presentation/components/banner/README.md rename to packages/deriv_ui/lib/components/banner/README.md diff --git a/packages/deriv_ui/lib/components/banner/banner.dart b/packages/deriv_ui/lib/components/banner/banner.dart new file mode 100644 index 000000000..1a23fcbe8 --- /dev/null +++ b/packages/deriv_ui/lib/components/banner/banner.dart @@ -0,0 +1,2 @@ +export 'core/constants.dart'; +export 'widgets/stacked_banner.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/banner/constants.dart b/packages/deriv_ui/lib/components/banner/core/constants.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/banner/constants.dart rename to packages/deriv_ui/lib/components/banner/core/constants.dart diff --git a/packages/deriv_ui/lib/presentation/components/banner/default_collapse_button.dart b/packages/deriv_ui/lib/components/banner/widgets/default_collapse_button.dart similarity index 96% rename from packages/deriv_ui/lib/presentation/components/banner/default_collapse_button.dart rename to packages/deriv_ui/lib/components/banner/widgets/default_collapse_button.dart index ed28e88a2..467c1cfb7 100644 --- a/packages/deriv_ui/lib/presentation/components/banner/default_collapse_button.dart +++ b/packages/deriv_ui/lib/components/banner/widgets/default_collapse_button.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'constants.dart'; +import '../core/constants.dart'; /// The default collapse button which is shown in the bottom of stacked banner /// list when it's expanded. diff --git a/packages/deriv_ui/lib/presentation/components/banner/stacked_banner.dart b/packages/deriv_ui/lib/components/banner/widgets/stacked_banner.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/banner/stacked_banner.dart rename to packages/deriv_ui/lib/components/banner/widgets/stacked_banner.dart diff --git a/packages/deriv_ui/lib/components/components.dart b/packages/deriv_ui/lib/components/components.dart new file mode 100644 index 000000000..d4b065572 --- /dev/null +++ b/packages/deriv_ui/lib/components/components.dart @@ -0,0 +1,3 @@ +export 'banner/banner.dart'; +export 'date_range_picker/date_range_picker.dart'; +export 'expandable_bottom_sheet/expandable_bottom_sheet.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/README.md b/packages/deriv_ui/lib/components/date_range_picker/README.md similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/README.md rename to packages/deriv_ui/lib/components/date_range_picker/README.md diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/core/date_input_formatter.dart b/packages/deriv_ui/lib/components/date_range_picker/core/date_input_formatter.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/core/date_input_formatter.dart rename to packages/deriv_ui/lib/components/date_range_picker/core/date_input_formatter.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/core/debug.dart b/packages/deriv_ui/lib/components/date_range_picker/core/debug.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/core/debug.dart rename to packages/deriv_ui/lib/components/date_range_picker/core/debug.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/core/enums.dart b/packages/deriv_ui/lib/components/date_range_picker/core/enums.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/core/enums.dart rename to packages/deriv_ui/lib/components/date_range_picker/core/enums.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/core/extensions.dart b/packages/deriv_ui/lib/components/date_range_picker/core/extensions.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/core/extensions.dart rename to packages/deriv_ui/lib/components/date_range_picker/core/extensions.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/core/helpers.dart b/packages/deriv_ui/lib/components/date_range_picker/core/helpers.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/core/helpers.dart rename to packages/deriv_ui/lib/components/date_range_picker/core/helpers.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/deriv_date_range_picker.dart b/packages/deriv_ui/lib/components/date_range_picker/date_range_picker.dart similarity index 92% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/deriv_date_range_picker.dart rename to packages/deriv_ui/lib/components/date_range_picker/date_range_picker.dart index 10c7d7921..997b14785 100644 --- a/packages/deriv_ui/lib/presentation/components/date_range_picker/deriv_date_range_picker.dart +++ b/packages/deriv_ui/lib/components/date_range_picker/date_range_picker.dart @@ -5,7 +5,7 @@ export 'core/debug.dart'; export 'core/enums.dart'; export 'core/extensions.dart'; export 'core/helpers.dart'; -export 'date_range_picker.dart'; +export 'widgets/date_range_picker.dart'; export 'models/date_range_model.dart'; export 'models/input_date_model.dart'; export 'widgets/animated_popup.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/models/date_range_model.dart b/packages/deriv_ui/lib/components/date_range_picker/models/date_range_model.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/models/date_range_model.dart rename to packages/deriv_ui/lib/components/date_range_picker/models/date_range_model.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/models/input_date_model.dart b/packages/deriv_ui/lib/components/date_range_picker/models/input_date_model.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/models/input_date_model.dart rename to packages/deriv_ui/lib/components/date_range_picker/models/input_date_model.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/animated_popup.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/animated_popup.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/animated_popup.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/animated_popup.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_date_range.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/calendar_date_range.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_date_range.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/calendar_date_range.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_keyboard_navigator.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/calendar_keyboard_navigator.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/calendar_keyboard_navigator.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/calendar_keyboard_navigator.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/date_range_picker.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/date_range_picker.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/date_range_picker.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/date_range_picker.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/date_range_text_field.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/date_range_text_field.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/date_range_text_field.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/date_range_text_field.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/day_header.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/day_header.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/day_header.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/day_header.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/focused_date.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/focused_date.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/focused_date.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/focused_date.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/highlight_painter.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/highlight_painter.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/highlight_painter.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/highlight_painter.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/input_date_range.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/input_date_range.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/input_date_range.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/input_date_range.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/month_item.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/month_item.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/month_item_grid.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/month_item_grid.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid_delegate.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/month_item_grid_delegate.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/month_item_grid_delegate.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/month_item_grid_delegate.dart diff --git a/packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/selected_date_range.dart b/packages/deriv_ui/lib/components/date_range_picker/widgets/selected_date_range.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/date_range_picker/widgets/selected_date_range.dart rename to packages/deriv_ui/lib/components/date_range_picker/widgets/selected_date_range.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/README.md b/packages/deriv_ui/lib/components/expandable_bottom_sheet/README.md similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/README.md rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/README.md diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/device_info.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/core/device_info.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/device_info.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/core/device_info.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/core/expandable_bottom_sheet_controller.dart similarity index 97% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/core/expandable_bottom_sheet_controller.dart index e77560620..dc76d1afb 100644 --- a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller.dart +++ b/packages/deriv_ui/lib/components/expandable_bottom_sheet/core/expandable_bottom_sheet_controller.dart @@ -1,4 +1,4 @@ -part of '../../presentation/widgets/expandable_bottom_sheet.dart'; +part of '../widgets/expandable_bottom_sheet.dart'; /// Expandable bottom sheet controller class ExpandableBottomSheetController { diff --git a/packages/deriv_ui/lib/components/expandable_bottom_sheet/expandable_bottom_sheet.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/expandable_bottom_sheet.dart new file mode 100644 index 000000000..f4cd8d999 --- /dev/null +++ b/packages/deriv_ui/lib/components/expandable_bottom_sheet/expandable_bottom_sheet.dart @@ -0,0 +1,2 @@ +export 'widgets/expandable_bottom_sheet.dart'; +export 'core/device_info.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart similarity index 97% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart index 8c76a62ee..2996ee114 100644 --- a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart +++ b/packages/deriv_ui/lib/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider.dart @@ -1,4 +1,4 @@ -part of '../presentation/widgets/expandable_bottom_sheet.dart'; +part of '../widgets/expandable_bottom_sheet.dart'; /// Provider of [ExpandableBottomSheet]. class ExpandableBottomSheetProvider extends InheritedWidget { diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/custom_tooltip.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/custom_tooltip.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/custom_tooltip.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet.dart similarity index 98% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet.dart index 11991bbe4..8747f0dcf 100644 --- a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet.dart +++ b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet.dart @@ -3,16 +3,16 @@ library deriv_expandable_bottom_sheet; import 'dart:async'; import 'dart:math'; -import '../../core/utils/device_info.dart'; +import '../core/device_info.dart'; import 'custom_tooltip.dart'; import 'package:deriv_theme/deriv_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -part '../../core/utils/expandable_bottom_sheet_controller.dart'; +part '../core/expandable_bottom_sheet_controller.dart'; part 'expandable_bottom_sheet_hint_button.dart'; part 'expandable_bottom_sheet_lower_content.dart'; -part '../../states/expandable_bottom_sheet_provider.dart'; +part '../states/expandable_bottom_sheet_provider.dart'; part 'expandable_bottom_sheet_title.dart'; part 'expandable_bottom_sheet_title_bar.dart'; part 'expandable_bottom_sheet_toggler.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_hint_button.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_hint_button.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_hint_button.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_lower_content.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_lower_content.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_lower_content.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_title.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_title.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_title_bar.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_title_bar.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_title_bar.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_toggler.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_toggler.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_toggler.dart diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart b/packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_upper_content.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/presentation/widgets/expandable_bottom_sheet_upper_content.dart rename to packages/deriv_ui/lib/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_upper_content.dart diff --git a/packages/deriv_ui/lib/deriv_ui.dart b/packages/deriv_ui/lib/deriv_ui.dart index 92a1a39f0..52aab3551 100644 --- a/packages/deriv_ui/lib/deriv_ui.dart +++ b/packages/deriv_ui/lib/deriv_ui.dart @@ -1,3 +1,3 @@ -export 'presentation/widgets/widgets.dart'; -export 'presentation/components/components.dart'; +export 'widgets/widgets.dart'; +export 'components/components.dart'; export 'utils/utils.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/banner/banner.dart b/packages/deriv_ui/lib/presentation/components/banner/banner.dart deleted file mode 100644 index 870f5c74e..000000000 --- a/packages/deriv_ui/lib/presentation/components/banner/banner.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'constants.dart'; -export 'stacked_banner.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/components.dart b/packages/deriv_ui/lib/presentation/components/components.dart deleted file mode 100644 index fb18e7a39..000000000 --- a/packages/deriv_ui/lib/presentation/components/components.dart +++ /dev/null @@ -1,3 +0,0 @@ -export 'banner/banner.dart'; -export 'date_range_picker/deriv_date_range_picker.dart'; -export 'expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart'; diff --git a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart b/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart deleted file mode 100644 index 90777ab57..000000000 --- a/packages/deriv_ui/lib/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet.dart +++ /dev/null @@ -1,2 +0,0 @@ -export 'presentation/widgets/expandable_bottom_sheet.dart'; -export 'core/utils/device_info.dart'; diff --git a/packages/deriv_ui/lib/utils/popup_dialogs_helper.dart b/packages/deriv_ui/lib/utils/popup_dialogs_helper.dart index bb5e11de1..29cad84d9 100644 --- a/packages/deriv_ui/lib/utils/popup_dialogs_helper.dart +++ b/packages/deriv_ui/lib/utils/popup_dialogs_helper.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:deriv_theme/deriv_theme.dart'; -import 'package:deriv_ui/presentation/widgets/loading_indicator.dart'; -import 'package:deriv_ui/presentation/widgets/popup_alert_dialog.dart'; -import 'package:deriv_ui/presentation/widgets/text_span_hyperlink.dart'; +import 'package:deriv_ui/widgets/loading_indicator.dart'; +import 'package:deriv_ui/widgets/popup_alert_dialog.dart'; +import 'package:deriv_ui/widgets/text_span_hyperlink.dart'; import 'package:flutter/material.dart'; /// Displays a pop alert dialog, usually retry and it is used when there is no connection to internet. diff --git a/packages/deriv_ui/lib/presentation/widgets/app_setting_gesture_detector.dart b/packages/deriv_ui/lib/widgets/app_setting_gesture_detector.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/app_setting_gesture_detector.dart rename to packages/deriv_ui/lib/widgets/app_setting_gesture_detector.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/base_text_field.dart b/packages/deriv_ui/lib/widgets/base_text_field.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/base_text_field.dart rename to packages/deriv_ui/lib/widgets/base_text_field.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/custom_alert_dialog.dart b/packages/deriv_ui/lib/widgets/custom_alert_dialog.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/custom_alert_dialog.dart rename to packages/deriv_ui/lib/widgets/custom_alert_dialog.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/custom_checkbox.dart b/packages/deriv_ui/lib/widgets/custom_checkbox.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/custom_checkbox.dart rename to packages/deriv_ui/lib/widgets/custom_checkbox.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/custom_image.dart b/packages/deriv_ui/lib/widgets/custom_image.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/custom_image.dart rename to packages/deriv_ui/lib/widgets/custom_image.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/fullscreen_message.dart b/packages/deriv_ui/lib/widgets/fullscreen_message.dart similarity index 95% rename from packages/deriv_ui/lib/presentation/widgets/fullscreen_message.dart rename to packages/deriv_ui/lib/widgets/fullscreen_message.dart index 1ca4dc118..7d60764b9 100644 --- a/packages/deriv_ui/lib/presentation/widgets/fullscreen_message.dart +++ b/packages/deriv_ui/lib/widgets/fullscreen_message.dart @@ -1,8 +1,8 @@ import 'package:deriv_theme/deriv_theme.dart'; import 'package:deriv_ui/models/custom_icon_data_model.dart'; -import 'package:deriv_ui/presentation/widgets/app_setting_gesture_detector.dart'; -import 'package:deriv_ui/presentation/widgets/custom_image.dart'; -import 'package:deriv_ui/presentation/widgets/loading_indicator.dart'; +import 'package:deriv_ui/widgets/app_setting_gesture_detector.dart'; +import 'package:deriv_ui/widgets/custom_image.dart'; +import 'package:deriv_ui/widgets/loading_indicator.dart'; import 'package:flutter/material.dart'; /// A widget to display messages in a form of warnings, information, or any diff --git a/packages/deriv_ui/lib/presentation/widgets/info_icon_button.dart b/packages/deriv_ui/lib/widgets/info_icon_button.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/info_icon_button.dart rename to packages/deriv_ui/lib/widgets/info_icon_button.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/interaction.dart b/packages/deriv_ui/lib/widgets/interaction.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/interaction.dart rename to packages/deriv_ui/lib/widgets/interaction.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/loading_indicator.dart b/packages/deriv_ui/lib/widgets/loading_indicator.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/loading_indicator.dart rename to packages/deriv_ui/lib/widgets/loading_indicator.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/picture_badge.dart b/packages/deriv_ui/lib/widgets/picture_badge.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/picture_badge.dart rename to packages/deriv_ui/lib/widgets/picture_badge.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/popup_alert_dialog.dart b/packages/deriv_ui/lib/widgets/popup_alert_dialog.dart similarity index 97% rename from packages/deriv_ui/lib/presentation/widgets/popup_alert_dialog.dart rename to packages/deriv_ui/lib/widgets/popup_alert_dialog.dart index c26e9027b..459095a3c 100644 --- a/packages/deriv_ui/lib/presentation/widgets/popup_alert_dialog.dart +++ b/packages/deriv_ui/lib/widgets/popup_alert_dialog.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'package:deriv_theme/deriv_theme.dart'; -import 'package:deriv_ui/presentation/widgets/custom_checkbox.dart'; -import 'package:deriv_ui/presentation/widgets/loading_indicator.dart'; +import 'package:deriv_ui/widgets/custom_checkbox.dart'; +import 'package:deriv_ui/widgets/loading_indicator.dart'; import 'package:flutter/material.dart'; /// A popup alert dialog widget that pops up at the centre of a page and overlays diff --git a/packages/deriv_ui/lib/presentation/widgets/primary_button.dart b/packages/deriv_ui/lib/widgets/primary_button.dart similarity index 94% rename from packages/deriv_ui/lib/presentation/widgets/primary_button.dart rename to packages/deriv_ui/lib/widgets/primary_button.dart index 706c2ff25..699393f1c 100644 --- a/packages/deriv_ui/lib/presentation/widgets/primary_button.dart +++ b/packages/deriv_ui/lib/widgets/primary_button.dart @@ -1,5 +1,5 @@ import 'package:deriv_theme/deriv_theme.dart'; -import 'package:deriv_ui/presentation/widgets/interaction.dart'; +import 'package:deriv_ui/widgets/interaction.dart'; import 'package:flutter/material.dart'; /// Button with brand color diff --git a/packages/deriv_ui/lib/presentation/widgets/secondary_button.dart b/packages/deriv_ui/lib/widgets/secondary_button.dart similarity index 95% rename from packages/deriv_ui/lib/presentation/widgets/secondary_button.dart rename to packages/deriv_ui/lib/widgets/secondary_button.dart index 9b8d6c49d..f508dbd15 100644 --- a/packages/deriv_ui/lib/presentation/widgets/secondary_button.dart +++ b/packages/deriv_ui/lib/widgets/secondary_button.dart @@ -1,5 +1,5 @@ import 'package:deriv_theme/deriv_theme.dart'; -import 'package:deriv_ui/presentation/widgets/interaction.dart'; +import 'package:deriv_ui/widgets/interaction.dart'; import 'package:flutter/material.dart'; /// Button with base color diff --git a/packages/deriv_ui/lib/presentation/widgets/text_span_hyperlink.dart b/packages/deriv_ui/lib/widgets/text_span_hyperlink.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/text_span_hyperlink.dart rename to packages/deriv_ui/lib/widgets/text_span_hyperlink.dart diff --git a/packages/deriv_ui/lib/presentation/widgets/widgets.dart b/packages/deriv_ui/lib/widgets/widgets.dart similarity index 100% rename from packages/deriv_ui/lib/presentation/widgets/widgets.dart rename to packages/deriv_ui/lib/widgets/widgets.dart diff --git a/packages/deriv_ui/test/presentation/components/banner/stacked_banner_test.dart b/packages/deriv_ui/test/components/banner/widgets/stacked_banner_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/banner/stacked_banner_test.dart rename to packages/deriv_ui/test/components/banner/widgets/stacked_banner_test.dart diff --git a/packages/deriv_ui/test/presentation/components/date_range_picker/core/date_input_formatter_test.dart b/packages/deriv_ui/test/components/date_range_picker/core/date_input_formatter_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/date_range_picker/core/date_input_formatter_test.dart rename to packages/deriv_ui/test/components/date_range_picker/core/date_input_formatter_test.dart diff --git a/packages/deriv_ui/test/presentation/components/date_range_picker/core/debug_test.dart b/packages/deriv_ui/test/components/date_range_picker/core/debug_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/date_range_picker/core/debug_test.dart rename to packages/deriv_ui/test/components/date_range_picker/core/debug_test.dart diff --git a/packages/deriv_ui/test/presentation/components/date_range_picker/core/helper_test.dart b/packages/deriv_ui/test/components/date_range_picker/core/helpers_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/date_range_picker/core/helper_test.dart rename to packages/deriv_ui/test/components/date_range_picker/core/helpers_test.dart diff --git a/packages/deriv_ui/test/presentation/components/date_range_picker/date_range_picker_test.dart b/packages/deriv_ui/test/components/date_range_picker/widgets/date_range_picker_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/date_range_picker/date_range_picker_test.dart rename to packages/deriv_ui/test/components/date_range_picker/widgets/date_range_picker_test.dart diff --git a/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/device_info_test.dart b/packages/deriv_ui/test/components/expandable_bottom_sheet/core/device_info_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/device_info_test.dart rename to packages/deriv_ui/test/components/expandable_bottom_sheet/core/device_info_test.dart diff --git a/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart b/packages/deriv_ui/test/components/expandable_bottom_sheet/core/expandable_bottom_sheet_controller_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/core/utils/expandable_bottom_sheet_controller_test.dart rename to packages/deriv_ui/test/components/expandable_bottom_sheet/core/expandable_bottom_sheet_controller_test.dart diff --git a/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart b/packages/deriv_ui/test/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart rename to packages/deriv_ui/test/components/expandable_bottom_sheet/states/expandable_bottom_sheet_provider_test.dart diff --git a/packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart b/packages/deriv_ui/test/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/components/expandable_bottom_sheet/deriv_expandable_bottom_sheet_test.dart rename to packages/deriv_ui/test/components/expandable_bottom_sheet/widgets/expandable_bottom_sheet_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/app_setting_gesture_detector_test.dart b/packages/deriv_ui/test/widgets/app_setting_gesture_detector_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/app_setting_gesture_detector_test.dart rename to packages/deriv_ui/test/widgets/app_setting_gesture_detector_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/base_text_field_test.dart b/packages/deriv_ui/test/widgets/base_text_field_test.dart similarity index 97% rename from packages/deriv_ui/test/presentation/widgets/base_text_field_test.dart rename to packages/deriv_ui/test/widgets/base_text_field_test.dart index 90111ff76..24a5c12ca 100644 --- a/packages/deriv_ui/test/presentation/widgets/base_text_field_test.dart +++ b/packages/deriv_ui/test/widgets/base_text_field_test.dart @@ -1,4 +1,4 @@ -import 'package:deriv_ui/presentation/widgets/widgets.dart'; +import 'package:deriv_ui/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/custom_alert_dialog_test.dart b/packages/deriv_ui/test/widgets/custom_alert_dialog_test.dart similarity index 97% rename from packages/deriv_ui/test/presentation/widgets/custom_alert_dialog_test.dart rename to packages/deriv_ui/test/widgets/custom_alert_dialog_test.dart index 21af1a0ab..6033a4077 100644 --- a/packages/deriv_ui/test/presentation/widgets/custom_alert_dialog_test.dart +++ b/packages/deriv_ui/test/widgets/custom_alert_dialog_test.dart @@ -1,4 +1,4 @@ -import 'package:deriv_ui/presentation/widgets/widgets.dart'; +import 'package:deriv_ui/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/custom_checkbox_test.dart b/packages/deriv_ui/test/widgets/custom_checkbox_test.dart similarity index 95% rename from packages/deriv_ui/test/presentation/widgets/custom_checkbox_test.dart rename to packages/deriv_ui/test/widgets/custom_checkbox_test.dart index ffa958614..1c9cf0a85 100644 --- a/packages/deriv_ui/test/presentation/widgets/custom_checkbox_test.dart +++ b/packages/deriv_ui/test/widgets/custom_checkbox_test.dart @@ -1,4 +1,4 @@ -import 'package:deriv_ui/presentation/widgets/widgets.dart'; +import 'package:deriv_ui/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/custom_image_test.dart b/packages/deriv_ui/test/widgets/custom_image_test.dart similarity index 97% rename from packages/deriv_ui/test/presentation/widgets/custom_image_test.dart rename to packages/deriv_ui/test/widgets/custom_image_test.dart index 18ad29e41..823caa260 100644 --- a/packages/deriv_ui/test/presentation/widgets/custom_image_test.dart +++ b/packages/deriv_ui/test/widgets/custom_image_test.dart @@ -1,5 +1,5 @@ import 'package:deriv_ui/models/custom_icon_data_model.dart'; -import 'package:deriv_ui/presentation/widgets/widgets.dart'; +import 'package:deriv_ui/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/fullscreen_message_test.dart b/packages/deriv_ui/test/widgets/fullscreen_message_test.dart similarity index 97% rename from packages/deriv_ui/test/presentation/widgets/fullscreen_message_test.dart rename to packages/deriv_ui/test/widgets/fullscreen_message_test.dart index 918374e0f..9fa9931d8 100644 --- a/packages/deriv_ui/test/presentation/widgets/fullscreen_message_test.dart +++ b/packages/deriv_ui/test/widgets/fullscreen_message_test.dart @@ -1,5 +1,5 @@ import 'package:deriv_ui/models/custom_icon_data_model.dart'; -import 'package:deriv_ui/presentation/widgets/widgets.dart'; +import 'package:deriv_ui/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/info_icon_button_test.dart b/packages/deriv_ui/test/widgets/info_icon_button_test.dart similarity index 96% rename from packages/deriv_ui/test/presentation/widgets/info_icon_button_test.dart rename to packages/deriv_ui/test/widgets/info_icon_button_test.dart index b13cf5d18..af50e3935 100644 --- a/packages/deriv_ui/test/presentation/widgets/info_icon_button_test.dart +++ b/packages/deriv_ui/test/widgets/info_icon_button_test.dart @@ -1,4 +1,4 @@ -import 'package:deriv_ui/presentation/widgets/widgets.dart'; +import 'package:deriv_ui/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/deriv_ui/test/presentation/widgets/interaction_test.dart b/packages/deriv_ui/test/widgets/interaction_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/interaction_test.dart rename to packages/deriv_ui/test/widgets/interaction_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/loading_indicator_test.dart b/packages/deriv_ui/test/widgets/loading_indicator_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/loading_indicator_test.dart rename to packages/deriv_ui/test/widgets/loading_indicator_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/picture_badge_test.dart b/packages/deriv_ui/test/widgets/picture_badge_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/picture_badge_test.dart rename to packages/deriv_ui/test/widgets/picture_badge_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/popup_alert_dialog_test.dart b/packages/deriv_ui/test/widgets/popup_alert_dialog_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/popup_alert_dialog_test.dart rename to packages/deriv_ui/test/widgets/popup_alert_dialog_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/primary_button_test.dart b/packages/deriv_ui/test/widgets/primary_button_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/primary_button_test.dart rename to packages/deriv_ui/test/widgets/primary_button_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/secondary_button_test.dart b/packages/deriv_ui/test/widgets/secondary_button_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/secondary_button_test.dart rename to packages/deriv_ui/test/widgets/secondary_button_test.dart diff --git a/packages/deriv_ui/test/presentation/widgets/text_span_hyperlink_test.dart b/packages/deriv_ui/test/widgets/text_span_hyperlink_test.dart similarity index 100% rename from packages/deriv_ui/test/presentation/widgets/text_span_hyperlink_test.dart rename to packages/deriv_ui/test/widgets/text_span_hyperlink_test.dart From 942c55c395b2b79e25fcd50f7cbe0552914432f9 Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:27:47 +0800 Subject: [PATCH 8/9] fix: imports in deriv_auth --- .../presentation/layouts/deriv_success_pass_change_layout.dart | 2 +- .../core/layouts/deriv_unavailable_country_layout_test.dart | 2 +- .../login/presentation/layouts/deriv_2fa_layout_test.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart index 6bf684972..4d6cd57ec 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_success_pass_change_layout.dart @@ -1,6 +1,6 @@ import 'package:deriv_auth/core/extensions/context_extension.dart'; import 'package:deriv_theme/deriv_theme.dart'; -import 'package:deriv_ui/presentation/widgets/loading_indicator.dart'; +import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; /// Success pass change page layout. diff --git a/packages/deriv_auth/test/core/layouts/deriv_unavailable_country_layout_test.dart b/packages/deriv_auth/test/core/layouts/deriv_unavailable_country_layout_test.dart index e15645310..81b3fc16d 100644 --- a/packages/deriv_auth/test/core/layouts/deriv_unavailable_country_layout_test.dart +++ b/packages/deriv_auth/test/core/layouts/deriv_unavailable_country_layout_test.dart @@ -1,5 +1,5 @@ import 'package:deriv_auth/core/layouts/deriv_unavailable_country_layout.dart'; -import 'package:deriv_ui/presentation/widgets/fullscreen_message.dart'; +import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:patrol_finders/patrol_finders.dart'; import '../../base_test_app.dart'; diff --git a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_2fa_layout_test.dart b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_2fa_layout_test.dart index 5c3a3016d..7762161a6 100644 --- a/packages/deriv_auth/test/features/login/presentation/layouts/deriv_2fa_layout_test.dart +++ b/packages/deriv_auth/test/features/login/presentation/layouts/deriv_2fa_layout_test.dart @@ -2,7 +2,7 @@ import 'package:deriv_auth/core/models/landig_comany_model.dart'; import 'package:deriv_auth/deriv_auth.dart'; -import 'package:deriv_ui/presentation/widgets/base_text_field.dart'; +import 'package:deriv_ui/deriv_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; From eefd247aca73d2d3f9d5ad0fa739d428fd04a95d Mon Sep 17 00:00:00 2001 From: behnam-deriv <133759298+behnam-deriv@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:02:53 +0800 Subject: [PATCH 9/9] chore: fix links in readme --- packages/deriv_ui/README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/deriv_ui/README.md b/packages/deriv_ui/README.md index 106235759..918bd73af 100644 --- a/packages/deriv_ui/README.md +++ b/packages/deriv_ui/README.md @@ -10,26 +10,26 @@ Here is the detailed structure of the components included in this package: ## Components -- [Banner](./lib/presentation/components/banner/README.md) -- [Date Range Picker](./lib/presentation/components/date_range_picker/README.md) -- [Expandable bottom sheet](./lib/presentation/components/expandable_bottom_sheet/README.md) +- [Banner](./lib/components/banner/README.md) +- [Date Range Picker](./lib/components/date_range_picker/README.md) +- [Expandable bottom sheet](./lib/components/expandable_bottom_sheet/README.md) ## Widgets -- [App Setting Gesture Detector](./lib/presentation/widgets/app_setting_gesture_detector.dart) -- [Base Text Field](./lib/presentation/widgets/base_text_field.dart) -- [Custom Alert Dialog](./lib/presentation/widgets/custom_alert_dialog.dart) -- [Custom Checkbox](./lib/presentation/widgets/custom_checkbox.dart) -- [Custom Image](./lib/presentation/widgets/custom_image.dart) -- [Full Screen Message](./lib/presentation/widgets/fullscreen_message.dart) -- [Info Icon Button](./lib/presentation/widgets/info_icon_button.dart) -- [Interaction](./lib/presentation/widgets/interaction.dart) -- [Loading Indicator](./lib/presentation/widgets/loading_indicator.dart) -- [Picture Badge](./lib/presentation/widgets/picture_badge.dart) -- [Popup Alert Dialog](./lib/presentation/widgets/popup_alert_dialog.dart) -- [Primary Button](./lib/presentation/widgets/primary_button.dart) -- [Secondary Button](./lib/presentation/widgets/secondary_button.dart) -- [Text Span Hyperlink](./lib/presentation/widgets/text_span_hyperlink.dart) +- [App Setting Gesture Detector](./lib/widgets/app_setting_gesture_detector.dart) +- [Base Text Field](./lib/widgets/base_text_field.dart) +- [Custom Alert Dialog](./lib/widgets/custom_alert_dialog.dart) +- [Custom Checkbox](./lib/widgets/custom_checkbox.dart) +- [Custom Image](./lib/widgets/custom_image.dart) +- [Full Screen Message](./lib/widgets/fullscreen_message.dart) +- [Info Icon Button](./lib/widgets/info_icon_button.dart) +- [Interaction](./lib/widgets/interaction.dart) +- [Loading Indicator](./lib/widgets/loading_indicator.dart) +- [Picture Badge](./lib/widgets/picture_badge.dart) +- [Popup Alert Dialog](./lib/widgets/popup_alert_dialog.dart) +- [Primary Button](./lib/widgets/primary_button.dart) +- [Secondary Button](./lib/widgets/secondary_button.dart) +- [Text Span Hyperlink](./lib/widgets/text_span_hyperlink.dart) ## Utilities