From 2fdf680fe1eae13a3245556434c7179b8a38931b Mon Sep 17 00:00:00 2001 From: rajivmanivannan Date: Sun, 11 Feb 2024 13:17:43 +0530 Subject: [PATCH] Refactored and fixed warnings --- .pubignore | 5 ++- CHANGELOG.md | 2 +- example/pubspec.lock | 14 ++++----- lib/components/accordion/accordion.dart | 4 +-- lib/components/anchor/anchor.dart | 4 +-- lib/components/app_bar/app_bar.dart | 1 - .../attachment_upload/attachment_upload.dart | 29 ++++++++--------- lib/components/avatar/avatar.dart | 3 +- lib/components/breadcrumb/breadcrumb.dart | 4 +-- lib/components/button/button.dart | 5 ++- lib/components/checkbox/checkbox.dart | 8 ++--- lib/components/checkbox_row/checkbox_row.dart | 9 +++--- lib/components/chip/chip.dart | 4 --- .../draggable_card/draggable_card.dart | 6 ++-- lib/components/email_field/email_field.dart | 9 +++--- .../email_subject_field.dart | 8 ++--- .../floating_action_button.dart | 4 +-- .../media_thumbnail/media_thumbnail.dart | 4 +-- lib/components/menu_item/menu_item.dart | 7 +++-- .../mobile_button_block.dart | 6 ++-- .../mobile_overlay_header.dart | 6 ++-- .../navigation_row/navigation_row.dart | 7 ++--- lib/components/radio_button/radio_button.dart | 7 ++--- .../selection_card/selection_card.dart | 10 +++--- lib/components/snack_bar/snack_bar.dart | 6 ++-- .../success_check_mark.dart | 5 ++- lib/components/textfield/style.dart | 0 lib/components/toggle_row/toggle_row.dart | 6 ++-- .../toggle_switch/toggle_switch.dart | 11 +++---- pubspec.lock | 12 +++---- pubspec.yaml | 31 +++---------------- 31 files changed, 100 insertions(+), 137 deletions(-) delete mode 100644 lib/components/textfield/style.dart diff --git a/.pubignore b/.pubignore index 69f0328..9354cfd 100644 --- a/.pubignore +++ b/.pubignore @@ -2,4 +2,7 @@ bin/ .github/ example/.fvm/ example/build/ -example/.dart_tool/ \ No newline at end of file +example/.dart_tool/ +/test/widget/failures +/test/golden_test/failures +/.ssh/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 75cf9c5..e444b95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -## 0.0.1 - 2023-05-10 +## 1.0.0 - 2024-02-13 * TODO: diff --git a/example/pubspec.lock b/example/pubspec.lock index 33d3ef7..fbdbdeb 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" fake_async: dependency: transitive description: @@ -61,10 +61,10 @@ packages: dependency: "direct main" description: name: fluentui_system_icons - sha256: "8f7a374e71618c101d631bdfded01f0764c882634534e1966046fd7278fec4d0" + sha256: abe7c343e2151e0ad6544653e0b6601686b993bc436ccde72b88cea677db0c0a url: "https://pub.dev" source: hosted - version: "1.1.205" + version: "1.1.226" flutter: dependency: "direct main" description: flutter @@ -74,10 +74,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" flutter_localizations: dependency: transitive description: flutter @@ -179,7 +179,7 @@ packages: path: ".." relative: true source: path - version: "0.0.1" + version: "1.0.0" term_glyph: dependency: transitive description: diff --git a/lib/components/accordion/accordion.dart b/lib/components/accordion/accordion.dart index 82787f7..d57dd5f 100644 --- a/lib/components/accordion/accordion.dart +++ b/lib/components/accordion/accordion.dart @@ -8,10 +8,10 @@ class TUIAccordion extends StatefulWidget { final String subtitle; const TUIAccordion({ - Key? key, + super.key, required this.title, required this.subtitle, - }) : super(key: key); + }); @override State createState() => _TUIAccordionState(); diff --git a/lib/components/anchor/anchor.dart b/lib/components/anchor/anchor.dart index d6038c3..a1a50df 100644 --- a/lib/components/anchor/anchor.dart +++ b/lib/components/anchor/anchor.dart @@ -3,10 +3,10 @@ import 'package:tarka_ui/styles/theme.dart'; class TUIAnchor extends StatefulWidget { const TUIAnchor({ - Key? key, + super.key, required this.title, this.onPressed, - }) : super(key: key); + }); final VoidCallback? onPressed; final String title; diff --git a/lib/components/app_bar/app_bar.dart b/lib/components/app_bar/app_bar.dart index 6417901..6b164f4 100644 --- a/lib/components/app_bar/app_bar.dart +++ b/lib/components/app_bar/app_bar.dart @@ -4,7 +4,6 @@ import 'package:tarka_ui/styles/theme.dart'; class TUIAppTopBar extends StatefulWidget { final List items; final List _bnbItems; - final ValueChanged? onTap; final int currentIndex; final bool showLabels; diff --git a/lib/components/attachment_upload/attachment_upload.dart b/lib/components/attachment_upload/attachment_upload.dart index 9a89096..a474ccf 100644 --- a/lib/components/attachment_upload/attachment_upload.dart +++ b/lib/components/attachment_upload/attachment_upload.dart @@ -1,8 +1,7 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; - -import '../../styles/theme.dart'; -import '../../subcomponents/image.dart'; +import 'package:tarka_ui/styles/theme.dart'; +import 'package:tarka_ui/subcomponents/image.dart'; class TUIAttachmentUpload extends StatelessWidget { final String title; @@ -17,7 +16,7 @@ class TUIAttachmentUpload extends StatelessWidget { late Function()? downloadTapped; TUIAttachmentUpload({ - Key? key, + super.key, required this.title, required this.isIconUsed, this.icon, @@ -25,7 +24,7 @@ class TUIAttachmentUpload extends StatelessWidget { this.description = "", this.downloadTapped, this.deleteTapped, - }) : super(key: key) { + }) { if (isIconUsed == true) { image = null; } else { @@ -75,16 +74,14 @@ class TUIAttachmentUpload extends StatelessWidget { } return Expanded( - child: Container( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: SizedBox( - height: 60, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: titleAndDescription, - ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: titleAndDescription, ), ), ), @@ -160,7 +157,7 @@ class TUIAttachmentUpload extends StatelessWidget { child: Icon(icon), ); } else { - return Placeholder(); + return const Placeholder(); } } } diff --git a/lib/components/avatar/avatar.dart b/lib/components/avatar/avatar.dart index a5ceb7e..bba0bd5 100644 --- a/lib/components/avatar/avatar.dart +++ b/lib/components/avatar/avatar.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/default_colors.dart'; import 'package:tarka_ui/styles/text_style.dart'; - -import '../../subcomponents/image.dart'; +import 'package:tarka_ui/subcomponents/image.dart'; /// TUIAvatar is used to create a Avatar with content, size and badge flag. /* diff --git a/lib/components/breadcrumb/breadcrumb.dart b/lib/components/breadcrumb/breadcrumb.dart index 475cc9e..f1d0377 100644 --- a/lib/components/breadcrumb/breadcrumb.dart +++ b/lib/components/breadcrumb/breadcrumb.dart @@ -7,10 +7,10 @@ class TUIBreadCrumb extends StatelessWidget { final List titles; const TUIBreadCrumb({ - Key? key, + super.key, required this.titles, required this.onTap, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/components/button/button.dart b/lib/components/button/button.dart index 413b3a0..2d23f66 100644 --- a/lib/components/button/button.dart +++ b/lib/components/button/button.dart @@ -16,7 +16,7 @@ import 'package:tarka_ui/styles/theme.dart'; */ class TUIButton extends StatelessWidget { const TUIButton({ - Key? key, + super.key, required this.type, this.size = TUIButtonSize.m, this.label, @@ -25,8 +25,7 @@ class TUIButton extends StatelessWidget { required this.onPressed, this.onLongPress, this.height, - }) : assert(label != null || iconData != null), - super(key: key); + }) : assert(label != null || iconData != null); final TUIButtonType type; final TUIButtonSize size; diff --git a/lib/components/checkbox/checkbox.dart b/lib/components/checkbox/checkbox.dart index da65663..4ec94a4 100644 --- a/lib/components/checkbox/checkbox.dart +++ b/lib/components/checkbox/checkbox.dart @@ -1,15 +1,14 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUICheckBox extends StatefulWidget { TUICheckBox({ - Key? key, + super.key, this.enableMixedState = false, this.state = TUICheckBoxState.unchecked, this.onChanged, - }) : super(key: key) { + }) { if (state == TUICheckBoxState.mixed) { enableMixedState = true; } @@ -132,6 +131,7 @@ enum TUICheckBoxState { checked(2); const TUICheckBoxState(this.value); + final num value; static TUICheckBoxState getByValue(num i) { diff --git a/lib/components/checkbox_row/checkbox_row.dart b/lib/components/checkbox_row/checkbox_row.dart index 52df28a..8e58a92 100644 --- a/lib/components/checkbox_row/checkbox_row.dart +++ b/lib/components/checkbox_row/checkbox_row.dart @@ -1,8 +1,6 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; -import 'package:tarka_ui/styles/default_colors.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUICheckBoxRow extends StatefulWidget { final String title; @@ -10,14 +8,14 @@ class TUICheckBoxRow extends StatefulWidget { final bool backgroundDark; TUICheckBoxRow({ - Key? key, + super.key, this.enableMixedState = false, this.state = TUICheckBoxRowState.unchecked, required this.title, this.description = "", this.onChanged, this.backgroundDark = false, - }) : super(key: key) { + }) { if (state == TUICheckBoxRowState.mixed) { enableMixedState = true; } @@ -197,6 +195,7 @@ enum TUICheckBoxRowState { checked(2); const TUICheckBoxRowState(this.value); + final num value; static TUICheckBoxRowState getByValue(num i) { diff --git a/lib/components/chip/chip.dart b/lib/components/chip/chip.dart index fa90d30..664902d 100644 --- a/lib/components/chip/chip.dart +++ b/lib/components/chip/chip.dart @@ -206,16 +206,12 @@ enum TUIChipSize { required double badgeSize, required TextStyle badgeTextStyle}) : _height = height, - _textStyle = textStyle, _rightIconSize = rightIconSize, _rightIconPadding = rightIconPadding, - _badgeSize = badgeSize, _badgeTextStyle = badgeTextStyle; final double _height; - final TextStyle _textStyle; final double _rightIconSize; final double _rightIconPadding; - final double _badgeSize; final TextStyle _badgeTextStyle; } diff --git a/lib/components/draggable_card/draggable_card.dart b/lib/components/draggable_card/draggable_card.dart index 9c456af..5a353f4 100644 --- a/lib/components/draggable_card/draggable_card.dart +++ b/lib/components/draggable_card/draggable_card.dart @@ -1,16 +1,16 @@ import 'package:flutter/material.dart'; -import '../../styles/theme.dart'; import 'package:fluentui_system_icons/fluentui_system_icons.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUIDraggableCard extends StatelessWidget { final Widget child; final bool backgroundDark; const TUIDraggableCard({ - Key? key, + super.key, required this.child, this.backgroundDark = false, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/components/email_field/email_field.dart b/lib/components/email_field/email_field.dart index b69a7e5..7b36825 100644 --- a/lib/components/email_field/email_field.dart +++ b/lib/components/email_field/email_field.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; +import 'package:tarka_ui/styles/text_style.dart'; import 'package:tarka_ui/styles/theme.dart'; import 'package:fluentui_system_icons/fluentui_system_icons.dart'; -import '../../styles/text_style.dart'; class TUIEmailField extends StatefulWidget { late final TUIEmailFieldLabel label; @@ -13,13 +12,13 @@ class TUIEmailField extends StatefulWidget { final VoidCallback? onRemove; TUIEmailField({ - Key? key, + super.key, this.label = TUIEmailFieldLabel.to, required this.emails, this.showSuffix = false, this.onAdd, this.onRemove, - }) : super(key: key); + }); @override State createState() => _TUIEmailFieldState(); @@ -147,7 +146,7 @@ class _TUIEmailFieldState extends State { ) { int idx = _emails.indexOf(email); return getChip(email, theme, idx); - }).toList(), + }), ], ), TextField( diff --git a/lib/components/email_subject_field/email_subject_field.dart b/lib/components/email_subject_field/email_subject_field.dart index 25c7e23..52fd964 100644 --- a/lib/components/email_subject_field/email_subject_field.dart +++ b/lib/components/email_subject_field/email_subject_field.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUIEmailSubjectField extends StatefulWidget { final Function(String) onTextChanged; + const TUIEmailSubjectField({super.key, required this.onTextChanged}); @override @@ -11,8 +11,8 @@ class TUIEmailSubjectField extends StatefulWidget { } class _TUIEmailSubjectFieldState extends State { - TextEditingController _controller = TextEditingController(); - FocusNode _focusNode = FocusNode(); + final TextEditingController _controller = TextEditingController(); + final FocusNode _focusNode = FocusNode(); bool _isEditing = false; String enteredText = ""; diff --git a/lib/components/floating_action_button/floating_action_button.dart b/lib/components/floating_action_button/floating_action_button.dart index 92dce7d..755ce8d 100644 --- a/lib/components/floating_action_button/floating_action_button.dart +++ b/lib/components/floating_action_button/floating_action_button.dart @@ -14,11 +14,11 @@ enum TUIFloatingActionButtonSize { class TUIFloatingActionButton extends StatefulWidget { const TUIFloatingActionButton({ - Key? key, + super.key, this.size = TUIFloatingActionButtonSize.regular, required this.iconData, this.onPressed, - }) : super(key: key); + }); final TUIFloatingActionButtonSize size; final IconData iconData; diff --git a/lib/components/media_thumbnail/media_thumbnail.dart b/lib/components/media_thumbnail/media_thumbnail.dart index 0f19e85..768b242 100644 --- a/lib/components/media_thumbnail/media_thumbnail.dart +++ b/lib/components/media_thumbnail/media_thumbnail.dart @@ -11,13 +11,13 @@ class TUIMediaThumbnail extends StatelessWidget { final TUIImage? customThumbnailImage; const TUIMediaThumbnail({ - Key? key, + super.key, this.onPressed, this.isSelectable = true, required this.size, required this.mediaType, this.customThumbnailImage, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/components/menu_item/menu_item.dart b/lib/components/menu_item/menu_item.dart index c2a133a..fca4283 100644 --- a/lib/components/menu_item/menu_item.dart +++ b/lib/components/menu_item/menu_item.dart @@ -22,13 +22,13 @@ class TUIMenuItem extends StatefulWidget { final Function(TUIMenuItemState)? onRightTap; TUIMenuItem({ - Key? key, + super.key, required this.item, this.backgroundDark = false, this.onLeftTap, this.onRightTap, this.action, - }) : super(key: key); + }); @override State createState() => _TUIMenuItemState(); @@ -329,6 +329,7 @@ enum TUIMenuItemStyle { both(3); const TUIMenuItemStyle(this.value); + final num value; static TUIMenuItemStyle getByValue(num i) { @@ -343,6 +344,7 @@ enum TUIMenuItemState { bothChecked(3); const TUIMenuItemState(this.value); + final num value; static TUIMenuItemState getByValue(num i) { @@ -356,6 +358,7 @@ enum TUIMenuItemTapped { none(3); const TUIMenuItemTapped(this.value); + final num value; static TUIMenuItemTapped getByValue(num i) { diff --git a/lib/components/mobile_button_block/mobile_button_block.dart b/lib/components/mobile_button_block/mobile_button_block.dart index 67730fa..8d11ed3 100644 --- a/lib/components/mobile_button_block/mobile_button_block.dart +++ b/lib/components/mobile_button_block/mobile_button_block.dart @@ -5,9 +5,9 @@ class TUIMobileButtonBlock extends StatefulWidget { final TUIMobileButtonBlockStyle style; TUIMobileButtonBlock({ - Key? key, + super.key, required this.style, - }) : super(key: key) {} + }) {} @override State createState() => _TUIMobileButtonBlockState(); @@ -22,7 +22,7 @@ class _TUIMobileButtonBlockState extends State { builder: (BuildContext context, BoxConstraints constraints) { _width = constraints.maxWidth; - return Container( + return SizedBox( width: _width ?? 0, child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/components/mobile_overlay_header/mobile_overlay_header.dart b/lib/components/mobile_overlay_header/mobile_overlay_header.dart index 9177127..1143832 100644 --- a/lib/components/mobile_overlay_header/mobile_overlay_header.dart +++ b/lib/components/mobile_overlay_header/mobile_overlay_header.dart @@ -1,12 +1,12 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; import 'package:tarka_ui/components/button/icon_button.dart'; - -import '../../styles/theme.dart'; -import '../button/style.dart'; +import 'package:tarka_ui/components/button/style.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUIMobileOverlayHeader extends StatelessWidget { final TUIOverlayMobileStyle style; + const TUIMobileOverlayHeader({super.key, required this.style}); @override diff --git a/lib/components/navigation_row/navigation_row.dart b/lib/components/navigation_row/navigation_row.dart index 4974bf4..6356bb3 100644 --- a/lib/components/navigation_row/navigation_row.dart +++ b/lib/components/navigation_row/navigation_row.dart @@ -1,6 +1,5 @@ import 'package:flutter/cupertino.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUINavigationRow extends StatelessWidget { final String title; @@ -9,11 +8,11 @@ class TUINavigationRow extends StatelessWidget { late double? _height; TUINavigationRow({ - Key? key, + super.key, required this.title, this.icon, this.accessoryView, - }) : super(key: key) {} + }); @override Widget build(BuildContext context) { diff --git a/lib/components/radio_button/radio_button.dart b/lib/components/radio_button/radio_button.dart index ca30934..99523b6 100644 --- a/lib/components/radio_button/radio_button.dart +++ b/lib/components/radio_button/radio_button.dart @@ -1,13 +1,12 @@ import 'package:flutter/material.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUIRadioButton extends StatefulWidget { const TUIRadioButton({ - Key? key, + super.key, this.onPressed, this.isSelected = false, - }) : super(key: key); + }); final VoidCallback? onPressed; final bool isSelected; diff --git a/lib/components/selection_card/selection_card.dart b/lib/components/selection_card/selection_card.dart index 6f70370..cfd2cfb 100644 --- a/lib/components/selection_card/selection_card.dart +++ b/lib/components/selection_card/selection_card.dart @@ -1,8 +1,6 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:tarka_ui/components/badge/badge.dart'; -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUISelectionCardStyle { final String title; @@ -26,8 +24,8 @@ class TUISelectionCard extends StatelessWidget { final bool isHovered; final Function? action; - TUISelectionCard({ - Key? key, + const TUISelectionCard({ + super.key, required this.style, this.isSelected = false, this.showChevron = false, @@ -36,7 +34,7 @@ class TUISelectionCard extends StatelessWidget { this.badgeColor, this.isHovered = false, this.action, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/components/snack_bar/snack_bar.dart b/lib/components/snack_bar/snack_bar.dart index 4d4bd0d..b9124d5 100644 --- a/lib/components/snack_bar/snack_bar.dart +++ b/lib/components/snack_bar/snack_bar.dart @@ -65,22 +65,20 @@ class TUISnackBarAction { class TUISnackBar extends SnackBar { TUISnackBar({ - Key? key, + super.key, required BuildContext context, TUISnackBarType type = TUISnackBarType.information, required String message, TUISnackBarAction? action, Duration? duration, - VoidCallback? onVisible, + super.onVisible, }) : super( - key: key, elevation: 0, duration: duration ?? const Duration(seconds: 4), backgroundColor: type._getBackgroundColor(TUITheme.of(context).colors), behavior: SnackBarBehavior.floating, content: _getWidget(context, type, message, action), - onVisible: onVisible, shape: const StadiumBorder()); static Widget _getWidget(BuildContext context, TUISnackBarType type, diff --git a/lib/components/success_check_mark/success_check_mark.dart b/lib/components/success_check_mark/success_check_mark.dart index b764446..e8e5e7c 100644 --- a/lib/components/success_check_mark/success_check_mark.dart +++ b/lib/components/success_check_mark/success_check_mark.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/symbols.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; /// TUISuccessCheckMark is used to create a success check mark. /* @@ -11,7 +10,7 @@ import '../../styles/theme.dart'; ``` */ class TUISuccessCheckMark extends StatelessWidget { - const TUISuccessCheckMark({Key? key}) : super(key: key); + const TUISuccessCheckMark({super.key}); static const double size = 16; diff --git a/lib/components/textfield/style.dart b/lib/components/textfield/style.dart deleted file mode 100644 index e69de29..0000000 diff --git a/lib/components/toggle_row/toggle_row.dart b/lib/components/toggle_row/toggle_row.dart index dcb4f9d..3993cea 100644 --- a/lib/components/toggle_row/toggle_row.dart +++ b/lib/components/toggle_row/toggle_row.dart @@ -10,15 +10,15 @@ class TUIToggleRow extends StatefulWidget { final ValueChanged? onChanged; final bool backgroundDark; - TUIToggleRow({ - Key? key, + const TUIToggleRow({ + super.key, required this.title, this.description = "", this.icon, required this.value, this.onChanged, this.backgroundDark = false, - }) : super(key: key); + }); @override State createState() => _TUIToggleRowState(); diff --git a/lib/components/toggle_switch/toggle_switch.dart b/lib/components/toggle_switch/toggle_switch.dart index e6420a9..23c63d5 100644 --- a/lib/components/toggle_switch/toggle_switch.dart +++ b/lib/components/toggle_switch/toggle_switch.dart @@ -1,20 +1,19 @@ import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; - -import '../../styles/theme.dart'; +import 'package:tarka_ui/styles/theme.dart'; class TUIToggleSwitch extends StatefulWidget { final bool value; final ValueChanged? onChanged; - TUIToggleSwitch({ - Key? key, + const TUIToggleSwitch({ + super.key, required this.value, this.onChanged, - }) : super(key: key); + }); @override - _TUIToggleSwitchState createState() => _TUIToggleSwitchState(); + State createState() => _TUIToggleSwitchState(); } class _TUIToggleSwitchState extends State diff --git a/pubspec.lock b/pubspec.lock index 382ab26..a4efc43 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: "direct main" description: name: fluentui_system_icons - sha256: "8f7a374e71618c101d631bdfded01f0764c882634534e1966046fd7278fec4d0" + sha256: abe7c343e2151e0ad6544653e0b6601686b993bc436ccde72b88cea677db0c0a url: "https://pub.dev" source: hosted - version: "1.1.205" + version: "1.1.226" flutter: dependency: "direct main" description: flutter @@ -66,10 +66,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -100,10 +100,10 @@ packages: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ce75e11..9a3c275 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,10 @@ name: tarka_ui description: Flutter package for Tarka Kit Design System -version: 0.0.1 +version: 1.0.0 homepage: https://github.com/tarkalabs/tarka-ui-kit-flutter.git environment: - sdk: '>=3.0.0 <4.0.0' + sdk: '>=3.0.0' flutter: ">=3.10.0" dependencies: @@ -12,12 +12,12 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter - fluentui_system_icons: ^1.1.202 + fluentui_system_icons: ^1.1.226 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.1 golden_toolkit: ^0.15.0 # For information on the generic Dart part of this file, see the @@ -25,29 +25,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # # For details regarding fonts in packages, see # https://flutter.dev/custom-fonts/#from-packages fonts: