diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml index 1145ccfd..79a2a6c8 100644 --- a/dartdoc_options.yaml +++ b/dartdoc_options.yaml @@ -12,5 +12,7 @@ dartdoc: "Utils": markdown: doc/Utils.md name: Utils + "Interfaces": + name: Interfaces categoryOrder: ["Components", "Assets", "Theme", "Utils", "Interfaces"] showUndocumentedCategories: true diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index f6f23bfe..e71a16d2 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -6,10 +6,6 @@ #include "generated_plugin_registrant.h" -#include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index f16b4c34..2e1de87a 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index 8c72a8c7..d0e7d180 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,11 +8,9 @@ import Foundation import path_provider_foundation import shared_preferences_foundation import sqflite_darwin -import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) - UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 7a50d00b..126ee03d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -11,22 +11,11 @@ dependencies: cached_network_image: ^3.3.1 flutter: sdk: flutter - flutter_svg: ^2.0.10+1 go_router: ^14.1.2 - google_fonts: ^6.2.1 - markdown_widget: ^2.3.2+6 path_drawing: ^1.0.1 - shared_preferences: ^2.2.2 - url_launcher: ^6.2.6 zeta_flutter: path: ../ -dev_dependencies: - flutter_test: - sdk: flutter - widgetbook: ^3.10.0 - - http: any flutter: uses-material-design: true assets: diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 4f788487..8b6d4680 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,6 @@ #include "generated_plugin_registrant.h" -#include void RegisterPlugins(flutter::PluginRegistry* registry) { - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 88b22e5c..b93c4c30 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/lib/src/components/avatar_rail/avatar_rail.dart b/lib/src/components/avatar_rail/avatar_rail.dart index a9066c93..bc0bf753 100644 --- a/lib/src/components/avatar_rail/avatar_rail.dart +++ b/lib/src/components/avatar_rail/avatar_rail.dart @@ -1,8 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import '../../utils/utils.dart'; -import '../avatars/avatar.dart'; +import '../../../zeta_flutter.dart'; /// A stateless widget that represents an avatar rail in the Zeta application. /// diff --git a/lib/src/components/avatars/avatar.dart b/lib/src/components/avatars/avatar.dart index fc6d62a1..1fea585b 100644 --- a/lib/src/components/avatars/avatar.dart +++ b/lib/src/components/avatars/avatar.dart @@ -66,6 +66,7 @@ enum ZetaAvatarSize { /// An avatar is a visual representation of a user or entity. /// /// It is recommended to use [ZetaAvatar] with [ZetaAvatarBadge] for status and notification badges, but any widget can be used. +/// /// {@category Components} /// /// Figma: https://www.figma.com/file/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?type=design&node-id=20816-388 @@ -436,6 +437,8 @@ enum ZetaAvatarBadgeType { /// Badge component used with [ZetaAvatar] as either [ZetaAvatar.upperBadge] or [ZetaAvatar.lowerBadge]. /// +/// {@category Components} +/// /// Sizes and styles are managed by the parent [ZetaAvatar]. class ZetaAvatarBadge extends StatelessWidget { /// Constructor for [ZetaAvatarBadge] diff --git a/lib/src/components/bottom sheets/bottom_sheet.dart b/lib/src/components/bottom sheets/bottom_sheet.dart index e8850e43..d6ad8512 100644 --- a/lib/src/components/bottom sheets/bottom_sheet.dart +++ b/lib/src/components/bottom sheets/bottom_sheet.dart @@ -108,6 +108,8 @@ class ZetaBottomSheet extends ZetaStatelessWidget { /// Function to show [ZetaBottomSheet]. /// /// Uses [showModalBottomSheet] for functionality, but with Zeta styling and simplified functionality. +/// +/// {@category Components} Future showZetaBottomSheet({ required BuildContext context, String? title, diff --git a/lib/src/components/breadcrumb/breadcrumb.dart b/lib/src/components/breadcrumb/breadcrumb.dart index d4dfb78e..8ce54b32 100644 --- a/lib/src/components/breadcrumb/breadcrumb.dart +++ b/lib/src/components/breadcrumb/breadcrumb.dart @@ -138,6 +138,8 @@ class _ZetaBreadcrumbsState extends State { /// Class for untruncated [ZetaBreadcrumbItem]. /// /// Should be a child of [ZetaBreadcrumb]. +/// +/// {@category Components} class ZetaBreadcrumbItem extends ZetaStatelessWidget { ///Constructor for [ZetaBreadcrumbItem] ZetaBreadcrumbItem({ diff --git a/lib/src/components/button_group/button_group.dart b/lib/src/components/button_group/button_group.dart index df921f15..595fc11b 100644 --- a/lib/src/components/button_group/button_group.dart +++ b/lib/src/components/button_group/button_group.dart @@ -70,7 +70,9 @@ class ZetaButtonGroup extends ZetaStatelessWidget { // TODO(UX-854): Create country variant. // TODO(UX-1132): Refactor to make group button a class, not a widget. -/// Group Button item +/// Group Button item. +/// +/// {@category Components} class ZetaGroupButton extends ZetaStatefulWidget { /// Public Constructor for [ZetaGroupButton] const ZetaGroupButton({ diff --git a/lib/src/components/buttons/button.dart b/lib/src/components/buttons/button.dart index a32b954f..0121460e 100644 --- a/lib/src/components/buttons/button.dart +++ b/lib/src/components/buttons/button.dart @@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; +import 'button_style.dart'; /// Zeta Button /// {@category Components} diff --git a/lib/src/components/buttons/icon_button.dart b/lib/src/components/buttons/icon_button.dart index 16ec30cd..1fe3a866 100644 --- a/lib/src/components/buttons/icon_button.dart +++ b/lib/src/components/buttons/icon_button.dart @@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; +import 'button_style.dart'; /// Component [ZetaIconButton] /// {@category Components} diff --git a/lib/src/components/chat_item/chat_item.dart b/lib/src/components/chat_item/chat_item.dart index 0d3b472d..49611c5b 100644 --- a/lib/src/components/chat_item/chat_item.dart +++ b/lib/src/components/chat_item/chat_item.dart @@ -383,6 +383,8 @@ enum _ZetaSlidableActionType { } /// Slidable action widget for [ZetaChatItem]. +/// +/// {@category Components} class ZetaSlidableAction extends StatelessWidget { /// Constructs a [ZetaSlidableAction]. const ZetaSlidableAction({ diff --git a/lib/src/components/checkbox/checkbox.dart b/lib/src/components/checkbox/checkbox.dart index 1eec21c4..ad382148 100644 --- a/lib/src/components/checkbox/checkbox.dart +++ b/lib/src/components/checkbox/checkbox.dart @@ -9,6 +9,7 @@ import '../../../zeta_flutter.dart'; /// Widgets that use a checkbox should listen for the [onChanged] callback and /// rebuild the checkbox with a new [value] to update the visual appearance of /// the checkbox. +/// /// {@category Components} /// /// Figma: https://www.figma.com/file/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=21510-54003 @@ -95,6 +96,8 @@ class ZetaCheckbox extends FormField { } /// [FormFieldState] for [ZetaCheckbox]. +/// +/// {@category Components} class ZetaCheckboxFormFieldState extends FormFieldState { @override ZetaCheckbox get widget => super.widget as ZetaCheckbox; diff --git a/lib/src/components/chips/chip.dart b/lib/src/components/chips/chip.dart index 9b3ed550..d1a13c25 100644 --- a/lib/src/components/chips/chip.dart +++ b/lib/src/components/chips/chip.dart @@ -3,14 +3,16 @@ import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; -export './assist_chip.dart'; -export './filter_chip.dart'; -export './input_chip.dart'; -export './status_chip.dart'; +export 'assist_chip.dart'; +export 'filter_chip.dart'; +export 'input_chip.dart'; +export 'status_chip.dart'; /// This covers the broad functionality of [ZetaAssistChip], [ZetaFilterChip] and [ZetaInputChip]. /// /// If [selected] is not null, the chip will have the toggle behavior of [ZetaFilterChip]. +/// +/// {@category Components} class ZetaChip extends ZetaStatefulWidget { /// Constructs a [ZetaChip]. const ZetaChip({ diff --git a/lib/src/components/components.dart b/lib/src/components/components.dart index 991af7d8..fe04dc3e 100644 --- a/lib/src/components/components.dart +++ b/lib/src/components/components.dart @@ -11,7 +11,7 @@ export 'bottom sheets/menu_items.dart'; export 'breadcrumb/breadcrumb.dart' hide TruncatedItem; export 'button_group/button_group.dart'; export 'buttons/button.dart'; -export 'buttons/button_style.dart'; +export 'buttons/button_style.dart' show ZetaButtonType; export 'buttons/icon_button.dart'; export 'chat_item/chat_item.dart'; export 'chat_item/contact_item.dart'; diff --git a/lib/src/components/date_input/date_input.dart b/lib/src/components/date_input/date_input.dart index f8abdd84..8e302c8a 100644 --- a/lib/src/components/date_input/date_input.dart +++ b/lib/src/components/date_input/date_input.dart @@ -5,7 +5,6 @@ import 'package:intl/intl.dart'; import 'package:mask_text_input_formatter/mask_text_input_formatter.dart'; import '../../../zeta_flutter.dart'; -import '../../interfaces/form_field.dart'; import '../buttons/input_icon_button.dart'; import '../text_input/internal_text_input.dart'; diff --git a/lib/src/components/dial_pad/dial_pad.dart b/lib/src/components/dial_pad/dial_pad.dart index 503aaaf6..f85ef896 100644 --- a/lib/src/components/dial_pad/dial_pad.dart +++ b/lib/src/components/dial_pad/dial_pad.dart @@ -5,6 +5,7 @@ import 'package:flutter/rendering.dart'; import '../../../zeta_flutter.dart'; /// Dial pad gives the user the ability to dial a number and start a call. It also has a quick dial security action and a delete entry action. +/// /// {@category Components} /// /// Figma: https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=21156-16370&node-type=canvas&m=dev @@ -148,6 +149,8 @@ class _ZetaDialPadState extends State { } /// Individual button for [ZetaDialPad]. +/// +/// {@category Components} class ZetaDialPadButton extends StatelessWidget { /// Constructs a [ZetaDialPadButton] const ZetaDialPadButton({ diff --git a/lib/src/components/dialog/dialog.dart b/lib/src/components/dialog/dialog.dart index e6332125..05f24391 100644 --- a/lib/src/components/dialog/dialog.dart +++ b/lib/src/components/dialog/dialog.dart @@ -12,6 +12,10 @@ enum ZetaDialogHeaderAlignment { } /// Function to show a Zeta dialog. +/// +/// Uses [showDialog] to show a dialog with the [ZetaDialog] widget. +/// +/// @{category Components} Future showZetaDialog( BuildContext context, { ZetaDialogHeaderAlignment headerAlignment = ZetaDialogHeaderAlignment.center, diff --git a/lib/src/components/dropdown/dropdown.dart b/lib/src/components/dropdown/dropdown.dart index 37bc4181..5d95c0c7 100644 --- a/lib/src/components/dropdown/dropdown.dart +++ b/lib/src/components/dropdown/dropdown.dart @@ -171,7 +171,9 @@ enum _MenuPosition { down, } -/// The state for a [ZetaDropdown] +/// The state for a [ZetaDropdown]. +/// +/// {@category Components} class ZetaDropDownState extends State> { late final _DropdownControllerImpl _dropdownController; final OverlayPortalController _overlayPortalController = OverlayPortalController(); diff --git a/lib/src/components/list_item/notification_list_item.dart b/lib/src/components/list_item/notification_list_item.dart index 22ac9afb..ef2fe4d9 100644 --- a/lib/src/components/list_item/notification_list_item.dart +++ b/lib/src/components/list_item/notification_list_item.dart @@ -267,6 +267,8 @@ extension on Image { // TODO(UX-1138): Can this be refactored to use ZetaIndicator? /// Badge item for notification list items. Can be an avatar, icon or image +/// +/// {@category Components} class ZetaNotificationBadge extends StatelessWidget { /// Constructs a notification badge with an avatar. const ZetaNotificationBadge.avatar({ diff --git a/lib/src/components/navigation bar/navigation_bar.dart b/lib/src/components/navigation bar/navigation_bar.dart index 108f8020..12fe74cf 100644 --- a/lib/src/components/navigation bar/navigation_bar.dart +++ b/lib/src/components/navigation bar/navigation_bar.dart @@ -6,6 +6,8 @@ import '../../../zeta_flutter.dart'; const double _navigationItemBorderWidth = 1; /// An item to be used in a [ZetaNavigationBar]. +/// +/// {@category Components} class ZetaNavigationBarItem { /// Creates a new [ZetaNavigationBarItem] const ZetaNavigationBarItem({ @@ -25,6 +27,7 @@ class ZetaNavigationBarItem { } /// Navigation Bars (Bottom navigation) allow movement between primary destinations in an app. +/// /// {@category Components} /// /// Figma: https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=1052-24751&node-type=canvas&m=dev diff --git a/lib/src/components/navigation_rail/navigation_rail.dart b/lib/src/components/navigation_rail/navigation_rail.dart index 772c7af4..e48aa374 100644 --- a/lib/src/components/navigation_rail/navigation_rail.dart +++ b/lib/src/components/navigation_rail/navigation_rail.dart @@ -8,7 +8,9 @@ import '../../../zeta_flutter.dart'; /// sections of an app. It is designed to be used as a side navigation /// menu and can be customized with different icons and labels for each /// navigation item. +/// /// Should be used with [ZetaNavigationRailItem]. +/// /// {@category Components} /// /// Figma: https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=229-43&node-type=canvas&m=dev @@ -262,6 +264,8 @@ class _ZetaNavigationRailItemContentState extends State<_ZetaNavigationRailItemC } /// Represents an item in the [ZetaNavigationRail]. + +/// {@category Components} class ZetaNavigationRailItem { /// Constructor for [ZetaNavigationRailItem]. const ZetaNavigationRailItem({ diff --git a/lib/src/components/password/password_input.dart b/lib/src/components/password/password_input.dart index 680b22e8..c0e69772 100644 --- a/lib/src/components/password/password_input.dart +++ b/lib/src/components/password/password_input.dart @@ -2,7 +2,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; -import '../../interfaces/form_field.dart'; import '../text_input/internal_text_input.dart'; /// Zeta Password Input diff --git a/lib/src/components/phone_input/phone_input.dart b/lib/src/components/phone_input/phone_input.dart index b32c0afb..ad72843a 100644 --- a/lib/src/components/phone_input/phone_input.dart +++ b/lib/src/components/phone_input/phone_input.dart @@ -4,27 +4,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../../../zeta_flutter.dart'; - -import '../../interfaces/form_field.dart'; import '../text_input/internal_text_input.dart'; -import 'countries.dart'; - -/// A phone number. -class PhoneNumber { - /// Creates a new [PhoneNumber]. - const PhoneNumber({ - required this.dialCode, - required this.number, - }); - - /// The dial code of the phone number. - final String dialCode; - - /// The number of the phone number. - final String number; -} /// ZetaPhoneInput allows entering phone numbers. +/// /// {@category Components} /// /// Figma: https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=916-10934&node-type=canvas&m=dev diff --git a/lib/src/components/range_selector/range_selector.dart b/lib/src/components/range_selector/range_selector.dart index 4765a88a..68c61ca0 100644 --- a/lib/src/components/range_selector/range_selector.dart +++ b/lib/src/components/range_selector/range_selector.dart @@ -7,7 +7,9 @@ import '../../../zeta_flutter.dart'; /// The [ZetaRangeSelector] is a customizable range selector widget that /// allows users to select a range of values within a specified minimum /// and maximum range. It provides a visual representation of the selected -/// range and allows for precise adjustments through both dragging and direct input +/// range and allows for precise adjustments through both dragging and direct input. +/// +/// {@category Components} class ZetaRangeSelector extends ZetaStatefulWidget { /// Creates a new [ZetaRangeSelector] ZetaRangeSelector({ diff --git a/lib/src/components/screen_header_bar/screen_header_bar.dart b/lib/src/components/screen_header_bar/screen_header_bar.dart index 4212abf0..63878876 100644 --- a/lib/src/components/screen_header_bar/screen_header_bar.dart +++ b/lib/src/components/screen_header_bar/screen_header_bar.dart @@ -2,7 +2,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; -/// [ZetaScreenHeaderBar] +/// A screen header bar that contains a back button, title and an optional action button. +/// /// {@category Components} /// /// Figma: https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=24601-6781&node-type=canvas&m=dev diff --git a/lib/src/components/search_bar/search_bar.dart b/lib/src/components/search_bar/search_bar.dart index 4287965c..37cff5a0 100644 --- a/lib/src/components/search_bar/search_bar.dart +++ b/lib/src/components/search_bar/search_bar.dart @@ -1,7 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; -import '../../interfaces/form_field.dart'; import '../buttons/input_icon_button.dart'; import '../text_input/internal_text_input.dart'; diff --git a/lib/src/components/select_input/select_input.dart b/lib/src/components/select_input/select_input.dart index df9401bf..b8b0aefb 100644 --- a/lib/src/components/select_input/select_input.dart +++ b/lib/src/components/select_input/select_input.dart @@ -3,7 +3,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../../../zeta_flutter.dart'; -import '../../interfaces/form_field.dart'; import '../buttons/input_icon_button.dart'; import '../dropdown/dropdown_controller.dart'; import '../text_input/internal_text_input.dart'; diff --git a/lib/src/components/stepper/stepper.dart b/lib/src/components/stepper/stepper.dart index 8a27310f..ce85154b 100644 --- a/lib/src/components/stepper/stepper.dart +++ b/lib/src/components/stepper/stepper.dart @@ -490,6 +490,8 @@ class VerticalStep extends StatelessWidget { /// Zeta step used in [ZetaStepper]. The step can have a title and subtitle, /// an icon within its circle, some content and a state that governs its /// styling. +/// +/// {@category Components} class ZetaStep { /// Creates a step for a [ZetaStepper]. const ZetaStep({ diff --git a/lib/src/components/text_input/text_input.dart b/lib/src/components/text_input/text_input.dart index 946193d4..ba267e2f 100644 --- a/lib/src/components/text_input/text_input.dart +++ b/lib/src/components/text_input/text_input.dart @@ -3,13 +3,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../../../zeta_flutter.dart'; -import '../../interfaces/form_field.dart'; import 'internal_text_input.dart'; /// Text inputs allow the user to enter text. /// /// To show error messages on the text input, use the [validator]. The string returned from this function will be displayed as the error message. /// Error messages can also be managed outside the text input by setting [errorText]. +/// /// {@category Components} /// /// Figma: https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=229-38&node-type=canvas&m=dev diff --git a/lib/src/components/time_input/time_input.dart b/lib/src/components/time_input/time_input.dart index c3f5f71e..25a95438 100644 --- a/lib/src/components/time_input/time_input.dart +++ b/lib/src/components/time_input/time_input.dart @@ -4,7 +4,6 @@ import 'package:flutter/services.dart'; import 'package:mask_text_input_formatter/mask_text_input_formatter.dart'; import '../../../zeta_flutter.dart'; -import '../../interfaces/form_field.dart'; import '../buttons/input_icon_button.dart'; import '../text_input/internal_text_input.dart'; diff --git a/lib/src/components/top_app_bar/search_top_app_bar.dart b/lib/src/components/top_app_bar/search_top_app_bar.dart index 973b7e3d..4eacf0f3 100644 --- a/lib/src/components/top_app_bar/search_top_app_bar.dart +++ b/lib/src/components/top_app_bar/search_top_app_bar.dart @@ -183,6 +183,8 @@ class _ZetaTopAppBarSearchFieldState extends State wit } /// A controller used to control the search field in the app bar. +/// +/// {@category Utils} class ZetaSearchController extends ChangeNotifier { bool _enabled = false; diff --git a/lib/generated/generated.dart b/lib/src/generated/generated.dart similarity index 100% rename from lib/generated/generated.dart rename to lib/src/generated/generated.dart diff --git a/lib/generated/icons/icons.g.dart b/lib/src/generated/icons/icons.g.dart similarity index 100% rename from lib/generated/icons/icons.g.dart rename to lib/src/generated/icons/icons.g.dart diff --git a/lib/generated/icons/zeta-icons-round.ttf b/lib/src/generated/icons/zeta-icons-round.ttf similarity index 100% rename from lib/generated/icons/zeta-icons-round.ttf rename to lib/src/generated/icons/zeta-icons-round.ttf diff --git a/lib/generated/icons/zeta-icons-sharp.ttf b/lib/src/generated/icons/zeta-icons-sharp.ttf similarity index 100% rename from lib/generated/icons/zeta-icons-sharp.ttf rename to lib/src/generated/icons/zeta-icons-sharp.ttf diff --git a/lib/generated/tokens/primitives.g.dart b/lib/src/generated/tokens/primitives.g.dart similarity index 100% rename from lib/generated/tokens/primitives.g.dart rename to lib/src/generated/tokens/primitives.g.dart diff --git a/lib/generated/tokens/semantics.g.dart b/lib/src/generated/tokens/semantics.g.dart similarity index 100% rename from lib/generated/tokens/semantics.g.dart rename to lib/src/generated/tokens/semantics.g.dart diff --git a/lib/src/components/phone_input/countries.dart b/lib/src/interfaces/countries.dart similarity index 99% rename from lib/src/components/phone_input/countries.dart rename to lib/src/interfaces/countries.dart index 0d756fd7..e38bc64b 100644 --- a/lib/src/components/phone_input/countries.dart +++ b/lib/src/interfaces/countries.dart @@ -1,4 +1,6 @@ -/// [Country] +/// Class definition for a country with its name, dial code, and ISO code. +/// +/// {@category Components} class Country { /// Constructor for [Country] const Country({ @@ -27,7 +29,9 @@ class Country { }.toString(); } -/// [Countries] +/// Class definition for a list of countries. +/// +/// {@category Interfaces} class Countries { /// List of [Country] for most countries around the world. static List get list => _countriesList; diff --git a/lib/src/interfaces/form_field.dart b/lib/src/interfaces/form_field.dart index 353468e1..c1364c4b 100644 --- a/lib/src/interfaces/form_field.dart +++ b/lib/src/interfaces/form_field.dart @@ -42,6 +42,8 @@ abstract class ZetaFormField extends FormField { } /// A text form field used in Zeta +/// +/// {@category Interfaces} abstract class ZetaTextFormField extends ZetaFormField { /// Creates a new [ZetaTextFormField] ZetaTextFormField({ diff --git a/lib/src/interfaces/interfaces.dart b/lib/src/interfaces/interfaces.dart new file mode 100644 index 00000000..a0d2f958 --- /dev/null +++ b/lib/src/interfaces/interfaces.dart @@ -0,0 +1,3 @@ +export 'countries.dart'; +export 'form_field.dart'; +export 'phone_number.dart'; diff --git a/lib/src/interfaces/phone_number.dart b/lib/src/interfaces/phone_number.dart new file mode 100644 index 00000000..dda3fd84 --- /dev/null +++ b/lib/src/interfaces/phone_number.dart @@ -0,0 +1,16 @@ +/// A phone number. +/// +/// {@category Interfaces} +class PhoneNumber { + /// Creates a new [PhoneNumber]. + const PhoneNumber({ + required this.dialCode, + required this.number, + }); + + /// The dial code of the phone number. + final String dialCode; + + /// The number of the phone number. + final String number; +} diff --git a/lib/src/theme/color_swatch.dart b/lib/src/theme/color_swatch.dart index 8d4a7864..8dd56023 100644 --- a/lib/src/theme/color_swatch.dart +++ b/lib/src/theme/color_swatch.dart @@ -178,6 +178,8 @@ class ZetaColorSwatch extends ColorSwatch with EquatableMixin { } /// A swatch of colors with values 0 (light), 500 (medium) and 1000(dark). +/// +/// {@category Theme} class ZetaPureColorSwatch extends ColorSwatch with EquatableMixin { /// Constructs a [ZetaPureColorSwatch]. /// diff --git a/lib/src/theme/custom_theme.dart b/lib/src/theme/custom_theme.dart index 8edee88c..13ec2485 100644 --- a/lib/src/theme/custom_theme.dart +++ b/lib/src/theme/custom_theme.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; import 'color_swatch.dart'; /// A custom theme that can be used to define custom colors for the app. +/// +/// {@category Theme} class ZetaCustomTheme { /// Constructs a [ZetaCustomTheme]. /// To define every shade of a color, provide a [ZetaColorSwatch] or a [MaterialColor]. diff --git a/lib/src/theme/theme_service.dart b/lib/src/theme/theme_service.dart index b393a979..28079d0a 100644 --- a/lib/src/theme/theme_service.dart +++ b/lib/src/theme/theme_service.dart @@ -10,6 +10,10 @@ const String _kThemeId = 'theme_id'; const String _kFontFamily = 'fontFamily'; /// `ZetaThemeData` is a class that holds the theme data to be stored with the theme service. +/// +/// It contains the theme mode, contrast, and font family. +/// +/// {@category Theme} class ZetaThemeServiceData extends Equatable { /// Constructs a [ZetaThemeServiceData]. /// diff --git a/lib/src/theme/tokens.dart b/lib/src/theme/tokens.dart index 63dcd427..90334ad0 100644 --- a/lib/src/theme/tokens.dart +++ b/lib/src/theme/tokens.dart @@ -18,6 +18,9 @@ class ZetaAnimationLength { } /// Temporary class to hold border values. +/// +/// {@category Theme} +/// // TODO(Tokens): Remove this class and design / develop Zeta.of(context).border instead. abstract final class ZetaBorders { /// Small border width diff --git a/lib/src/theme/typography.dart b/lib/src/theme/typography.dart index a5a84502..30a88fc8 100644 --- a/lib/src/theme/typography.dart +++ b/lib/src/theme/typography.dart @@ -230,6 +230,7 @@ class ZetaTextStyles { } /// [ZetaTextStyles] combined into a [TextTheme]. +/// /// {@category Theme} const TextTheme zetaTextTheme = TextTheme( displayLarge: ZetaTextStyles.displayLarge, diff --git a/lib/src/utils/debounce.dart b/lib/src/utils/debounce.dart index f7288bb6..cd6db0b9 100644 --- a/lib/src/utils/debounce.dart +++ b/lib/src/utils/debounce.dart @@ -1,6 +1,6 @@ import 'dart:async'; -export './extensions.dart'; +export 'extensions.dart'; const Duration _debounceDuration = Duration(milliseconds: 500); diff --git a/lib/src/utils/nothing.dart b/lib/src/utils/nothing.dart index a8ef94f8..a56d193e 100644 --- a/lib/src/utils/nothing.dart +++ b/lib/src/utils/nothing.dart @@ -1,6 +1,7 @@ import 'package:flutter/widgets.dart'; /// A convenient widget that renders nothing. +/// /// {@category Utils} class Nothing extends StatelessWidget { /// Constructs a [Nothing] widget. diff --git a/lib/src/utils/zeta_provider.dart b/lib/src/utils/zeta_provider.dart index 31f33f99..ba361d09 100644 --- a/lib/src/utils/zeta_provider.dart +++ b/lib/src/utils/zeta_provider.dart @@ -7,6 +7,10 @@ import '../../zeta_flutter.dart'; /// A typedef for the ZetaAppBuilder function which passes [BuildContext], light [ThemeData], /// dark [ThemeData] and [ThemeMode] and returns a [Widget]. +/// +/// This function is used to build the app with the provided theming information. +/// +/// {@category Utils} typedef ZetaAppBuilder = Widget Function( BuildContext context, ThemeData light, diff --git a/lib/zeta_flutter.dart b/lib/zeta_flutter.dart index cb8a5a1a..d17db81d 100644 --- a/lib/zeta_flutter.dart +++ b/lib/zeta_flutter.dart @@ -1,7 +1,8 @@ /// Zebra Design System (Zeta) - Flutter Component Library library; -export 'generated/generated.dart'; export 'src/components/components.dart'; +export 'src/generated/generated.dart'; +export 'src/interfaces/interfaces.dart'; export 'src/theme/theme.dart'; export 'src/utils/utils.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index f28e1828..fe8ab349 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,13 +53,13 @@ flutter: weight: 500 - family: zeta-icons fonts: - - asset: lib/generated/icons/zeta-icons-round.ttf + - asset: lib/src/generated/icons/zeta-icons-round.ttf - family: zeta-icons-round fonts: - - asset: lib/generated/icons/zeta-icons-round.ttf + - asset: lib/src/generated/icons/zeta-icons-round.ttf - family: zeta-icons-sharp fonts: - - asset: lib/generated/icons/zeta-icons-sharp.ttf + - asset: lib/src/generated/icons/zeta-icons-sharp.ttf assets: - lib/assets/flags/ - lib/assets/logos/ diff --git a/test/src/utils/extensions_test.mocks.dart b/test/src/utils/extensions_test.mocks.dart index 80397111..0ec2d42a 100644 --- a/test/src/utils/extensions_test.mocks.dart +++ b/test/src/utils/extensions_test.mocks.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart' as _i2; import 'package:flutter/src/widgets/notification_listener.dart' as _i7; import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i8; -import 'package:zeta_flutter/generated/tokens/primitives.g.dart' as _i4; +import 'package:zeta_flutter/src/generated/tokens/primitives.g.dart' as _i4; import 'package:zeta_flutter/zeta_flutter.dart' as _i6; // ignore_for_file: type=lint