diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c759e6..e3625ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,38 +1,9 @@ +## 1.1.1+1 - 2024-02-24 + +* Fixes: Adhere to pub.dev package standards and updated documentation. + ## 1.1.1 - 2024-02-24 -* Added components: -TUIAccordion -TUIAnchor -TUIAppTopBar -TUIAttachmentUpload -TUIAvatar -TUIBadge -TUIBreadCrumb -TUIButton -TUICheckBox -TUICheckBoxRow -TUIChip -TUIDivider -TUIDraggableCard -TUIEmailField -TUIEmailSubjectField -TUIFloatingActionButton -TUIIconButton -TUIInputField -TUIMediaThumbnail -TUIMenuItem -TUIMobileButtonBlock -TUIMobileOverlayHeader -TUIMobileOverlayFooter -TUINavigationRow -TUIRadioButton -TUIRangeSlider -TUISearchBar -TUISelectionCard -TUISlider -TUISnackBar -TUISuccessCheckMark -TUIToggleSwitch -TUITag -TUIToggleRow +* Initial release of the Tarka UI library with 33 components. + diff --git a/LICENSE b/LICENSE index 1dcd3d3..e6cdb23 100644 --- a/LICENSE +++ b/LICENSE @@ -14,7 +14,7 @@ copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE diff --git a/README.md b/README.md index 12330b8..033cd4e 100644 --- a/README.md +++ b/README.md @@ -50,17 +50,6 @@ Tarka UI Kit is a reusable component library for building Flutter apps, based on - TUITag - TUIToggleRow - -## How to use this package in your project? - -``` -# Add this below package in the dependencies section of the pubspec.yaml file -tarka_ui: - git: - url: git@github.com:tarkalabs/tarka-ui-kit-flutter.git - ref: v1.1.0 -``` - ## How to run the kitchen sink app? ### From Android Studio diff --git a/example/README.md b/example/README.md index d6dcff7..00cc231 100644 --- a/example/README.md +++ b/example/README.md @@ -1,16 +1,4 @@ # example -Tarka Kit Flutter example project +Tarka UI Kit Flutter example 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/example/pubspec.lock b/example/pubspec.lock index 187ad89..d4c36df 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -179,7 +179,7 @@ packages: path: ".." relative: true source: path - version: "1.1.0" + version: "1.1.1+1" term_glyph: dependency: transitive description: diff --git a/lib/components/accordion/accordion.dart b/lib/components/accordion/accordion.dart index a812a47..43b7205 100644 --- a/lib/components/accordion/accordion.dart +++ b/lib/components/accordion/accordion.dart @@ -4,14 +4,14 @@ import 'package:tarka_ui/styles/default_colors.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIAccordion is a widget that allows you to show and hide content. -/* - Example: - ```dart - TUIAccordion( - title: 'Accordion Title', - subtitle: 'Accordion Subtitle', - ),``` - */ +/// +/// Example: +/// ```dart +/// TUIAccordion( +/// title: 'Accordion Title', +/// subtitle: 'Accordion Subtitle', +/// ) +/// ``` class TUIAccordion extends StatefulWidget { final String title; final String subtitle; diff --git a/lib/components/anchor/anchor.dart b/lib/components/anchor/anchor.dart index a637503..ca5633c 100644 --- a/lib/components/anchor/anchor.dart +++ b/lib/components/anchor/anchor.dart @@ -2,17 +2,16 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIAnchor is a component that is used to create a clickable anchor. -/* - Example: - ```dart - TUIAnchor( - title: 'Anchor', - onPressed: () { - print('Anchor pressed'); - }, - ) - ``` -*/ +/// +/// Example: +/// ```dart +/// TUIAnchor( +/// title: 'Anchor', +/// onPressed: () { +/// print('Anchor pressed'); +/// }, +/// ) +/// ``` class TUIAnchor extends StatefulWidget { const TUIAnchor({ super.key, diff --git a/lib/components/app_bar/app_bar.dart b/lib/components/app_bar/app_bar.dart index 7b70ec4..8b3b00e 100644 --- a/lib/components/app_bar/app_bar.dart +++ b/lib/components/app_bar/app_bar.dart @@ -2,20 +2,21 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIAppTopBar is a widget that allows you to create a top bar. -/* -Example: -```dart -TUIAppTopBar( - items: [ - TUIAppBarItem(iconData: Icons.home, label: "Home", tooltip: "Home"), - TUIAppBarItem(iconData: Icons.search, label: "Search", tooltip: "Search"), - TUIAppBarItem(iconData: Icons.person, label: "Profile", tooltip: "Profile"), - ], - onTap: (index) { - print("TUIAppTopBar: $index"); - }, - currentIndex: 0, - */ +/// +/// Example: +/// ```dart +/// TUIAppTopBar( +/// items: [ +/// TUIAppBarItem(iconData: Icons.home, label: "Home", tooltip: "Home"), +/// TUIAppBarItem(iconData: Icons.search, label: "Search", tooltip: "Search"), +/// TUIAppBarItem(iconData: Icons.person, label: "Profile", tooltip: "Profile"), +/// ], +/// onTap: (index) { +/// print("TUIAppTopBar: $index"); +/// }, +/// currentIndex: 0, +/// ) +/// ``` class TUIAppTopBar extends StatefulWidget { final List items; final List _bnbItems; diff --git a/lib/components/attachment_upload/attachment_upload.dart b/lib/components/attachment_upload/attachment_upload.dart index 8042a07..4bbf3fd 100644 --- a/lib/components/attachment_upload/attachment_upload.dart +++ b/lib/components/attachment_upload/attachment_upload.dart @@ -4,22 +4,22 @@ import 'package:tarka_ui/styles/theme.dart'; import 'package:tarka_ui/subcomponents/image.dart'; /// TUIAttachmentUpload widget to display an attachment upload with title, description and action buttons. - -/* -Example: -```dart -TUIAttachmentUpload( - title: "Attachment 1", - isIconUsed: true, - icon: FluentIcons.attach_12_regular, - description: "Description of attachment 1", - downloadTapped: () { - print("Download tapped"); - }, - deleteTapped: () { - print("Delete tapped"); - }, - */ +/// +/// Example: +/// ```dart +/// TUIAttachmentUpload( +/// title: "Attachment 1", +/// isIconUsed: true, +/// icon: FluentIcons.attach_12_regular, +/// description: "Description of attachment 1", +/// downloadTapped: () { +/// print("Download tapped"); +/// }, +/// deleteTapped: () { +/// print("Delete tapped"); +/// }, +/// ) +/// ``` class TUIAttachmentUpload extends StatelessWidget { final String title; final bool isIconUsed; diff --git a/lib/components/avatar/avatar.dart b/lib/components/avatar/avatar.dart index bba0bd5..c5c67b9 100644 --- a/lib/components/avatar/avatar.dart +++ b/lib/components/avatar/avatar.dart @@ -4,20 +4,21 @@ import 'package:tarka_ui/styles/text_style.dart'; import 'package:tarka_ui/subcomponents/image.dart'; /// TUIAvatar is used to create a Avatar with content, size and badge flag. -/* - Example: - ```dart - TUIAvatar( - avatarSize: TUIAvatarSize.xs, - avatarContent: TUIAvatarContent( - type: TUIAvatarContentType.image, - image: TUIImage( - imageUrl: 'https://picsum.photos/200/300', - ), - ), - isBadged: true, - ),``` - */ +/// +/// Example: +/// ```dart +/// TUIAvatar( +/// avatarSize: TUIAvatarSize.xs, +/// avatarContent: TUIAvatarContent( +/// type: TUIAvatarContentType.image, +/// image: TUIImage( +/// imageUrl: 'https://picsum.photos/200/300', +/// ), +/// ), +/// isBadged: true, +/// ) +/// ``` + class TUIAvatar extends StatelessWidget { final TUIAvatarSize avatarSize; final TUIAvatarContent avatarContent; diff --git a/lib/components/badge/badge.dart b/lib/components/badge/badge.dart index 3e2c421..80ec7a5 100644 --- a/lib/components/badge/badge.dart +++ b/lib/components/badge/badge.dart @@ -60,16 +60,15 @@ enum TUIBadgeSize { } /// TUIBadge is used to create a Badge with content, size and badge flag. -/* - Example: - ```dart - TUIBadge( - badgeSize: TUIBadgeSize.xs, - content: '1', - isNumbered: true, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUIBadge( +/// badgeSize: TUIBadgeSize.xs, +/// content: '1', +/// isNumbered: true, +/// ), +/// ``` class TUIBadge extends StatelessWidget { final TUIBadgeSize badgeSize; final String? content; diff --git a/lib/components/breadcrumb/breadcrumb.dart b/lib/components/breadcrumb/breadcrumb.dart index cd6b880..8317ab2 100644 --- a/lib/components/breadcrumb/breadcrumb.dart +++ b/lib/components/breadcrumb/breadcrumb.dart @@ -3,16 +3,16 @@ import 'package:tarka_ui/styles/default_colors.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIBreadCrumb is used to create a BreadCrumb with titles and onTap function. -/* - Example: - ```dart - TUIBreadCrumb( - titles: ['Home', 'Library', 'Data'], - onTap: (index) { - print('Tapped on index: $index'); - }, - ),``` - */ +/// +/// Example: +/// ```dart +/// TUIBreadCrumb( +/// titles: ['Home', 'Library', 'Data'], +/// onTap: (index) { +/// print('Tapped on index: $index'); +/// }, +/// ) +/// ``` class TUIBreadCrumb extends StatelessWidget { final Function(int) onTap; final List titles; diff --git a/lib/components/button/button.dart b/lib/components/button/button.dart index 853f5e2..a982e01 100644 --- a/lib/components/button/button.dart +++ b/lib/components/button/button.dart @@ -3,17 +3,17 @@ import 'package:tarka_ui/components/button/style.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIButton is used to create a button with label, icon and button type. -/* - Example: - ```dart - TUIButton( - type: TUIButtonType.primary, - size: TUIButtonSize.m, - label: 'Primary', - onPressed: () {}, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUIButton( +/// type: TUIButtonType.primary, +/// size: TUIButtonSize.m, +/// label: 'Primary', +/// onPressed: () {}, +/// ) +/// ``` + class TUIButton extends StatelessWidget { const TUIButton({ super.key, diff --git a/lib/components/button/icon_button.dart b/lib/components/button/icon_button.dart index b66f88a..2cfa873 100644 --- a/lib/components/button/icon_button.dart +++ b/lib/components/button/icon_button.dart @@ -3,17 +3,16 @@ import 'package:tarka_ui/components/button/style.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIIconButton is used to create a button with icon and button type. -/* - Example: - ```dart - TUIIconButton( - type: TUIIconButtonType.primary, - size: TUIIconButtonSize.m, - iconData: Icons.add, - onPressed: () {}, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUIIconButton( +/// type: TUIIconButtonType.primary, +/// size: TUIIconButtonSize.m, +/// iconData: Icons.add, +/// onPressed: () {}, +/// ), +/// ``` class TUIIconButton extends StatelessWidget { const TUIIconButton( {super.key, diff --git a/lib/components/checkbox/checkbox.dart b/lib/components/checkbox/checkbox.dart index 88e4cfa..00c8971 100644 --- a/lib/components/checkbox/checkbox.dart +++ b/lib/components/checkbox/checkbox.dart @@ -3,17 +3,16 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUICheckBox is used to create a checkbox with label and checkbox state. -/* - Example: - ```dart - TUICheckBox( - state: TUICheckBoxState.unchecked, - onChanged: (TUICheckBoxState state) { - print(state); - }, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUICheckBox( +/// state: TUICheckBoxState.unchecked, +/// onChanged: (TUICheckBoxState state) { +/// print(state); +/// }, +/// ), +/// ``` class TUICheckBox extends StatefulWidget { final bool? enableMixedState; final TUICheckBoxState state; diff --git a/lib/components/checkbox_row/checkbox_row.dart b/lib/components/checkbox_row/checkbox_row.dart index 515d4d6..5fb0e38 100644 --- a/lib/components/checkbox_row/checkbox_row.dart +++ b/lib/components/checkbox_row/checkbox_row.dart @@ -3,17 +3,16 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUICheckBoxRow is used to create a checkbox with label and checkbox state. -/* - Example: - ```dart - TUICheckBoxRow( - state: TUICheckBoxRowState.unchecked, - onChanged: (TUICheckBoxRowState state) { - print(state); - }, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUICheckBoxRow( +/// state: TUICheckBoxRowState.unchecked, +/// onChanged: (TUICheckBoxRowState state) { +/// print(state); +/// }, +/// ), +/// ``` class TUICheckBoxRow extends StatefulWidget { final String title; final String description; diff --git a/lib/components/chip/chip.dart b/lib/components/chip/chip.dart index 1de8a61..6709f45 100644 --- a/lib/components/chip/chip.dart +++ b/lib/components/chip/chip.dart @@ -5,20 +5,21 @@ import 'package:tarka_ui/styles/text_style.dart'; import 'package:tarka_ui/subcomponents/image.dart'; /// TUIChip widget to display a chip with title, left icon, right icon and badge. -/* -Example: -```dart -TUIChip( - title: "Chip 1", - size: TUIChipSize.m, - highlighted: false, - leftIcon: FluentIcons.attach_12_regular, - badgeValue: "2", - rightIcon: FluentIcons.dismiss_12_filled, - onRightIconTap: () { - print("Right icon tapped"); - }, - */ +/// +/// Example: +/// ```dart +/// TUIChip( +/// title: "Chip 1", +/// size: TUIChipSize.m, +/// highlighted: false, +/// leftIcon: FluentIcons.attach_12_regular, +/// badgeValue: "2", +/// rightIcon: FluentIcons.dismiss_12_filled, +/// onRightIconTap: () { +/// print("Right icon tapped"); +/// }, +/// ) +/// ``` class TUIChip extends StatelessWidget { final String title; final TUIChipSize size; diff --git a/lib/components/divider/divider.dart b/lib/components/divider/divider.dart index 6d8d23f..29a14e5 100644 --- a/lib/components/divider/divider.dart +++ b/lib/components/divider/divider.dart @@ -11,17 +11,16 @@ enum TUIDividerHorizontalPadding { none, s, m, l, xl } enum TUIDividerType { horizontal, vertical } /// TKDivider is used to create a divider with default height and color. -/* - Example: - ```dart - TUIDivider( - type: TUIDividerType.horizontal, - color: TUIColors.surfaceVariantHover, - verticalPadding: TUIDividerVerticalPadding.s, - horizontalPadding: TUIDividerHorizontalPadding.s, - ) - ``` - */ +/// +/// Example: +/// ```dart +/// TUIDivider( +/// type: TUIDividerType.horizontal, +/// color: TUIColors.surfaceVariantHover, +/// verticalPadding: TUIDividerVerticalPadding.s, +/// horizontalPadding: TUIDividerHorizontalPadding.s, +/// ) +/// ``` class TUIDivider extends StatelessWidget { final TUIDividerType? type; final Color? color; diff --git a/lib/components/draggable_card/draggable_card.dart b/lib/components/draggable_card/draggable_card.dart index 217c760..6638515 100644 --- a/lib/components/draggable_card/draggable_card.dart +++ b/lib/components/draggable_card/draggable_card.dart @@ -3,14 +3,13 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIDraggableCard is a card that can be dragged and dropped. -/* - Example: - ```dart - TUIDraggableCard( - child: Text('Hello World'), - ) - ``` -*/ +/// +/// Example: +/// ```dart +/// TUIDraggableCard( +/// child: Text('Hello World'), +/// ) +/// ``` class TUIDraggableCard extends StatelessWidget { final Widget child; final bool backgroundDark; diff --git a/lib/components/email_field/email_field.dart b/lib/components/email_field/email_field.dart index 027c55f..86a636e 100644 --- a/lib/components/email_field/email_field.dart +++ b/lib/components/email_field/email_field.dart @@ -4,13 +4,22 @@ import 'package:tarka_ui/styles/text_style.dart'; import 'package:fluentui_system_icons/fluentui_system_icons.dart'; /// TUIEmailField is a widget that allows the user to input email addresses. -/* -Example: -```dart -TUIEmailField( - label: TUIEmailFieldLabel.to, - emails: [' - */ +/// +/// Example: +/// ```dart +/// TUIEmailField( +/// label: TUIEmailFieldLabel.to, +/// emails: ['abc@gmail.com'], +/// showSuffix: true, +/// onAdd: () { +/// print('Add button clicked'); +/// }, +/// onRemove: () { +/// print('Remove button clicked'); +/// }, +/// controller: TextEditingController(), +/// ) +/// ``` class TUIEmailField extends StatefulWidget { final TUIEmailFieldLabel label; final List emails; diff --git a/lib/components/email_subject_field/email_subject_field.dart b/lib/components/email_subject_field/email_subject_field.dart index 2ebf4a9..a24396e 100644 --- a/lib/components/email_subject_field/email_subject_field.dart +++ b/lib/components/email_subject_field/email_subject_field.dart @@ -2,16 +2,15 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIEmailSubjectField is a text field for entering the subject of an email. -/* -Example: - ```dart - TUIEmailSubjectField( - onTextChanged: (text) { - print(text); - }, - ) - ``` - */ +/// +/// Example: +/// ```dart +/// TUIEmailSubjectField( +/// onTextChanged: (text) { +/// print(text); +/// }, +/// ) +/// ``` class TUIEmailSubjectField extends StatefulWidget { final Function(String) onTextChanged; diff --git a/lib/components/floating_action_button/floating_action_button.dart b/lib/components/floating_action_button/floating_action_button.dart index bf56ecc..0402af4 100644 --- a/lib/components/floating_action_button/floating_action_button.dart +++ b/lib/components/floating_action_button/floating_action_button.dart @@ -13,16 +13,18 @@ enum TUIFloatingActionButtonSize { } /// TUIFloatingActionButton is a button that floats on the screen. -/* -Example: -```dart -TUIFloatingActionButton( - size: TUIFloatingActionButtonSize.large, - iconData: Icons.add, - onPressed: () { - print('Pressed'); - }, - */ +/// +/// Example: +/// ```dart +/// TUIFloatingActionButton( +/// size: TUIFloatingActionButtonSize.large, +/// iconData: Icons.add, +/// onPressed: () { +/// print('Pressed'); +/// }, +/// ) +/// ``` + class TUIFloatingActionButton extends StatefulWidget { const TUIFloatingActionButton({ super.key, diff --git a/lib/components/media_thumbnail/media_thumbnail.dart b/lib/components/media_thumbnail/media_thumbnail.dart index d242a4d..0322b4a 100644 --- a/lib/components/media_thumbnail/media_thumbnail.dart +++ b/lib/components/media_thumbnail/media_thumbnail.dart @@ -4,20 +4,21 @@ import 'package:tarka_ui/styles/default_colors.dart'; import 'package:tarka_ui/subcomponents/image.dart'; /// TUIMediaThumbnail is a widget that displays a thumbnail of a media file. -/* -Example: -```dart -TUIMediaThumbnail( - onPressed: () { - print('Thumbnail pressed'); - }, - isSelectable: true, - size: TUIMediaThumbnailSize.large, - mediaType: TUIMediaThumbnailType.photo, - customThumbnailImage: TUIImage( - image: Image.asset('assets/images/image.png'), - ), - */ +/// +/// Example: +/// ```dart +/// TUIMediaThumbnail( +/// onPressed: () { +/// print('Thumbnail pressed'); +/// }, +/// isSelectable: true, +/// size: TUIMediaThumbnailSize.large, +/// mediaType: TUIMediaThumbnailType.photo, +/// customThumbnailImage: TUIImage( +/// image: Image.asset('assets/images/image.png'), +/// ), +/// ) +/// ``` class TUIMediaThumbnail extends StatelessWidget { final VoidCallback? onPressed; final bool? isSelectable; diff --git a/lib/components/menu_item/menu_item.dart b/lib/components/menu_item/menu_item.dart index 6ae144e..1a459a9 100644 --- a/lib/components/menu_item/menu_item.dart +++ b/lib/components/menu_item/menu_item.dart @@ -15,18 +15,19 @@ class TUIMenuItemProperties { } /// TUIMenuItem is a widget that represents a menu item with a title and an icon. -/* -Example: -```dart -TUIMenuItem( - item: TUIMenuItemProperties( - title: 'Item 1', - style: TUIMenuItemStyle.both, - ), - action: (state) { - print(state); - }, - */ +/// +/// Example: +/// ```dart +/// TUIMenuItem( +/// item: TUIMenuItemProperties( +/// title: 'Item 1', +/// style: TUIMenuItemStyle.both, +/// ), +/// action: (state) { +/// print(state); +/// }, +/// ) +/// ``` class TUIMenuItem extends StatefulWidget { final TUIMenuItemProperties item; final bool backgroundDark; // for hover diff --git a/lib/components/mobile_button_block/mobile_button_block.dart b/lib/components/mobile_button_block/mobile_button_block.dart index b0f0d8c..24d4aee 100644 --- a/lib/components/mobile_button_block/mobile_button_block.dart +++ b/lib/components/mobile_button_block/mobile_button_block.dart @@ -2,22 +2,23 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/components/button/button.dart'; /// TUIMobileButtonBlock is a widget that displays a row of buttons. -/* -Example: -```dart -TUIMobileButtonBlock( - style: TUIMobileButtonBlockStyle( - style: Style.flexible, - left: TUIButton( - label: 'Cancel', - onPressed: () {}, - ), - right: TUIButton( - label: 'Save', - onPressed: () {}, - ), - ), - */ +/// +/// Example: +/// ```dart +/// TUIMobileButtonBlock( +/// style: TUIMobileButtonBlockStyle( +/// style: Style.flexible, +/// left: TUIButton( +/// label: 'Cancel', +/// onPressed: () {}, +/// ), +/// right: TUIButton( +/// label: 'Save', +/// onPressed: () {}, +/// ), +/// ), +/// ) +/// ``` class TUIMobileButtonBlock extends StatefulWidget { final TUIMobileButtonBlockStyle style; @@ -45,7 +46,7 @@ class _TUIMobileButtonBlockState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Row( - mainAxisAlignment: (widget.style == Style.one) + mainAxisAlignment: (widget.style.style == Style.one) ? MainAxisAlignment.center : MainAxisAlignment.start, children: wrapInExpanded(widget.style.getButtons(_width ?? 0)), diff --git a/lib/components/mobile_overlay_header/mobile_overlay_header.dart b/lib/components/mobile_overlay_header/mobile_overlay_header.dart index 0d1b43a..6b69244 100644 --- a/lib/components/mobile_overlay_header/mobile_overlay_header.dart +++ b/lib/components/mobile_overlay_header/mobile_overlay_header.dart @@ -5,18 +5,19 @@ import 'package:tarka_ui/components/button/style.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIMobileOverlayHeader is a widget that is used to create a header for the mobile overlay. -/* -Example: -```dart -TUIMobileOverlayHeader( - style: TUIOverlayMobileStyle( - style: TUIOverlayMobileStyleType.left, - title: "Title", - action: () { - print("Action"); - }, - ), - */ +/// +/// Example: +/// ```dart +/// TUIMobileOverlayHeader( +/// style: TUIOverlayMobileStyle( +/// style: TUIOverlayMobileStyleType.left, +/// title: "Title", +/// action: () { +/// print("Action"); +/// }, +/// ), +/// ) +/// ``` class TUIMobileOverlayHeader extends StatelessWidget { final TUIOverlayMobileStyle style; const TUIMobileOverlayHeader({super.key, required this.style}); diff --git a/lib/components/navigation_row/navigation_row.dart b/lib/components/navigation_row/navigation_row.dart index 772a4d8..834a7aa 100644 --- a/lib/components/navigation_row/navigation_row.dart +++ b/lib/components/navigation_row/navigation_row.dart @@ -2,19 +2,20 @@ import 'package:flutter/cupertino.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUINavigationRow widget to display a navigation row with title, icon and accessory view. -/* -Example: -```dart -TUINavigationRow( - title: "Navigation Row", - icon: CupertinoIcons.person, - accessoryView: CupertinoButton( - child: Text("Button"), - onPressed: () { - print("Button tapped"); - }, - ), - */ +/// +/// Example: +/// ```dart +/// TUINavigationRow( +/// title: "Navigation Row", +/// icon: CupertinoIcons.person, +/// accessoryView: CupertinoButton( +/// child: Text("Button"), +/// onPressed: () { +/// print("Button tapped"); +/// }, +/// ), +/// ) +/// ``` class TUINavigationRow extends StatelessWidget { final String title; final IconData? icon; diff --git a/lib/components/radio_button/radio_button.dart b/lib/components/radio_button/radio_button.dart index fda2d27..a77ddc0 100644 --- a/lib/components/radio_button/radio_button.dart +++ b/lib/components/radio_button/radio_button.dart @@ -2,17 +2,16 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIRadioButton is a button that can be selected or deselected, and is used to indicate a choice. -/* - Example: - ```dart - TUIRadioButton( - onPressed: () { - print('Button pressed'); - }, - isSelected: true, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUIRadioButton( +/// onPressed: () { +/// print('Button pressed'); +/// }, +/// isSelected: true, +/// ), +/// ``` class TUIRadioButton extends StatefulWidget { const TUIRadioButton({ super.key, diff --git a/lib/components/search_bar/search_bar.dart b/lib/components/search_bar/search_bar.dart index c89f976..e33c804 100644 --- a/lib/components/search_bar/search_bar.dart +++ b/lib/components/search_bar/search_bar.dart @@ -3,24 +3,25 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUISearchBar widget that can be used to search for items in a list. -/* -Example: -```dart -TUISearchBar( - showBackIcon: true, - showTrailingIcon: true, - placeholder: "Search", - onBackAction: () { - print("Back button pressed"); - }, - onTrailingButtonAction: () { - print("Trailing button pressed"); - }, - onChanged: (value) { - print("Search value: $value"); - }, - autofocus: true, - */ +/// +/// Example: +/// ```dart +/// TUISearchBar( +/// showBackIcon: true, +/// showTrailingIcon: true, +/// placeholder: "Search", +/// onBackAction: () { +/// print("Back button pressed"); +/// }, +/// onTrailingButtonAction: () { +/// print("Trailing button pressed"); +/// }, +/// onChanged: (value) { +/// print("Search value: $value"); +/// }, +/// autofocus: true, +/// ) +/// ``` class TUISearchBar extends StatefulWidget { final bool showBackIcon; final bool showTrailingIcon; diff --git a/lib/components/selection_card/selection_card.dart b/lib/components/selection_card/selection_card.dart index f5cd7d5..2226962 100644 --- a/lib/components/selection_card/selection_card.dart +++ b/lib/components/selection_card/selection_card.dart @@ -3,25 +3,26 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUISelectionCardStyle widget can be used to display a selection of items. -/* -Example: -```dart -TUISelectionCard( - style: TUISelectionCardStyle( - title: "Title", - description: ["Description 1", "Description 2"], - footer: "Footer", - ), - isSelected: true, - showChevron: true, - icon: FluentIcons.guest_24_regular, - badgeCount: 1, - badgeColor: Colors.red, - isHovered: true, - action: () { - print("Card clicked"); - }, - */ +/// +/// Example: +/// ```dart +/// TUISelectionCard( +/// style: TUISelectionCardStyle( +/// title: "Title", +/// description: ["Description 1", "Description 2"], +/// footer: "Footer", +/// ), +/// isSelected: true, +/// showChevron: true, +/// icon: FluentIcons.guest_24_regular, +/// badgeCount: 1, +/// badgeColor: Colors.red, +/// isHovered: true, +/// action: () { +/// print("Card clicked"); +/// }, +/// ) +/// ``` class TUISelectionCardStyle { final String title; final List? description; diff --git a/lib/components/slider/slider.dart b/lib/components/slider/slider.dart index b5d13cc..05c3194 100644 --- a/lib/components/slider/slider.dart +++ b/lib/components/slider/slider.dart @@ -1,21 +1,21 @@ import 'package:flutter/material.dart'; /// TUISlider widget for selecting a value from a range of values. -/* - Example: - ```dart - TUISlider( - value: _value, - min: 0.0, - max: 100.0, - onChanged: (double newValue) { - setState(() { - _value = newValue; - }); - }, - ) - ``` - */ +/// +/// Example: +/// ```dart +/// TUISlider( +/// value: _value, +/// min: 0.0, +/// max: 100.0, +/// onChanged: (double newValue) { +/// setState(() { +/// _value = newValue; +/// }); +/// }, +/// ) +/// ``` + class TUISlider extends StatelessWidget { final double value; final ValueChanged? onChanged; diff --git a/lib/components/snack_bar/snack_bar.dart b/lib/components/snack_bar/snack_bar.dart index 4040092..5de4cbb 100644 --- a/lib/components/snack_bar/snack_bar.dart +++ b/lib/components/snack_bar/snack_bar.dart @@ -64,22 +64,23 @@ class TUISnackBarAction { } /// TUISnackBar widget is a lightweight message with an optional action which briefly displays at the bottom of the screen. -/* -Example: -```dart -TUISnackBar( - context: context, - type: TUISnackBarType.success, - message: 'This is a success message', - action: TUISnackBarAction( - label: 'Dismiss', - onActionPressed: () { - ScaffoldMessenger.of(context).hideCurrentSnackBar( - reason: SnackBarClosedReason.dismiss, - ); - }, - ), - */ +/// +/// Example: +/// ```dart +/// TUISnackBar( +/// context: context, +/// type: TUISnackBarType.success, +/// message: 'This is a success message', +/// action: TUISnackBarAction( +/// label: 'Dismiss', +/// onActionPressed: () { +/// ScaffoldMessenger.of(context).hideCurrentSnackBar( +/// reason: SnackBarClosedReason.dismiss, +/// ); +/// }, +/// ), +/// ); +/// ``` class TUISnackBar extends SnackBar { TUISnackBar({ super.key, diff --git a/lib/components/success_check_mark/success_check_mark.dart b/lib/components/success_check_mark/success_check_mark.dart index 0a7345b..4833535 100644 --- a/lib/components/success_check_mark/success_check_mark.dart +++ b/lib/components/success_check_mark/success_check_mark.dart @@ -3,12 +3,11 @@ import 'package:tarka_ui/styles/symbols.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUISuccessCheckMark is used to create a success check mark. -/* - Example: - ```dart - TUISuccessCheckMark() - ``` - */ +/// +/// Example: +/// ```dart +/// TUISuccessCheckMark() +/// ``` class TUISuccessCheckMark extends StatelessWidget { const TUISuccessCheckMark({super.key}); diff --git a/lib/components/tag/tag.dart b/lib/components/tag/tag.dart index 0c9b60d..b6cb058 100644 --- a/lib/components/tag/tag.dart +++ b/lib/components/tag/tag.dart @@ -3,17 +3,16 @@ import 'package:tarka_ui/styles/default_colors.dart'; import 'package:tarka_ui/styles/text_style.dart'; /// TUITag is used to create a tag with contrast, icon type, size and text content. -/* - Example: - ```dart - TUITag( - tagContrast: TUITagContrast.low, - tagIconType: TUITagIconType.left, - tagSize: TUITagSize.s, - tagText: 'Tag', - ) - ``` - */ +/// +/// Example: +/// ```dart +/// TUITag( +/// tagContrast: TUITagContrast.low, +/// tagIconType: TUITagIconType.left, +/// tagSize: TUITagSize.s, +/// tagText: 'Tag', +/// ) +/// ``` class TUITag extends StatelessWidget { final TUITagContrast tagContrast; final TUITagIconType tagIconType; diff --git a/lib/components/textfield/text_field.dart b/lib/components/textfield/text_field.dart index 855b1de..577bda7 100644 --- a/lib/components/textfield/text_field.dart +++ b/lib/components/textfield/text_field.dart @@ -3,26 +3,25 @@ import 'package:tarka_ui/styles/default_colors.dart'; import 'package:tarka_ui/styles/text_style.dart'; /// TUIInputField is a text input field that allows users to enter text. -/* - Example: - ```dart - TUIInputField( - hintText: 'Hint Text', - labelText: 'Label', - prefixText: 'Prefix', - suffixText: 'Suffix', - prefixIcon: Icons.add, - suffixIcon: Icons.remove, - obscureText: true, - controller: TextEditingController(), - keyboardType: TextInputType.text, - textInputAction: TextInputAction.done, - onChanged: (value) {}, - onEditingComplete: () {}, - onSubmitted: (value) {}, - ) - ``` - */ +/// +/// Example: +/// ```dart +/// TUIInputField( +/// hintText: 'Hint Text', +/// labelText: 'Label', +/// prefixText: 'Prefix', +/// suffixText: 'Suffix', +/// prefixIcon: Icons.add, +/// suffixIcon: Icons.remove, +/// obscureText: true, +/// controller: TextEditingController(), +/// keyboardType: TextInputType.text, +/// textInputAction: TextInputAction.done, +/// onChanged: (value) {}, +/// onEditingComplete: () {}, +/// onSubmitted: (value) {}, +/// ) +/// ``` class TUIInputField extends StatelessWidget { final bool enabled; final bool readOnly; diff --git a/lib/components/toggle_row/toggle_row.dart b/lib/components/toggle_row/toggle_row.dart index 26cf668..104d24f 100644 --- a/lib/components/toggle_row/toggle_row.dart +++ b/lib/components/toggle_row/toggle_row.dart @@ -3,20 +3,19 @@ import 'package:tarka_ui/styles/theme.dart'; import 'package:tarka_ui/tarka_ui.dart'; /// TUIToggleRow widget row with a title, description and a toggle switch. -/* - Example: - ```dart - TUIToggleRow( - title: 'Title', - description: 'Description', - icon: Icon(Icons.ac_unit), - value: true, - onChanged: (value) { - print(value); - }, - ), - ``` - */ +/// +/// Example: +/// ```dart +/// TUIToggleRow( +/// title: 'Title', +/// description: 'Description', +/// icon: Icon(Icons.ac_unit), +/// value: true, +/// onChanged: (value) { +/// print(value); +/// }, +/// ), +/// ``` class TUIToggleRow extends StatefulWidget { final String title; final String description; diff --git a/lib/components/toggle_switch/toggle_switch.dart b/lib/components/toggle_switch/toggle_switch.dart index 6cdeb19..94e73c1 100644 --- a/lib/components/toggle_switch/toggle_switch.dart +++ b/lib/components/toggle_switch/toggle_switch.dart @@ -3,17 +3,18 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; /// TUIToggleSwitch that can be used to toggle between two states. -/* -```dart -Example: -TUIToggleSwitch( - value: _value, - onChanged: (value) { - setState(() { - _value = value; - }); - }, - */ +/// +/// ```dart +/// Example: +/// TUIToggleSwitch( +/// value: _value, +/// onChanged: (value) { +/// setState(() { +/// _value = value; +/// }); +/// }, +/// ) +/// ``` class TUIToggleSwitch extends StatefulWidget { final bool value; final ValueChanged? onChanged; diff --git a/lib/styles/colors.dart b/lib/styles/colors.dart index a3c2b93..7916009 100644 --- a/lib/styles/colors.dart +++ b/lib/styles/colors.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; +/// TUIColors is a class that holds all the colors used in the Tarka UI. class TUIColors with Diagnosticable { final Color primary; final Color onPrimary; diff --git a/lib/styles/default_colors.dart b/lib/styles/default_colors.dart index 8c0252e..95fb9c8 100644 --- a/lib/styles/default_colors.dart +++ b/lib/styles/default_colors.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +/// TUIDefaultColors is a class that holds all the default colors used in the Tarka UI. class TUIDefaultColors { TUIDefaultColors._(); // Base diff --git a/lib/styles/spacing.dart b/lib/styles/spacing.dart index 42a4e21..500d65f 100644 --- a/lib/styles/spacing.dart +++ b/lib/styles/spacing.dart @@ -1,3 +1,4 @@ +/// TUISpacing class to define the spacing values used in the app. class TUISpacing { TUISpacing._(); diff --git a/lib/styles/symbols.dart b/lib/styles/symbols.dart index eabaf5d..0d2d396 100644 --- a/lib/styles/symbols.dart +++ b/lib/styles/symbols.dart @@ -1,6 +1,7 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; +/// TUISymbol is a class that holds all the symbols used in the Tarka UI. class TUISymbol { TUISymbol._(); diff --git a/lib/styles/text_style.dart b/lib/styles/text_style.dart index 770e8ac..ad54a09 100644 --- a/lib/styles/text_style.dart +++ b/lib/styles/text_style.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/default_colors.dart'; +/// TUITextStyle is a class that holds all the text styles used in the Tarka UI. class TUITextStyle { TUITextStyle._(); diff --git a/lib/styles/theme.dart b/lib/styles/theme.dart index cde867d..fd661cd 100644 --- a/lib/styles/theme.dart +++ b/lib/styles/theme.dart @@ -5,6 +5,7 @@ import 'package:tarka_ui/components/floating_action_button/floating_action_butto import 'package:tarka_ui/styles/colors.dart'; import 'package:tarka_ui/styles/typography.dart'; +/// TUITheme that configures the color and typography values for a Tarka UI app. class TUITheme extends StatelessWidget { /// Applies the given theme [data] to [child]. /// diff --git a/lib/styles/typography.dart b/lib/styles/typography.dart index 61032e9..0dd99fc 100644 --- a/lib/styles/typography.dart +++ b/lib/styles/typography.dart @@ -1,6 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/painting.dart'; +/// TUITypography is a class that holds all the text styles used in the Tarka UI. class TUITypography with Diagnosticable { final TextStyle heading1; final TextStyle heading2; diff --git a/lib/subcomponents/image.dart b/lib/subcomponents/image.dart index dc4a1ad..a53c984 100644 --- a/lib/subcomponents/image.dart +++ b/lib/subcomponents/image.dart @@ -1,17 +1,16 @@ import 'package:flutter/material.dart'; /// TUIImage is used as an abstraction to handle asset and network image. -/* - Example: - ```dart - TUIImage( - imageUrl: 'https://example.com/image.png', - width: 100, - height: 100, - fit: BoxFit.cover, - ) - ``` - */ +/// +/// Example: +/// ```dart +/// TUIImage( +/// imageUrl: 'https://example.com/image.png', +/// width: 100, +/// height: 100, +/// fit: BoxFit.cover, +/// ) +/// ``` class TUIImage extends StatelessWidget { final String? _imageUrl; final String? _assetPath; diff --git a/lib/tarka_ui.dart b/lib/tarka_ui.dart index dc344ec..d889257 100644 --- a/lib/tarka_ui.dart +++ b/lib/tarka_ui.dart @@ -1,5 +1,6 @@ library tarka_ui; +/// Tarka UI is a collection of widgets and styles that can be used to build a Flutter mobile application. export 'package:flutter/material.dart' show Brightness, diff --git a/lib/tui_app.dart b/lib/tui_app.dart index 0c57459..dd39cff 100644 --- a/lib/tui_app.dart +++ b/lib/tui_app.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:tarka_ui/styles/theme.dart'; +/// TUIApp is a wrapper around [WidgetsApp] and [MaterialApp] class TUIApp extends StatefulWidget { /// Creates a TUIApp. /// diff --git a/pubspec.yaml b/pubspec.yaml index 6c791aa..9bb69c3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,7 @@ name: tarka_ui -description: Flutter package for Tarka Kit Design System -version: 1.1.1 +description: Tarka UI is build on our design system with a set of pre-built UI components that can easily be integrated into Flutter mobile application. +version: 1.1.1+1 +issue_tracker: https://github.com/tarkalabs/tarka-ui-kit-flutter/issues homepage: https://github.com/tarkalabs/tarka-ui-kit-flutter.git environment: @@ -20,13 +21,16 @@ dev_dependencies: flutter_lints: ^3.0.1 golden_toolkit: ^0.15.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec +topics: + - design system + - ui kit + +# This package supports all platforms listed below. +platforms: + android: + ios: -# The following section is specific to Flutter packages. flutter: - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages fonts: - family: Inter fonts: