kasy-cli 1.21.9 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/add.js +93 -80
- package/lib/commands/configure.js +100 -32
- package/lib/commands/doctor.js +28 -2
- package/lib/commands/new.js +80 -37
- package/lib/commands/notifications.js +1 -1
- package/lib/commands/remove.js +43 -15
- package/lib/commands/run.js +2 -2
- package/lib/commands/update.js +2 -2
- package/lib/scaffold/CHANGELOG.json +14 -0
- package/lib/scaffold/backends/api/generator.js +14 -14
- package/lib/scaffold/backends/api/patch/README.md +83 -0
- package/lib/scaffold/backends/api/patch/lib/core/data/api/storage_api.dart +1 -1
- package/lib/scaffold/backends/api/patch/lib/core/data/entities/user_entity.dart +5 -0
- package/lib/scaffold/backends/api/patch/lib/{environnements.dart → environments.dart} +3 -11
- package/lib/scaffold/backends/api/patch/lib/features/ai_chat/api/ai_chat_api.dart +108 -0
- package/lib/scaffold/backends/api/patch/lib/features/ai_chat/api/ai_chat_conversation_entity.dart +51 -0
- package/lib/scaffold/backends/api/patch/lib/features/{llm_chat/api/llm_chat_message_entity.dart → ai_chat/api/ai_chat_message_entity.dart} +5 -5
- package/lib/scaffold/backends/api/patch/lib/features/{llm_chat/providers/llm_chat_notifier.dart → ai_chat/providers/ai_chat_notifier.dart} +71 -38
- package/lib/scaffold/backends/api/patch/lib/features/authentication/api/authentication_api.dart +2 -2
- package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/feature_request_api.dart +54 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/models/user_info.dart +16 -16
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/components/onboarding_att_setup.dart +4 -3
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +38 -28
- package/lib/scaffold/backends/api/patch/lib/features/settings/ui/components/admin/admin_users_api.dart +100 -0
- package/lib/scaffold/backends/api/patch/lib/features/{subscription → subscriptions}/api/entities/subscription_entity.dart +13 -0
- package/lib/scaffold/backends/api/patch/lib/features/subscriptions/api/stripe_backend_api.dart +60 -0
- package/lib/scaffold/backends/api/patch/lib/features/{subscription → subscriptions}/api/subscription_api.dart +1 -1
- package/lib/scaffold/backends/api/pubspec.yaml.tpl +4 -5
- package/lib/scaffold/backends/firebase/deploy.js +87 -13
- package/lib/scaffold/backends/firebase/generator.js +5 -5
- package/lib/scaffold/backends/firebase/tokens.js +4 -4
- package/lib/scaffold/backends/supabase/deploy.js +63 -11
- package/lib/scaffold/backends/supabase/edge-functions/admin-list-users/index.ts +149 -0
- package/lib/scaffold/backends/supabase/edge-functions/{llm-chat → ai-chat}/index.ts +19 -19
- package/lib/scaffold/backends/supabase/edge-functions/revenuecat-webhook/index.ts +2 -0
- package/lib/scaffold/backends/supabase/edge-functions/stripe-create-checkout-session/index.ts +123 -0
- package/lib/scaffold/backends/supabase/edge-functions/stripe-create-portal-session/index.ts +97 -0
- package/lib/scaffold/backends/supabase/edge-functions/stripe-list-prices/index.ts +83 -0
- package/lib/scaffold/backends/supabase/edge-functions/stripe-webhook/index.ts +138 -0
- package/lib/scaffold/backends/supabase/generator.js +17 -17
- package/lib/scaffold/backends/supabase/migrations/20240101000009_ai_messages.sql +50 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000012_stripe_customers.sql +36 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000013_admin_role.sql +62 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/data/entities/user_entity.dart +4 -0
- package/lib/scaffold/backends/supabase/patch/lib/{environnements.dart → environments.dart} +3 -13
- package/lib/scaffold/backends/supabase/patch/lib/features/ai_chat/api/ai_chat_api.dart +95 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/ai_chat/api/ai_chat_conversation_entity.dart +52 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/{llm_chat/api/llm_chat_message_entity.dart → ai_chat/api/ai_chat_message_entity.dart} +6 -6
- package/lib/scaffold/backends/supabase/patch/lib/features/{llm_chat/providers/llm_chat_notifier.dart → ai_chat/providers/ai_chat_notifier.dart} +63 -35
- package/lib/scaffold/backends/supabase/patch/lib/features/authentication/api/authentication_api.dart +1 -1
- package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/api/feature_request_api.dart +46 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/models/user_info.dart +16 -16
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/components/onboarding_att_setup.dart +4 -3
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +38 -28
- package/lib/scaffold/backends/supabase/patch/lib/features/settings/ui/components/admin/admin_users_api.dart +93 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/{subscription → subscriptions}/api/entities/subscription_entity.dart +13 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/subscriptions/api/stripe_backend_api.dart +52 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/{subscription → subscriptions}/api/subscription_api.dart +1 -1
- package/lib/scaffold/backends/supabase/pubspec.yaml.tpl +4 -5
- package/lib/scaffold/backends/supabase/tokens.js +3 -3
- package/lib/scaffold/catalog.js +9 -11
- package/lib/scaffold/generate.js +45 -31
- package/lib/scaffold/shared/generator-utils.js +188 -81
- package/lib/scaffold/shared/sort-imports.js +191 -0
- package/lib/scaffold/shared/template-strings.js +3 -3
- package/lib/utils/checks.js +2 -2
- package/lib/utils/i18n/messages-en.js +50 -35
- package/lib/utils/i18n/messages-es.js +50 -35
- package/lib/utils/i18n/messages-pt.js +52 -37
- package/lib/utils/updates.js +15 -15
- package/package.json +1 -1
- package/templates/firebase/.env.example +2 -2
- package/templates/firebase/android/app/src/main/res/drawable/background.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-night/background.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-night-v21/background.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-v21/background.png +0 -0
- package/templates/firebase/android/app/src/main/res/values-night-v31/styles.xml +1 -1
- package/templates/firebase/android/app/src/main/res/values-v31/styles.xml +1 -1
- package/templates/firebase/assets/images/logo_wordmark_dark.png +0 -0
- package/templates/firebase/assets/images/logo_wordmark_light.png +0 -0
- package/templates/firebase/docs/revenuecat-setup.es.md +1 -1
- package/templates/firebase/docs/revenuecat-setup.pt.md +1 -1
- package/templates/firebase/firestore.rules +24 -5
- package/templates/firebase/functions/package-lock.json +22 -1
- package/templates/firebase/functions/package.json +2 -1
- package/templates/firebase/functions/src/admin/functions.ts +113 -0
- package/templates/firebase/functions/src/{llm_chat → ai_chat}/index.ts +16 -16
- package/templates/firebase/functions/src/index.ts +8 -2
- package/templates/firebase/functions/src/notifications/device_triggers.ts +2 -2
- package/templates/firebase/functions/src/notifications/triggers.ts +3 -3
- package/templates/firebase/functions/src/subscriptions/models/subscription_status.ts +2 -0
- package/templates/firebase/functions/src/subscriptions/stripe_functions.ts +222 -0
- package/templates/firebase/functions/src/subscriptions/subscriptions_functions.ts +2 -2
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchBackground.imageset/darkbackground.png +0 -0
- package/templates/firebase/lib/components/components.dart +4 -1
- package/templates/firebase/lib/components/kasy_app_bar.dart +22 -7
- package/templates/firebase/lib/components/kasy_avatar.dart +7 -6
- package/templates/firebase/lib/components/kasy_button.dart +23 -99
- package/templates/firebase/lib/components/kasy_dialog.dart +11 -11
- package/templates/firebase/lib/components/kasy_image_viewer.dart +84 -0
- package/templates/firebase/lib/components/{kasy_sidebar_pro.dart → kasy_sidebar.dart} +692 -425
- package/templates/firebase/lib/components/kasy_status_tag.dart +91 -0
- package/templates/firebase/lib/components/kasy_text_area.dart +1 -3
- package/templates/firebase/lib/components/kasy_text_field.dart +5 -6
- package/templates/firebase/lib/components/kasy_text_field_otp.dart +1 -3
- package/templates/firebase/lib/components/kasy_toast.dart +2 -2
- package/templates/firebase/lib/components/kasy_web_header.dart +209 -0
- package/templates/firebase/lib/core/ads/ads_provider.dart +1 -1
- package/templates/firebase/lib/core/bottom_menu/bottom_menu.dart +57 -4
- package/templates/firebase/lib/core/bottom_menu/bottom_router.dart +19 -91
- package/templates/firebase/lib/core/bottom_menu/kasy_bottom_bar_factory.dart +196 -96
- package/templates/firebase/lib/core/bottom_menu/web_content_wrapper.dart +41 -0
- package/templates/firebase/lib/core/config/app_env.dart +5 -11
- package/templates/firebase/lib/core/config/features.dart +5 -4
- package/templates/firebase/lib/core/data/api/analytics_api.dart +1 -1
- package/templates/firebase/lib/core/data/api/http_client.dart +1 -1
- package/templates/firebase/lib/core/data/entities/user_entity.dart +3 -0
- package/templates/firebase/lib/core/data/models/entitlement.dart +35 -0
- package/templates/firebase/lib/core/data/models/subscription.dart +13 -186
- package/templates/firebase/lib/core/data/models/user.dart +11 -0
- package/templates/firebase/lib/core/data/repositories/user_repository.dart +1 -1
- package/templates/firebase/lib/core/home_widgets/home_widget_background_task.dart +1 -1
- package/templates/firebase/lib/core/home_widgets/home_widget_mywidget_service.dart +1 -1
- package/templates/firebase/lib/core/icons/kasy_icons.dart +31 -1
- package/templates/firebase/lib/core/rating/api/rating_api.dart +2 -2
- package/templates/firebase/lib/core/states/logout_action.dart +25 -0
- package/templates/firebase/lib/core/states/user_state_notifier.dart +3 -3
- package/templates/firebase/lib/core/theme/colors.dart +488 -188
- package/templates/firebase/lib/core/theme/radius.dart +22 -11
- package/templates/firebase/lib/core/theme/shadows.dart +66 -0
- package/templates/firebase/lib/core/theme/texts.dart +75 -41
- package/templates/firebase/lib/core/theme/universal_theme.dart +9 -4
- package/templates/firebase/lib/core/web_device_preview/web_device_preview.dart +5 -4
- package/templates/firebase/lib/core/web_viewport_scale.dart +52 -0
- package/templates/firebase/lib/core/widgets/kasy_brand_badge.dart +118 -0
- package/templates/firebase/lib/core/widgets/kasy_brand_logo.dart +40 -0
- package/templates/firebase/lib/core/widgets/kasy_focus_ring.dart +125 -0
- package/templates/firebase/lib/core/widgets/kasy_hover.dart +33 -13
- package/templates/firebase/lib/core/widgets/kasy_pressable_depth.dart +18 -13
- package/templates/firebase/lib/{environnements.dart → environments.dart} +3 -14
- package/templates/firebase/lib/features/ai_chat/ai_chat_page.dart +159 -0
- package/templates/firebase/lib/features/ai_chat/api/ai_chat_api.dart +107 -0
- package/templates/firebase/lib/features/ai_chat/api/ai_chat_conversation_entity.dart +64 -0
- package/templates/firebase/lib/features/{llm_chat/api/llm_chat_message_entity.dart → ai_chat/api/ai_chat_message_entity.dart} +6 -6
- package/templates/firebase/lib/features/{llm_chat/providers/llm_chat_notifier.dart → ai_chat/providers/ai_chat_notifier.dart} +73 -38
- package/templates/firebase/lib/features/ai_chat/providers/ai_conversations_notifier.dart +103 -0
- package/templates/firebase/lib/features/{llm_chat/ui/widgets/llm_chat_avatars.dart → ai_chat/ui/widgets/ai_chat_avatars.dart} +13 -13
- package/templates/firebase/lib/features/{llm_chat/ui/widgets/llm_chat_composer.dart → ai_chat/ui/widgets/ai_chat_composer.dart} +10 -10
- package/templates/firebase/lib/features/{llm_chat/llm_chat_page.dart → ai_chat/ui/widgets/ai_chat_conversation_view.dart} +80 -67
- package/templates/firebase/lib/features/ai_chat/ui/widgets/ai_conversation_list.dart +285 -0
- package/templates/firebase/lib/features/ai_chat/ui/widgets/ai_conversation_tile.dart +163 -0
- package/templates/firebase/lib/features/authentication/api/authentication_api.dart +52 -13
- package/templates/firebase/lib/features/authentication/api/popup_dismiss_watcher.dart +12 -0
- package/templates/firebase/lib/features/authentication/api/popup_dismiss_watcher_web.dart +35 -0
- package/templates/firebase/lib/features/authentication/ui/recover_password_page.dart +108 -68
- package/templates/firebase/lib/features/authentication/ui/signin_page.dart +38 -51
- package/templates/firebase/lib/features/authentication/ui/signup_page.dart +38 -51
- package/templates/firebase/lib/features/authentication/ui/widgets/auth_card_scaffold.dart +118 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/recover_password_result.dart +61 -44
- package/templates/firebase/lib/features/feedbacks/api/feature_request_api.dart +32 -0
- package/templates/firebase/lib/features/feedbacks/models/feedback_state.dart +5 -5
- package/templates/firebase/lib/features/feedbacks/providers/feedback_page_notifier.dart +2 -2
- package/templates/firebase/lib/features/home/design_system_page.dart +808 -170
- package/templates/firebase/lib/features/home/home_components_page.dart +6 -3
- package/templates/firebase/lib/features/home/home_components_preview_page.dart +6 -6
- package/templates/firebase/lib/features/home/home_components_preview_registry.dart +325 -186
- package/templates/firebase/lib/features/home/home_feed.dart +289 -0
- package/templates/firebase/lib/features/home/home_image_grid.dart +355 -0
- package/templates/firebase/lib/features/home/home_page.dart +11 -250
- package/templates/firebase/lib/features/{local_reminder → local_reminders}/providers/reminder_notifier.dart +1 -1
- package/templates/firebase/lib/features/{local_reminder → local_reminders}/ui/reminder_page.dart +2 -2
- package/templates/firebase/lib/features/notifications/shared/att_permission.dart +1 -1
- package/templates/firebase/lib/features/notifications/ui/request_notification_permission.dart +25 -61
- package/templates/firebase/lib/features/notifications/ui/widgets/permission_request_view.dart +117 -0
- package/templates/firebase/lib/features/onboarding/models/user_info.dart +16 -16
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_att_setup.dart +4 -3
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_features.dart +7 -9
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_loader.dart +71 -48
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +3 -2
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_questions.dart +5 -5
- package/templates/firebase/lib/features/onboarding/ui/onboarding_page.dart +4 -4
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_background.dart +4 -2
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_feature.dart +39 -121
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_illustration_scaffold.dart +105 -70
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_module_mockups.dart +639 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_progress.dart +62 -50
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +38 -28
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_step_header.dart +75 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_sticky_footer.dart +16 -5
- package/templates/firebase/lib/features/onboarding/ui/widgets/selectable_row_tile.dart +26 -22
- package/templates/firebase/lib/features/settings/settings_page.dart +601 -90
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_page.dart +1193 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_paywalls.dart +1 -1
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_routes.dart +2 -3
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_users_api.dart +86 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_users_tab.dart +1215 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/send_push_notification_page.dart +236 -0
- package/templates/firebase/lib/features/settings/ui/components/avatar_component.dart +3 -3
- package/templates/firebase/lib/features/settings/ui/widgets/kasy_user_avatar.dart +77 -0
- package/templates/firebase/lib/features/settings/ui/widgets/settings_tile.dart +1 -0
- package/templates/firebase/lib/features/{subscription → subscriptions}/api/entities/subscription_entity.dart +17 -0
- package/templates/firebase/lib/features/{subscription → subscriptions}/api/inapp_subscription_api.dart +67 -46
- package/templates/firebase/lib/features/subscriptions/api/revenuecat_product.dart +189 -0
- package/templates/firebase/lib/features/subscriptions/api/stripe_backend_api.dart +55 -0
- package/templates/firebase/lib/features/subscriptions/api/stripe_payment_api.dart +82 -0
- package/templates/firebase/lib/features/subscriptions/api/stripe_product.dart +178 -0
- package/templates/firebase/lib/features/{subscription → subscriptions}/api/subscription_api.dart +1 -1
- package/templates/firebase/lib/features/subscriptions/api/subscription_payment_api.dart +53 -0
- package/templates/firebase/lib/features/subscriptions/api/subscription_payment_api_provider.dart +21 -0
- package/templates/firebase/lib/features/{subscription → subscriptions}/providers/premium_page_provider.dart +9 -6
- package/templates/firebase/lib/features/{subscription → subscriptions}/repositories/subscription_repository.dart +26 -30
- package/{lib/scaffold/backends/supabase/patch/lib/features/subscription → templates/firebase/lib/features/subscriptions}/shared/maybeshow_premium.dart +0 -2
- package/templates/firebase/lib/features/subscriptions/shared/subscription_management.dart +45 -0
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/component/active_premium_content.dart +28 -4
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/component/paywall_minimal.dart +7 -7
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/component/paywall_row.dart +8 -8
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/component/paywall_with_switch.dart +7 -7
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/component/premium_content.dart +7 -7
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/component/premium_page_factory.dart +5 -5
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/premium_page.dart +5 -5
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/comparison_table.dart +1 -1
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/paywall_empty_state.dart +4 -4
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_bottom_menu.dart +3 -4
- package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/selectable_col.dart +1 -1
- package/templates/firebase/lib/i18n/en.i18n.json +171 -46
- package/templates/firebase/lib/i18n/es.i18n.json +175 -50
- package/templates/firebase/lib/i18n/pt.i18n.json +166 -41
- package/templates/firebase/lib/main.dart +6 -3
- package/templates/firebase/lib/router.dart +15 -23
- package/templates/firebase/pubspec.yaml +4 -5
- package/templates/firebase/test/core/data/repositories/user_repository_test.dart +3 -3
- package/templates/firebase/test/core/states/user_state_notifier_test.dart +4 -4
- package/templates/firebase/test/core/widgets/focus_ring_shape_test.dart +55 -0
- package/templates/firebase/test/features/{subscription → subscriptions}/api/fake_inapp_subscription_api.dart +11 -4
- package/templates/firebase/test/features/{subscription → subscriptions}/api/fake_revenuecat_product.dart +1 -0
- package/templates/firebase/test/features/{subscription → subscriptions}/api/fake_subscription_api.dart +2 -2
- package/templates/firebase/test/features/{subscription → subscriptions}/subscription_page_test.dart +4 -4
- package/templates/firebase/test/test_utils.dart +6 -6
- package/templates/firebase/web/index.html +5 -2
- package/lib/scaffold/backends/api/patch/lib/features/llm_chat/api/llm_chat_api.dart +0 -58
- package/lib/scaffold/backends/api/patch/lib/features/subscription/shared/maybeshow_premium.dart +0 -86
- package/lib/scaffold/backends/supabase/migrations/20240101000009_llm_messages.sql +0 -22
- package/lib/scaffold/backends/supabase/patch/lib/features/llm_chat/api/llm_chat_api.dart +0 -47
- package/templates/firebase/assets/images/onboarding/authentication-login-template.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/img2.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/img3.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/notifications.png +0 -0
- package/templates/firebase/assets/images/onboarding/purchase.png +0 -0
- package/templates/firebase/lib/core/sidebar/kasy_sidebar.dart +0 -2021
- package/templates/firebase/lib/features/authentication/ui/widgets/auth_brand.dart +0 -35
- package/templates/firebase/lib/features/home/home_features_page.dart +0 -207
- package/templates/firebase/lib/features/llm_chat/api/llm_chat_api.dart +0 -50
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_bottom_sheet.dart +0 -316
- package/templates/firebase/lib/features/subscription/shared/maybeshow_premium.dart +0 -85
- /package/templates/firebase/lib/features/{local_reminder → local_reminders}/repositories/reminder_preferences.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/providers/models/premium_state.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/feature_line.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_background.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_background_gradient.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_banner.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_card.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_close_button.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/premium_feature.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/selectable_row.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/trial_switcher.dart +0 -0
- /package/templates/firebase/lib/features/{subscription → subscriptions}/ui/widgets/unsubscribe_feedback_popup.dart +0 -0
|
@@ -1,224 +1,475 @@
|
|
|
1
1
|
import 'package:flutter/material.dart';
|
|
2
2
|
|
|
3
|
-
/// Kasy Design System — Color Tokens
|
|
3
|
+
/// Kasy Design System — Color Tokens (HeroUI semantic model)
|
|
4
4
|
///
|
|
5
|
-
/// Single source of truth for all colors in the app.
|
|
6
|
-
///
|
|
5
|
+
/// Single source of truth for all colors in the app. Mirrors the HeroUI
|
|
6
|
+
/// color system: a small, meaningful set of semantic roles (accent, default,
|
|
7
|
+
/// success, warning, danger, foreground, background, surface, form field,
|
|
8
|
+
/// separator) rather than a large raw palette. Each role exposes its base
|
|
9
|
+
/// value plus `hover`, `soft`, `soft-hover` and `soft-foreground` variants
|
|
10
|
+
/// where applicable, and resolves to a Light and a Dark theme.
|
|
7
11
|
///
|
|
8
12
|
/// Usage via context extension:
|
|
9
|
-
/// context.colors.
|
|
10
|
-
/// context.colors.
|
|
11
|
-
/// context.colors.
|
|
12
|
-
/// context.colors.
|
|
13
|
+
/// context.colors.accent → brand / accent color
|
|
14
|
+
/// context.colors.accentSoft → translucent accent fill
|
|
15
|
+
/// context.colors.success / .warning / .danger
|
|
16
|
+
/// context.colors.foreground / .foregroundMuted
|
|
17
|
+
/// context.colors.surface / .surfaceSecondary
|
|
18
|
+
///
|
|
19
|
+
/// Legacy names (primary, onSurface, error, outline, …) remain available as
|
|
20
|
+
/// aliases so existing components keep working.
|
|
13
21
|
class KasyColors extends ThemeExtension<KasyColors> {
|
|
14
|
-
///
|
|
15
|
-
|
|
22
|
+
/// Danger/error base (HeroUI danger, light). Kept for the few call sites that
|
|
23
|
+
/// need a const color outside of a theme context.
|
|
24
|
+
static const Color semanticError = Color(0xFFFF383C);
|
|
16
25
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
/// Best on-color (text/icon) to sit on top of a filled [fill]: near-white on
|
|
27
|
+
/// dark or saturated fills, near-black on light ones. Lets a fill change to
|
|
28
|
+
/// any hue while the text on top stays legible — no manual tuning needed.
|
|
29
|
+
///
|
|
30
|
+
/// Prefers white down to a 3:1 contrast ratio (covers branded mid-tones like
|
|
31
|
+
/// blue, teal, violet, red), then flips to dark — which reproduces HeroUI's
|
|
32
|
+
/// own foreground choices for accent/success/warning/danger.
|
|
33
|
+
static Color onColor(Color fill) {
|
|
34
|
+
final double contrastWithWhite = 1.05 / (fill.computeLuminance() + 0.05);
|
|
35
|
+
return contrastWithWhite >= 3.0
|
|
36
|
+
? const Color(0xFFFCFCFC)
|
|
37
|
+
: const Color(0xFF18181B);
|
|
38
|
+
}
|
|
20
39
|
|
|
21
|
-
// ---
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
// --- Accent (brand / primary identity) ---
|
|
41
|
+
// Only [accent] is stored; foreground, hover and soft variants all derive
|
|
42
|
+
// from it (see getters below), so changing the brand color is a one-value edit.
|
|
43
|
+
final Color accent;
|
|
24
44
|
|
|
25
|
-
// ---
|
|
26
|
-
final Color
|
|
27
|
-
final Color
|
|
45
|
+
// --- Default (neutral backbone) ---
|
|
46
|
+
final Color neutral;
|
|
47
|
+
final Color neutralHover;
|
|
48
|
+
final Color neutralForeground;
|
|
28
49
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
final Color
|
|
50
|
+
// --- Success ---
|
|
51
|
+
final Color success;
|
|
52
|
+
final Color successForeground;
|
|
53
|
+
final Color successHover;
|
|
54
|
+
final Color successSoft;
|
|
55
|
+
final Color successSoftHover;
|
|
56
|
+
final Color successSoftForeground;
|
|
32
57
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
final Color
|
|
58
|
+
// --- Warning ---
|
|
59
|
+
final Color warning;
|
|
60
|
+
final Color warningForeground;
|
|
61
|
+
final Color warningHover;
|
|
62
|
+
final Color warningSoft;
|
|
63
|
+
final Color warningSoftHover;
|
|
64
|
+
final Color warningSoftForeground;
|
|
36
65
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
final Color
|
|
66
|
+
// --- Danger ---
|
|
67
|
+
final Color danger;
|
|
68
|
+
final Color dangerForeground;
|
|
69
|
+
final Color dangerHover;
|
|
70
|
+
final Color dangerSoft;
|
|
71
|
+
final Color dangerSoftHover;
|
|
72
|
+
final Color dangerSoftForeground;
|
|
40
73
|
|
|
41
|
-
|
|
42
|
-
final Color
|
|
74
|
+
// --- Foreground (text / icons) ---
|
|
75
|
+
final Color foreground;
|
|
76
|
+
final Color foregroundMuted;
|
|
77
|
+
final Color foregroundSegment;
|
|
78
|
+
final Color foregroundOverlay;
|
|
79
|
+
final Color foregroundLink;
|
|
80
|
+
final Color foregroundInverse;
|
|
43
81
|
|
|
44
|
-
// ---
|
|
45
|
-
final Color
|
|
46
|
-
final Color
|
|
82
|
+
// --- Background (base canvas) ---
|
|
83
|
+
final Color background;
|
|
84
|
+
final Color backgroundSecondary;
|
|
85
|
+
final Color backgroundTertiary;
|
|
86
|
+
final Color backgroundInverse;
|
|
47
87
|
|
|
48
|
-
// ---
|
|
49
|
-
final Color
|
|
50
|
-
final Color
|
|
88
|
+
// --- Surface (containers: cards, panels, modals) ---
|
|
89
|
+
final Color surface;
|
|
90
|
+
final Color surfaceSecondary;
|
|
91
|
+
final Color surfaceTertiary;
|
|
92
|
+
final Color surfaceTransparent;
|
|
51
93
|
|
|
52
|
-
// ---
|
|
53
|
-
final Color
|
|
54
|
-
final Color
|
|
94
|
+
// --- Form field ---
|
|
95
|
+
final Color fieldBackground;
|
|
96
|
+
final Color fieldBackgroundHover;
|
|
97
|
+
final Color fieldBackgroundFocus;
|
|
98
|
+
final Color fieldPlaceholder;
|
|
99
|
+
final Color fieldForeground;
|
|
100
|
+
final Color fieldBorder;
|
|
101
|
+
final Color fieldBorderHover;
|
|
55
102
|
|
|
56
|
-
// ---
|
|
57
|
-
|
|
58
|
-
final Color
|
|
59
|
-
|
|
60
|
-
final Color outlineButton;
|
|
61
|
-
/// Secondary text / disabled state.
|
|
62
|
-
final Color muted;
|
|
103
|
+
// --- Separator (dividers, outlines) ---
|
|
104
|
+
final Color separator;
|
|
105
|
+
final Color separatorSecondary;
|
|
106
|
+
final Color separatorTertiary;
|
|
63
107
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Color
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// --- Greys (legacy — prefer muted/outline for new code) ---
|
|
72
|
-
final Color grey1;
|
|
73
|
-
final Color grey2;
|
|
74
|
-
final Color grey3;
|
|
108
|
+
// --- Other (border, overlay, segment, backdrop) ---
|
|
109
|
+
final Color border;
|
|
110
|
+
final Color overlay;
|
|
111
|
+
final Color segment;
|
|
112
|
+
final Color backdrop;
|
|
75
113
|
|
|
76
|
-
// --- Premium (paywall visual identity) ---
|
|
77
|
-
final Color premiumOverlayMid;
|
|
78
|
-
final Color premiumOverlayDark;
|
|
79
|
-
final Color premiumBannerText;
|
|
114
|
+
// --- Premium (paywall visual identity — app-specific, not a HeroUI role) ---
|
|
115
|
+
final Color premiumOverlayMid;
|
|
116
|
+
final Color premiumOverlayDark;
|
|
117
|
+
final Color premiumBannerText;
|
|
80
118
|
|
|
81
119
|
const KasyColors({
|
|
82
|
-
required this.
|
|
83
|
-
required this.
|
|
84
|
-
required this.
|
|
85
|
-
required this.
|
|
86
|
-
required this.surface,
|
|
87
|
-
required this.onSurface,
|
|
88
|
-
required this.surfacePrimarySoft,
|
|
89
|
-
required this.surfaceNeutralSoft,
|
|
90
|
-
required this.surfaceErrorSoft,
|
|
91
|
-
required this.avatarFallbackFill,
|
|
92
|
-
required this.error,
|
|
93
|
-
required this.onError,
|
|
120
|
+
required this.accent,
|
|
121
|
+
required this.neutral,
|
|
122
|
+
required this.neutralHover,
|
|
123
|
+
required this.neutralForeground,
|
|
94
124
|
required this.success,
|
|
95
|
-
required this.
|
|
125
|
+
required this.successForeground,
|
|
126
|
+
required this.successHover,
|
|
127
|
+
required this.successSoft,
|
|
128
|
+
required this.successSoftHover,
|
|
129
|
+
required this.successSoftForeground,
|
|
96
130
|
required this.warning,
|
|
97
|
-
required this.
|
|
98
|
-
required this.
|
|
99
|
-
required this.
|
|
100
|
-
required this.
|
|
101
|
-
required this.
|
|
102
|
-
required this.
|
|
103
|
-
required this.
|
|
131
|
+
required this.warningForeground,
|
|
132
|
+
required this.warningHover,
|
|
133
|
+
required this.warningSoft,
|
|
134
|
+
required this.warningSoftHover,
|
|
135
|
+
required this.warningSoftForeground,
|
|
136
|
+
required this.danger,
|
|
137
|
+
required this.dangerForeground,
|
|
138
|
+
required this.dangerHover,
|
|
139
|
+
required this.dangerSoft,
|
|
140
|
+
required this.dangerSoftHover,
|
|
141
|
+
required this.dangerSoftForeground,
|
|
142
|
+
required this.foreground,
|
|
143
|
+
required this.foregroundMuted,
|
|
144
|
+
required this.foregroundSegment,
|
|
145
|
+
required this.foregroundOverlay,
|
|
146
|
+
required this.foregroundLink,
|
|
147
|
+
required this.foregroundInverse,
|
|
148
|
+
required this.background,
|
|
149
|
+
required this.backgroundSecondary,
|
|
150
|
+
required this.backgroundTertiary,
|
|
151
|
+
required this.backgroundInverse,
|
|
152
|
+
required this.surface,
|
|
153
|
+
required this.surfaceSecondary,
|
|
154
|
+
required this.surfaceTertiary,
|
|
155
|
+
required this.surfaceTransparent,
|
|
156
|
+
required this.fieldBackground,
|
|
157
|
+
required this.fieldBackgroundHover,
|
|
158
|
+
required this.fieldBackgroundFocus,
|
|
159
|
+
required this.fieldPlaceholder,
|
|
160
|
+
required this.fieldForeground,
|
|
161
|
+
required this.fieldBorder,
|
|
162
|
+
required this.fieldBorderHover,
|
|
163
|
+
required this.separator,
|
|
164
|
+
required this.separatorSecondary,
|
|
165
|
+
required this.separatorTertiary,
|
|
166
|
+
required this.border,
|
|
167
|
+
required this.overlay,
|
|
168
|
+
required this.segment,
|
|
169
|
+
required this.backdrop,
|
|
104
170
|
required this.premiumOverlayMid,
|
|
105
171
|
required this.premiumOverlayDark,
|
|
106
172
|
required this.premiumBannerText,
|
|
107
173
|
});
|
|
108
174
|
|
|
109
175
|
factory KasyColors.light() => const KasyColors(
|
|
110
|
-
|
|
111
|
-
|
|
176
|
+
// Accent — HeroUI blue.
|
|
177
|
+
accent: Color(0xFF0485F7),
|
|
178
|
+
// Default (neutrals).
|
|
179
|
+
neutral: Color(0xFFEBEBEC),
|
|
180
|
+
neutralHover: Color(0xFFE1E1E2),
|
|
181
|
+
neutralForeground: Color(0xFF18181B),
|
|
182
|
+
// Success.
|
|
183
|
+
success: Color(0xFF17C964),
|
|
184
|
+
successForeground: Color(0xFF18181B),
|
|
185
|
+
successHover: Color(0xFF21B55D),
|
|
186
|
+
successSoft: Color(0x2617C964),
|
|
187
|
+
successSoftHover: Color(0x3317C964),
|
|
188
|
+
successSoftForeground: Color(0xFF17C964),
|
|
189
|
+
// Warning.
|
|
190
|
+
warning: Color(0xFFF5A524),
|
|
191
|
+
warningForeground: Color(0xFF18181B),
|
|
192
|
+
warningHover: Color(0xFFDC952A),
|
|
193
|
+
warningSoft: Color(0x26F5A524),
|
|
194
|
+
warningSoftHover: Color(0x33DC952A),
|
|
195
|
+
warningSoftForeground: Color(0xFFF5A524),
|
|
196
|
+
// Danger.
|
|
197
|
+
danger: Color(0xFFFF383C),
|
|
198
|
+
dangerForeground: Color(0xFFFCFCFC),
|
|
199
|
+
dangerHover: Color(0xFFFF5551),
|
|
200
|
+
dangerSoft: Color(0x26FF383C),
|
|
201
|
+
dangerSoftHover: Color(0x33FF5551),
|
|
202
|
+
dangerSoftForeground: Color(0xFFFF383C),
|
|
203
|
+
// Foreground.
|
|
204
|
+
foreground: Color(0xFF18181B),
|
|
205
|
+
foregroundMuted: Color(0xFF71717A),
|
|
206
|
+
foregroundSegment: Color(0xFF18181B),
|
|
207
|
+
foregroundOverlay: Color(0xFF18181B),
|
|
208
|
+
foregroundLink: Color(0xFF18181B),
|
|
209
|
+
foregroundInverse: Color(0xFFFCFCFC),
|
|
210
|
+
// Background.
|
|
112
211
|
// Also used by the native splash. When changing, update
|
|
113
212
|
// `flutter_native_splash.color` in pubspec.yaml and run
|
|
114
213
|
// `dart run flutter_native_splash:create`.
|
|
115
|
-
background: Color(
|
|
116
|
-
|
|
214
|
+
background: Color(0xFFF5F5F5),
|
|
215
|
+
backgroundSecondary: Color(0xFFEBEBEB),
|
|
216
|
+
backgroundTertiary: Color(0xFFE1E1E1),
|
|
217
|
+
backgroundInverse: Color(0xFF18181B),
|
|
218
|
+
// Surface.
|
|
117
219
|
surface: Color(0xFFFFFFFF),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
220
|
+
surfaceSecondary: Color(0xFFEFEFF0),
|
|
221
|
+
surfaceTertiary: Color(0xFFEAEAEB),
|
|
222
|
+
surfaceTransparent: Color(0x00FFFFFF),
|
|
223
|
+
// Form field.
|
|
224
|
+
fieldBackground: Color(0xFFFFFFFF),
|
|
225
|
+
fieldBackgroundHover: Color(0xEBF9F9F9),
|
|
226
|
+
fieldBackgroundFocus: Color(0xFFFFFFFF),
|
|
227
|
+
fieldPlaceholder: Color(0xFF71717A),
|
|
228
|
+
fieldForeground: Color(0xFF18181B),
|
|
229
|
+
fieldBorder: Color(0x00DEDEE0),
|
|
230
|
+
fieldBorderHover: Color(0x00C1C1C1),
|
|
231
|
+
// Separator.
|
|
232
|
+
separator: Color(0xFFE4E4E7),
|
|
233
|
+
separatorSecondary: Color(0xFFD7D7D7),
|
|
234
|
+
separatorTertiary: Color(0xFFCDCDCE),
|
|
235
|
+
// Other.
|
|
236
|
+
border: Color(0xFFDEDEE0),
|
|
237
|
+
overlay: Color(0xFFFFFFFF),
|
|
238
|
+
segment: Color(0xFFFFFFFF),
|
|
239
|
+
backdrop: Color(0x80000000),
|
|
240
|
+
// Premium (paywall).
|
|
135
241
|
premiumOverlayMid: Color(0xFF9997A1),
|
|
136
242
|
premiumOverlayDark: Color(0xFF130F26),
|
|
137
243
|
premiumBannerText: Color(0xFF49250A),
|
|
138
244
|
);
|
|
139
245
|
|
|
140
246
|
factory KasyColors.dark() => const KasyColors(
|
|
141
|
-
|
|
142
|
-
|
|
247
|
+
// Accent — HeroUI blue (same hue, pops on the dark canvas).
|
|
248
|
+
accent: Color(0xFF0485F7),
|
|
249
|
+
// Default (neutrals).
|
|
250
|
+
neutral: Color(0xFF27272A),
|
|
251
|
+
neutralHover: Color(0xFF2E2E31),
|
|
252
|
+
neutralForeground: Color(0xFFFCFCFC),
|
|
253
|
+
// Success.
|
|
254
|
+
success: Color(0xFF17C964),
|
|
255
|
+
successForeground: Color(0xFF18181B),
|
|
256
|
+
successHover: Color(0xFF21B55D),
|
|
257
|
+
successSoft: Color(0x2617C964),
|
|
258
|
+
successSoftHover: Color(0x3317C964),
|
|
259
|
+
successSoftForeground: Color(0xFF17C964),
|
|
260
|
+
// Warning (brightened for dark).
|
|
261
|
+
warning: Color(0xFFF7B750),
|
|
262
|
+
warningForeground: Color(0xFF18181B),
|
|
263
|
+
warningHover: Color(0xFFDEA54C),
|
|
264
|
+
warningSoft: Color(0x26F7B750),
|
|
265
|
+
warningSoftHover: Color(0x33DEA54C),
|
|
266
|
+
warningSoftForeground: Color(0xFFF7B750),
|
|
267
|
+
// Danger (desaturated for dark).
|
|
268
|
+
danger: Color(0xFFDB3B3E),
|
|
269
|
+
dangerForeground: Color(0xFFFCFCFC),
|
|
270
|
+
dangerHover: Color(0xFFE15451),
|
|
271
|
+
dangerSoft: Color(0x26DB3B3E),
|
|
272
|
+
dangerSoftHover: Color(0x33E15451),
|
|
273
|
+
dangerSoftForeground: Color(0xFFDB3B3E),
|
|
274
|
+
// Foreground.
|
|
275
|
+
foreground: Color(0xFFFCFCFC),
|
|
276
|
+
foregroundMuted: Color(0xFFA1A1AA),
|
|
277
|
+
foregroundSegment: Color(0xFFFCFCFC),
|
|
278
|
+
foregroundOverlay: Color(0xFFFCFCFC),
|
|
279
|
+
foregroundLink: Color(0xFFFCFCFC),
|
|
280
|
+
foregroundInverse: Color(0xFF18181B),
|
|
281
|
+
// Background.
|
|
143
282
|
// Also used by the native splash. When changing, update
|
|
144
283
|
// `flutter_native_splash.color_dark` in pubspec.yaml and run
|
|
145
284
|
// `dart run flutter_native_splash:create`.
|
|
146
|
-
background: Color(
|
|
147
|
-
|
|
285
|
+
background: Color(0xFF060607),
|
|
286
|
+
backgroundSecondary: Color(0xFF0C0C0E),
|
|
287
|
+
backgroundTertiary: Color(0xFF131316),
|
|
288
|
+
backgroundInverse: Color(0xFFFCFCFC),
|
|
289
|
+
// Surface.
|
|
148
290
|
surface: Color(0xFF18181B),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
291
|
+
surfaceSecondary: Color(0xFF232325),
|
|
292
|
+
surfaceTertiary: Color(0xFF262728),
|
|
293
|
+
surfaceTransparent: Color(0x00000000),
|
|
294
|
+
// Form field.
|
|
295
|
+
fieldBackground: Color(0xFF18181B),
|
|
296
|
+
fieldBackgroundHover: Color(0xEB1C1C1F),
|
|
297
|
+
fieldBackgroundFocus: Color(0xFF18181B),
|
|
298
|
+
fieldPlaceholder: Color(0xFFA1A1AA),
|
|
299
|
+
fieldForeground: Color(0xFFFCFCFC),
|
|
300
|
+
fieldBorder: Color(0x0028282C),
|
|
301
|
+
fieldBorderHover: Color(0x00464646),
|
|
302
|
+
// Separator.
|
|
303
|
+
separator: Color(0xFF1A1A1D),
|
|
304
|
+
separatorSecondary: Color(0xFF353538),
|
|
305
|
+
separatorTertiary: Color(0xFF3C3C3F),
|
|
306
|
+
// Other.
|
|
307
|
+
border: Color(0xFF28282C),
|
|
308
|
+
overlay: Color(0xFF18181B),
|
|
309
|
+
segment: Color(0xFF46464C),
|
|
310
|
+
backdrop: Color(0x80000000),
|
|
311
|
+
// Premium (paywall).
|
|
166
312
|
premiumOverlayMid: Color(0xFF9997A1),
|
|
167
313
|
premiumOverlayDark: Color(0xFF130F26),
|
|
168
314
|
premiumBannerText: Color(0xFF49250A),
|
|
169
315
|
);
|
|
170
316
|
|
|
317
|
+
// -------------------------------------------------------------------------
|
|
318
|
+
// Legacy aliases — keep existing components compiling. Prefer the HeroUI
|
|
319
|
+
// names above for new code.
|
|
320
|
+
// -------------------------------------------------------------------------
|
|
321
|
+
|
|
322
|
+
/// Text/icon color on top of [accent] — auto-derived from the accent's
|
|
323
|
+
/// luminance (white on dark/saturated accents, near-black on light ones),
|
|
324
|
+
/// so changing the accent hue alone always stays legible in both modes.
|
|
325
|
+
Color get accentForeground => onColor(accent);
|
|
326
|
+
|
|
327
|
+
/// Hover state for [accent] — a subtle lift toward white.
|
|
328
|
+
Color get accentHover => Color.lerp(accent, const Color(0xFFFFFFFF), 0.14)!;
|
|
329
|
+
|
|
330
|
+
/// Translucent accent fill (15%) for soft / secondary surfaces.
|
|
331
|
+
Color get accentSoft => accent.withValues(alpha: 0.15);
|
|
332
|
+
|
|
333
|
+
/// Hover state for [accentSoft] (20%).
|
|
334
|
+
Color get accentSoftHover => accent.withValues(alpha: 0.20);
|
|
335
|
+
|
|
336
|
+
/// Text / icon color on a soft accent fill — the accent itself.
|
|
337
|
+
Color get accentSoftForeground => accent;
|
|
338
|
+
|
|
339
|
+
Color get primary => accent;
|
|
340
|
+
Color get onPrimary => accentForeground;
|
|
341
|
+
Color get onBackground => foreground;
|
|
342
|
+
Color get onSurface => foreground;
|
|
343
|
+
Color get surfacePrimarySoft => accentSoft;
|
|
344
|
+
Color get surfaceNeutralSoft => neutral;
|
|
345
|
+
Color get surfaceErrorSoft => dangerSoft;
|
|
346
|
+
Color get avatarFallbackFill => surfaceSecondary;
|
|
347
|
+
Color get error => danger;
|
|
348
|
+
Color get onError => dangerForeground;
|
|
349
|
+
Color get onSuccess => successForeground;
|
|
350
|
+
Color get onWarning => warningForeground;
|
|
351
|
+
Color get outline => border;
|
|
352
|
+
Color get outlineButton => border;
|
|
353
|
+
Color get muted => foregroundMuted;
|
|
354
|
+
Color get grey1 => separatorSecondary;
|
|
355
|
+
Color get grey2 => foregroundMuted;
|
|
356
|
+
Color get grey3 => foreground;
|
|
357
|
+
|
|
358
|
+
/// Form field labels: slightly stronger than [foregroundMuted].
|
|
359
|
+
Color get fieldLabel {
|
|
360
|
+
final bool isDark = background.computeLuminance() < 0.5;
|
|
361
|
+
return Color.lerp(foregroundMuted, foreground, isDark ? 0.36 : 0.28)!;
|
|
362
|
+
}
|
|
363
|
+
|
|
171
364
|
@override
|
|
172
365
|
ThemeExtension<KasyColors> copyWith({
|
|
173
|
-
Color?
|
|
174
|
-
Color?
|
|
175
|
-
Color?
|
|
176
|
-
Color?
|
|
177
|
-
Color? surface,
|
|
178
|
-
Color? onSurface,
|
|
179
|
-
Color? surfacePrimarySoft,
|
|
180
|
-
Color? surfaceNeutralSoft,
|
|
181
|
-
Color? surfaceErrorSoft,
|
|
182
|
-
Color? avatarFallbackFill,
|
|
183
|
-
Color? error,
|
|
184
|
-
Color? onError,
|
|
366
|
+
Color? accent,
|
|
367
|
+
Color? neutral,
|
|
368
|
+
Color? neutralHover,
|
|
369
|
+
Color? neutralForeground,
|
|
185
370
|
Color? success,
|
|
186
|
-
Color?
|
|
371
|
+
Color? successForeground,
|
|
372
|
+
Color? successHover,
|
|
373
|
+
Color? successSoft,
|
|
374
|
+
Color? successSoftHover,
|
|
375
|
+
Color? successSoftForeground,
|
|
187
376
|
Color? warning,
|
|
188
|
-
Color?
|
|
189
|
-
Color?
|
|
190
|
-
Color?
|
|
191
|
-
Color?
|
|
192
|
-
Color?
|
|
193
|
-
Color?
|
|
194
|
-
Color?
|
|
377
|
+
Color? warningForeground,
|
|
378
|
+
Color? warningHover,
|
|
379
|
+
Color? warningSoft,
|
|
380
|
+
Color? warningSoftHover,
|
|
381
|
+
Color? warningSoftForeground,
|
|
382
|
+
Color? danger,
|
|
383
|
+
Color? dangerForeground,
|
|
384
|
+
Color? dangerHover,
|
|
385
|
+
Color? dangerSoft,
|
|
386
|
+
Color? dangerSoftHover,
|
|
387
|
+
Color? dangerSoftForeground,
|
|
388
|
+
Color? foreground,
|
|
389
|
+
Color? foregroundMuted,
|
|
390
|
+
Color? foregroundSegment,
|
|
391
|
+
Color? foregroundOverlay,
|
|
392
|
+
Color? foregroundLink,
|
|
393
|
+
Color? foregroundInverse,
|
|
394
|
+
Color? background,
|
|
395
|
+
Color? backgroundSecondary,
|
|
396
|
+
Color? backgroundTertiary,
|
|
397
|
+
Color? backgroundInverse,
|
|
398
|
+
Color? surface,
|
|
399
|
+
Color? surfaceSecondary,
|
|
400
|
+
Color? surfaceTertiary,
|
|
401
|
+
Color? surfaceTransparent,
|
|
402
|
+
Color? fieldBackground,
|
|
403
|
+
Color? fieldBackgroundHover,
|
|
404
|
+
Color? fieldBackgroundFocus,
|
|
405
|
+
Color? fieldPlaceholder,
|
|
406
|
+
Color? fieldForeground,
|
|
407
|
+
Color? fieldBorder,
|
|
408
|
+
Color? fieldBorderHover,
|
|
409
|
+
Color? separator,
|
|
410
|
+
Color? separatorSecondary,
|
|
411
|
+
Color? separatorTertiary,
|
|
412
|
+
Color? border,
|
|
413
|
+
Color? overlay,
|
|
414
|
+
Color? segment,
|
|
415
|
+
Color? backdrop,
|
|
195
416
|
Color? premiumOverlayMid,
|
|
196
417
|
Color? premiumOverlayDark,
|
|
197
418
|
Color? premiumBannerText,
|
|
198
419
|
}) {
|
|
199
420
|
return KasyColors(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
surface: surface ?? this.surface,
|
|
205
|
-
onSurface: onSurface ?? this.onSurface,
|
|
206
|
-
surfacePrimarySoft: surfacePrimarySoft ?? this.surfacePrimarySoft,
|
|
207
|
-
surfaceNeutralSoft: surfaceNeutralSoft ?? this.surfaceNeutralSoft,
|
|
208
|
-
surfaceErrorSoft: surfaceErrorSoft ?? this.surfaceErrorSoft,
|
|
209
|
-
avatarFallbackFill: avatarFallbackFill ?? this.avatarFallbackFill,
|
|
210
|
-
error: error ?? this.error,
|
|
211
|
-
onError: onError ?? this.onError,
|
|
421
|
+
accent: accent ?? this.accent,
|
|
422
|
+
neutral: neutral ?? this.neutral,
|
|
423
|
+
neutralHover: neutralHover ?? this.neutralHover,
|
|
424
|
+
neutralForeground: neutralForeground ?? this.neutralForeground,
|
|
212
425
|
success: success ?? this.success,
|
|
213
|
-
|
|
426
|
+
successForeground: successForeground ?? this.successForeground,
|
|
427
|
+
successHover: successHover ?? this.successHover,
|
|
428
|
+
successSoft: successSoft ?? this.successSoft,
|
|
429
|
+
successSoftHover: successSoftHover ?? this.successSoftHover,
|
|
430
|
+
successSoftForeground:
|
|
431
|
+
successSoftForeground ?? this.successSoftForeground,
|
|
214
432
|
warning: warning ?? this.warning,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
433
|
+
warningForeground: warningForeground ?? this.warningForeground,
|
|
434
|
+
warningHover: warningHover ?? this.warningHover,
|
|
435
|
+
warningSoft: warningSoft ?? this.warningSoft,
|
|
436
|
+
warningSoftHover: warningSoftHover ?? this.warningSoftHover,
|
|
437
|
+
warningSoftForeground:
|
|
438
|
+
warningSoftForeground ?? this.warningSoftForeground,
|
|
439
|
+
danger: danger ?? this.danger,
|
|
440
|
+
dangerForeground: dangerForeground ?? this.dangerForeground,
|
|
441
|
+
dangerHover: dangerHover ?? this.dangerHover,
|
|
442
|
+
dangerSoft: dangerSoft ?? this.dangerSoft,
|
|
443
|
+
dangerSoftHover: dangerSoftHover ?? this.dangerSoftHover,
|
|
444
|
+
dangerSoftForeground: dangerSoftForeground ?? this.dangerSoftForeground,
|
|
445
|
+
foreground: foreground ?? this.foreground,
|
|
446
|
+
foregroundMuted: foregroundMuted ?? this.foregroundMuted,
|
|
447
|
+
foregroundSegment: foregroundSegment ?? this.foregroundSegment,
|
|
448
|
+
foregroundOverlay: foregroundOverlay ?? this.foregroundOverlay,
|
|
449
|
+
foregroundLink: foregroundLink ?? this.foregroundLink,
|
|
450
|
+
foregroundInverse: foregroundInverse ?? this.foregroundInverse,
|
|
451
|
+
background: background ?? this.background,
|
|
452
|
+
backgroundSecondary: backgroundSecondary ?? this.backgroundSecondary,
|
|
453
|
+
backgroundTertiary: backgroundTertiary ?? this.backgroundTertiary,
|
|
454
|
+
backgroundInverse: backgroundInverse ?? this.backgroundInverse,
|
|
455
|
+
surface: surface ?? this.surface,
|
|
456
|
+
surfaceSecondary: surfaceSecondary ?? this.surfaceSecondary,
|
|
457
|
+
surfaceTertiary: surfaceTertiary ?? this.surfaceTertiary,
|
|
458
|
+
surfaceTransparent: surfaceTransparent ?? this.surfaceTransparent,
|
|
459
|
+
fieldBackground: fieldBackground ?? this.fieldBackground,
|
|
460
|
+
fieldBackgroundHover: fieldBackgroundHover ?? this.fieldBackgroundHover,
|
|
461
|
+
fieldBackgroundFocus: fieldBackgroundFocus ?? this.fieldBackgroundFocus,
|
|
462
|
+
fieldPlaceholder: fieldPlaceholder ?? this.fieldPlaceholder,
|
|
463
|
+
fieldForeground: fieldForeground ?? this.fieldForeground,
|
|
464
|
+
fieldBorder: fieldBorder ?? this.fieldBorder,
|
|
465
|
+
fieldBorderHover: fieldBorderHover ?? this.fieldBorderHover,
|
|
466
|
+
separator: separator ?? this.separator,
|
|
467
|
+
separatorSecondary: separatorSecondary ?? this.separatorSecondary,
|
|
468
|
+
separatorTertiary: separatorTertiary ?? this.separatorTertiary,
|
|
469
|
+
border: border ?? this.border,
|
|
470
|
+
overlay: overlay ?? this.overlay,
|
|
471
|
+
segment: segment ?? this.segment,
|
|
472
|
+
backdrop: backdrop ?? this.backdrop,
|
|
222
473
|
premiumOverlayMid: premiumOverlayMid ?? this.premiumOverlayMid,
|
|
223
474
|
premiumOverlayDark: premiumOverlayDark ?? this.premiumOverlayDark,
|
|
224
475
|
premiumBannerText: premiumBannerText ?? this.premiumBannerText,
|
|
@@ -233,34 +484,83 @@ class KasyColors extends ThemeExtension<KasyColors> {
|
|
|
233
484
|
if (other == null || other is! KasyColors) return this;
|
|
234
485
|
|
|
235
486
|
return KasyColors(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
onSurface: Color.lerp(onSurface, other.onSurface, t)!,
|
|
242
|
-
surfacePrimarySoft:
|
|
243
|
-
Color.lerp(surfacePrimarySoft, other.surfacePrimarySoft, t)!,
|
|
244
|
-
surfaceNeutralSoft:
|
|
245
|
-
Color.lerp(surfaceNeutralSoft, other.surfaceNeutralSoft, t)!,
|
|
246
|
-
surfaceErrorSoft: Color.lerp(surfaceErrorSoft, other.surfaceErrorSoft, t)!,
|
|
247
|
-
avatarFallbackFill:
|
|
248
|
-
Color.lerp(avatarFallbackFill, other.avatarFallbackFill, t)!,
|
|
249
|
-
error: Color.lerp(error, other.error, t)!,
|
|
250
|
-
onError: Color.lerp(onError, other.onError, t)!,
|
|
487
|
+
accent: Color.lerp(accent, other.accent, t)!,
|
|
488
|
+
neutral: Color.lerp(neutral, other.neutral, t)!,
|
|
489
|
+
neutralHover: Color.lerp(neutralHover, other.neutralHover, t)!,
|
|
490
|
+
neutralForeground:
|
|
491
|
+
Color.lerp(neutralForeground, other.neutralForeground, t)!,
|
|
251
492
|
success: Color.lerp(success, other.success, t)!,
|
|
252
|
-
|
|
493
|
+
successForeground:
|
|
494
|
+
Color.lerp(successForeground, other.successForeground, t)!,
|
|
495
|
+
successHover: Color.lerp(successHover, other.successHover, t)!,
|
|
496
|
+
successSoft: Color.lerp(successSoft, other.successSoft, t)!,
|
|
497
|
+
successSoftHover: Color.lerp(successSoftHover, other.successSoftHover, t)!,
|
|
498
|
+
successSoftForeground:
|
|
499
|
+
Color.lerp(successSoftForeground, other.successSoftForeground, t)!,
|
|
253
500
|
warning: Color.lerp(warning, other.warning, t)!,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
501
|
+
warningForeground:
|
|
502
|
+
Color.lerp(warningForeground, other.warningForeground, t)!,
|
|
503
|
+
warningHover: Color.lerp(warningHover, other.warningHover, t)!,
|
|
504
|
+
warningSoft: Color.lerp(warningSoft, other.warningSoft, t)!,
|
|
505
|
+
warningSoftHover: Color.lerp(warningSoftHover, other.warningSoftHover, t)!,
|
|
506
|
+
warningSoftForeground:
|
|
507
|
+
Color.lerp(warningSoftForeground, other.warningSoftForeground, t)!,
|
|
508
|
+
danger: Color.lerp(danger, other.danger, t)!,
|
|
509
|
+
dangerForeground:
|
|
510
|
+
Color.lerp(dangerForeground, other.dangerForeground, t)!,
|
|
511
|
+
dangerHover: Color.lerp(dangerHover, other.dangerHover, t)!,
|
|
512
|
+
dangerSoft: Color.lerp(dangerSoft, other.dangerSoft, t)!,
|
|
513
|
+
dangerSoftHover: Color.lerp(dangerSoftHover, other.dangerSoftHover, t)!,
|
|
514
|
+
dangerSoftForeground:
|
|
515
|
+
Color.lerp(dangerSoftForeground, other.dangerSoftForeground, t)!,
|
|
516
|
+
foreground: Color.lerp(foreground, other.foreground, t)!,
|
|
517
|
+
foregroundMuted: Color.lerp(foregroundMuted, other.foregroundMuted, t)!,
|
|
518
|
+
foregroundSegment:
|
|
519
|
+
Color.lerp(foregroundSegment, other.foregroundSegment, t)!,
|
|
520
|
+
foregroundOverlay:
|
|
521
|
+
Color.lerp(foregroundOverlay, other.foregroundOverlay, t)!,
|
|
522
|
+
foregroundLink: Color.lerp(foregroundLink, other.foregroundLink, t)!,
|
|
523
|
+
foregroundInverse:
|
|
524
|
+
Color.lerp(foregroundInverse, other.foregroundInverse, t)!,
|
|
525
|
+
background: Color.lerp(background, other.background, t)!,
|
|
526
|
+
backgroundSecondary:
|
|
527
|
+
Color.lerp(backgroundSecondary, other.backgroundSecondary, t)!,
|
|
528
|
+
backgroundTertiary:
|
|
529
|
+
Color.lerp(backgroundTertiary, other.backgroundTertiary, t)!,
|
|
530
|
+
backgroundInverse:
|
|
531
|
+
Color.lerp(backgroundInverse, other.backgroundInverse, t)!,
|
|
532
|
+
surface: Color.lerp(surface, other.surface, t)!,
|
|
533
|
+
surfaceSecondary:
|
|
534
|
+
Color.lerp(surfaceSecondary, other.surfaceSecondary, t)!,
|
|
535
|
+
surfaceTertiary: Color.lerp(surfaceTertiary, other.surfaceTertiary, t)!,
|
|
536
|
+
surfaceTransparent:
|
|
537
|
+
Color.lerp(surfaceTransparent, other.surfaceTransparent, t)!,
|
|
538
|
+
fieldBackground: Color.lerp(fieldBackground, other.fieldBackground, t)!,
|
|
539
|
+
fieldBackgroundHover:
|
|
540
|
+
Color.lerp(fieldBackgroundHover, other.fieldBackgroundHover, t)!,
|
|
541
|
+
fieldBackgroundFocus:
|
|
542
|
+
Color.lerp(fieldBackgroundFocus, other.fieldBackgroundFocus, t)!,
|
|
543
|
+
fieldPlaceholder:
|
|
544
|
+
Color.lerp(fieldPlaceholder, other.fieldPlaceholder, t)!,
|
|
545
|
+
fieldForeground: Color.lerp(fieldForeground, other.fieldForeground, t)!,
|
|
546
|
+
fieldBorder: Color.lerp(fieldBorder, other.fieldBorder, t)!,
|
|
547
|
+
fieldBorderHover:
|
|
548
|
+
Color.lerp(fieldBorderHover, other.fieldBorderHover, t)!,
|
|
549
|
+
separator: Color.lerp(separator, other.separator, t)!,
|
|
550
|
+
separatorSecondary:
|
|
551
|
+
Color.lerp(separatorSecondary, other.separatorSecondary, t)!,
|
|
552
|
+
separatorTertiary:
|
|
553
|
+
Color.lerp(separatorTertiary, other.separatorTertiary, t)!,
|
|
554
|
+
border: Color.lerp(border, other.border, t)!,
|
|
555
|
+
overlay: Color.lerp(overlay, other.overlay, t)!,
|
|
556
|
+
segment: Color.lerp(segment, other.segment, t)!,
|
|
557
|
+
backdrop: Color.lerp(backdrop, other.backdrop, t)!,
|
|
558
|
+
premiumOverlayMid:
|
|
559
|
+
Color.lerp(premiumOverlayMid, other.premiumOverlayMid, t)!,
|
|
560
|
+
premiumOverlayDark:
|
|
561
|
+
Color.lerp(premiumOverlayDark, other.premiumOverlayDark, t)!,
|
|
562
|
+
premiumBannerText:
|
|
563
|
+
Color.lerp(premiumBannerText, other.premiumBannerText, t)!,
|
|
264
564
|
);
|
|
265
565
|
}
|
|
266
566
|
}
|