Skip to content

Commit

Permalink
Refactored and fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rajivmanivannan committed Feb 11, 2024
1 parent 66b8260 commit 2fdf680
Show file tree
Hide file tree
Showing 31 changed files with 100 additions and 137 deletions.
5 changes: 4 additions & 1 deletion .pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ bin/
.github/
example/.fvm/
example/build/
example/.dart_tool/
example/.dart_tool/
/test/widget/failures
/test/golden_test/failures
/.ssh/
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.0.1 - 2023-05-10
## 1.0.0 - 2024-02-13

* TODO:
14 changes: 7 additions & 7 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -179,7 +179,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "1.0.0"
term_glyph:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions lib/components/accordion/accordion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<TUIAccordion> createState() => _TUIAccordionState();
Expand Down
4 changes: 2 additions & 2 deletions lib/components/anchor/anchor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion lib/components/app_bar/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:tarka_ui/styles/theme.dart';
class TUIAppTopBar extends StatefulWidget {
final List<TUIAppBarItem> items;
final List<BottomNavigationBarItem> _bnbItems;

final ValueChanged<int>? onTap;
final int currentIndex;
final bool showLabels;
Expand Down
29 changes: 13 additions & 16 deletions lib/components/attachment_upload/attachment_upload.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -17,15 +16,15 @@ class TUIAttachmentUpload extends StatelessWidget {
late Function()? downloadTapped;

TUIAttachmentUpload({
Key? key,
super.key,
required this.title,
required this.isIconUsed,
this.icon,
this.image,
this.description = "",
this.downloadTapped,
this.deleteTapped,
}) : super(key: key) {
}) {
if (isIconUsed == true) {
image = null;
} else {
Expand Down Expand Up @@ -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,
),
),
),
Expand Down Expand Up @@ -160,7 +157,7 @@ class TUIAttachmentUpload extends StatelessWidget {
child: Icon(icon),
);
} else {
return Placeholder();
return const Placeholder();
}
}
}
3 changes: 1 addition & 2 deletions lib/components/avatar/avatar.dart
Original file line number Diff line number Diff line change
@@ -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.
/*
Expand Down
4 changes: 2 additions & 2 deletions lib/components/breadcrumb/breadcrumb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class TUIBreadCrumb extends StatelessWidget {
final List<String> titles;

const TUIBreadCrumb({
Key? key,
super.key,
required this.titles,
required this.onTap,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
5 changes: 2 additions & 3 deletions lib/components/button/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions lib/components/checkbox/checkbox.dart
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down Expand Up @@ -132,6 +131,7 @@ enum TUICheckBoxState {
checked(2);

const TUICheckBoxState(this.value);

final num value;

static TUICheckBoxState getByValue(num i) {
Expand Down
9 changes: 4 additions & 5 deletions lib/components/checkbox_row/checkbox_row.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
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;
final String description;
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;
}
Expand Down Expand Up @@ -197,6 +195,7 @@ enum TUICheckBoxRowState {
checked(2);

const TUICheckBoxRowState(this.value);

final num value;

static TUICheckBoxRowState getByValue(num i) {
Expand Down
4 changes: 0 additions & 4 deletions lib/components/chip/chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 3 additions & 3 deletions lib/components/draggable_card/draggable_card.dart
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
9 changes: 4 additions & 5 deletions lib/components/email_field/email_field.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<StatefulWidget> createState() => _TUIEmailFieldState();
Expand Down Expand Up @@ -147,7 +146,7 @@ class _TUIEmailFieldState extends State<TUIEmailField> {
) {
int idx = _emails.indexOf(email);
return getChip(email, theme, idx);
}).toList(),
}),
],
),
TextField(
Expand Down
8 changes: 4 additions & 4 deletions lib/components/email_subject_field/email_subject_field.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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
State<TUIEmailSubjectField> createState() => _TUIEmailSubjectFieldState();
}

class _TUIEmailSubjectFieldState extends State<TUIEmailSubjectField> {
TextEditingController _controller = TextEditingController();
FocusNode _focusNode = FocusNode();
final TextEditingController _controller = TextEditingController();
final FocusNode _focusNode = FocusNode();
bool _isEditing = false;

String enteredText = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/components/media_thumbnail/media_thumbnail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading

0 comments on commit 2fdf680

Please sign in to comment.