From 3d0e146564834daaaead4514829252b6ba110a09 Mon Sep 17 00:00:00 2001 From: rajivmanivannan Date: Mon, 19 Feb 2024 16:45:05 +0530 Subject: [PATCH] wip --- lib/components/attachment_upload/attachment_upload.dart | 4 ++-- lib/components/checkbox/checkbox.dart | 8 ++++---- lib/components/checkbox_row/checkbox_row.dart | 4 ++-- lib/components/email_field/email_field.dart | 7 +++---- lib/components/menu_item/menu_item.dart | 4 ++-- lib/components/navigation_row/navigation_row.dart | 8 ++++---- lib/components/toggle_row/toggle_row.dart | 4 ++-- pubspec.yaml | 2 +- 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/components/attachment_upload/attachment_upload.dart b/lib/components/attachment_upload/attachment_upload.dart index 74cc488..823ce2f 100644 --- a/lib/components/attachment_upload/attachment_upload.dart +++ b/lib/components/attachment_upload/attachment_upload.dart @@ -6,8 +6,8 @@ import 'package:tarka_ui/subcomponents/image.dart'; class TUIAttachmentUpload extends StatelessWidget { final String title; final bool isIconUsed; - IconData? icon; - TUIImage? image; + late final IconData? icon; + late final TUIImage? image; final String description; final Function()? deleteTapped; final Function()? downloadTapped; diff --git a/lib/components/checkbox/checkbox.dart b/lib/components/checkbox/checkbox.dart index 4ec94a4..b369107 100644 --- a/lib/components/checkbox/checkbox.dart +++ b/lib/components/checkbox/checkbox.dart @@ -3,6 +3,10 @@ import 'package:flutter/material.dart'; import 'package:tarka_ui/styles/theme.dart'; class TUICheckBox extends StatefulWidget { + late bool enableMixedState; + final TUICheckBoxState state; + final Function(TUICheckBoxState)? onChanged; + TUICheckBox({ super.key, this.enableMixedState = false, @@ -14,10 +18,6 @@ class TUICheckBox extends StatefulWidget { } } - late bool enableMixedState; - final TUICheckBoxState state; - final Function(TUICheckBoxState)? onChanged; - @override State createState() => _TUICheckBoxState(); } diff --git a/lib/components/checkbox_row/checkbox_row.dart b/lib/components/checkbox_row/checkbox_row.dart index 47436e6..ce7bb85 100644 --- a/lib/components/checkbox_row/checkbox_row.dart +++ b/lib/components/checkbox_row/checkbox_row.dart @@ -11,14 +11,14 @@ class TUICheckBoxRow extends StatefulWidget { final Function(TUICheckBoxRowState)? onChanged; const 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); + }); @override State createState() => _TUICheckBoxRowState(); diff --git a/lib/components/email_field/email_field.dart b/lib/components/email_field/email_field.dart index 4faa1bb..27b6812 100644 --- a/lib/components/email_field/email_field.dart +++ b/lib/components/email_field/email_field.dart @@ -12,14 +12,14 @@ class TUIEmailField extends StatefulWidget { final TextEditingController? controller; const TUIEmailField({ - Key? key, + super.key, this.label = TUIEmailFieldLabel.to, required this.emails, this.showSuffix = false, this.onAdd, this.onRemove, this.controller, - }) : super(key: key); + }); @override State createState() => _TUIEmailFieldState(); @@ -123,7 +123,6 @@ class _TUIEmailFieldState extends State { ), child: Row( mainAxisSize: MainAxisSize.max, - // mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: _emails.isEmpty ? CrossAxisAlignment.center : CrossAxisAlignment.start, @@ -148,7 +147,7 @@ class _TUIEmailFieldState extends State { ) { int idx = _emails.indexOf(email); return getChip(email, theme, idx); - }).toList(), + }), ], ), TextField( diff --git a/lib/components/menu_item/menu_item.dart b/lib/components/menu_item/menu_item.dart index 9b26ab7..7185fc2 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; const TUIMenuItem({ - Key? key, + super.key, required this.item, this.backgroundDark = false, this.onLeftTap, this.onRightTap, this.action, - }) : super(key: key); + }); @override State createState() => _TUIMenuItemState(); diff --git a/lib/components/navigation_row/navigation_row.dart b/lib/components/navigation_row/navigation_row.dart index 6356bb3..ce6dc45 100644 --- a/lib/components/navigation_row/navigation_row.dart +++ b/lib/components/navigation_row/navigation_row.dart @@ -3,11 +3,11 @@ import 'package:tarka_ui/styles/theme.dart'; class TUINavigationRow extends StatelessWidget { final String title; - late IconData? icon; - late Widget? accessoryView; - late double? _height; + late final IconData? icon; + late final Widget? accessoryView; + late final double? _height; - TUINavigationRow({ + TUINavigationRow({ super.key, required this.title, this.icon, diff --git a/lib/components/toggle_row/toggle_row.dart b/lib/components/toggle_row/toggle_row.dart index dd66be7..3993cea 100644 --- a/lib/components/toggle_row/toggle_row.dart +++ b/lib/components/toggle_row/toggle_row.dart @@ -11,14 +11,14 @@ class TUIToggleRow extends StatefulWidget { final bool backgroundDark; const TUIToggleRow({ - Key? key, + 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/pubspec.yaml b/pubspec.yaml index 9a3c275..d317ef1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 homepage: https://github.com/tarkalabs/tarka-ui-kit-flutter.git environment: - sdk: '>=3.0.0' + sdk: '^3.0.0' flutter: ">=3.10.0" dependencies: