TUtils

A reusable Flutter Utils package for tons of widgets and helper functions.

Features

  • Widgets Box You can now use pre-built TContainer, TImage, Dropdowns, Appbar, Header, Breadcrumbs, DataTables, Layouts, Rich Text Editor and much more.
  • Constants Everything a project needs, You can get pre-build Colors, Sizes and can also customize them easily.
  • Exceptions Now manage exceptions like a breeze.
  • Helper Functions Tons of only use-able functions.
  • Validators, Popups, Formatters and much more

Usage

Step 1: Add Dependency

Add this to your pubspec.yaml:

dependencies:
  t_utils: ^0.0.4

Step 2: Import the Package

In your Dart file, import the package:

Pub.dev

import 'package:t_utils/t_utils.dart';

Github Usage

dependencies:
  t_utils:
    git:
      url: https://github.com/CodingwithTea/t_utils.git
      ref: v0.0.4

Local Usage

dependencies:
  t_utils:
    path: /path/to/t_utils

Step 3: Use Widgets

Use Widgets like a breeze:

TContainer(
  child: Center(child: Text('Default')),
),
TContainer(
  width: 120,
  height: 50,
  onTap: () {
    print('Tapped!');
  },
  showRipple: true,
  child: Center(child: Text('Clickable')),
),
TContainer(
  width: 350,
  height: 100,
  alignment: Alignment.bottomCenter,
  shadow: BoxShadow(
    color: Colors.red.withValues(alpha: 0.5),
    spreadRadius: 5,
    blurRadius: 10,
    offset: Offset(0, 5),
  ),
  child: Text('Custom Shadow with custom alignment'),
),

CHOICE CHIPS

TChoiceChip(
  text: "0xFFAB3559", // Color value
  selected: false,
  isColorAttribute: true,
  selectedTextColor: Colors.white,
  onSelected: (isSelected) {
    // Handle color selection
  },
),
TChoiceChip(
  text: "Custom Chip with Icon",
  selected: true,
  selectedTextColor: Colors.blue,
  unselectedTextColor: Colors.grey,
  backgroundColor: Colors.amberAccent,
  customCheckmarkIcon:
    Icon(Icons.health_and_safety_rounded, color: Colors.blue),
  borderShape:
    RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
  onSelected: (isSelected) {
    // Handle selection
  },
),

DROPDOWNS

TDropdown<String>(
  labelText: "Select Country: Menu",
  popupStyle: DropdownPopupStyle.menu,
  showSearchBox: true,
  items: (query, _) =>
    Future.value(['USA', 'Canada', 'India', 'Pakistan']),
    onChanged: (value) {
      print("Selected: $value");
    },
),

TDropdown<String>(
  labelText: "Search Country: BottomSheet",
  showSearchBox: true,
  popupStyle: DropdownPopupStyle.bottomSheet,
  items: (query, _) => Future.value(
    ['USA', 'Canada', 'India', 'Germany', 'Australia', 'Pakistan']),
  onChanged: (value) {
    print("Selected: $value");
  },
),

Additional Information

  • Contributions: If you'd like to contribute to this project, please open a pull request or submit an issue. Contributions are welcome to improve the UI or add new features.
  • Issues: If you encounter any bugs or have suggestions for improvements, please file an issue in the repository.
  • Support: The package is actively maintained, and issues are typically addressed within 1–2 business days.

Libraries

common/styles/shadows
common/styles/spacing_styles
common/widgets/appbar/appbar
common/widgets/appbar/sliver_appbar
common/widgets/appbar/tabbar
common/widgets/chips/animated_icon_switch
common/widgets/chips/animated_switch
common/widgets/chips/choice_chip
common/widgets/containers/form_container
common/widgets/containers/t_container
common/widgets/custom_shapes/curved_edges/curved_edges
common/widgets/custom_shapes/curved_edges/curved_edges_widget
common/widgets/data_table/data_table
common/widgets/data_table/paginated_data_table
common/widgets/data_table/table_header
common/widgets/dividers/divider
common/widgets/dropdowns/country_code_picker
common/widgets/dropdowns/phone_with_country_code_picker
common/widgets/dropdowns/searchable_dropdown
common/widgets/exports
common/widgets/icons/t_icon
common/widgets/icons/table_action_icon_buttons
common/widgets/images/image_uploader
common/widgets/images/t_image
common/widgets/layouts/grid_layout
common/widgets/layouts/templates/login_template
common/widgets/loaders/animation_loader
common/widgets/loaders/circular_loader
common/widgets/loaders/shimmer
common/widgets/rich_text_editor/editor_controller
common/widgets/rich_text_editor/rich_text_editor
common/widgets/texts/page_heading
common/widgets/texts/text_with_icon
t_utils
utils/constants/colors
utils/constants/enums
utils/constants/exports
utils/constants/sizes
utils/device/device_utility
utils/device/web_material_scroll
utils/exceptions/exports
utils/exceptions/firebase_auth_exceptions
utils/exceptions/firebase_exceptions
utils/exceptions/format_exceptions
utils/exceptions/platform_exceptions
utils/exports
utils/formatters/formatter
utils/helpers/exports
utils/helpers/helper_functions
utils/helpers/network_manager
utils/helpers/stats_helper_functions
utils/local_storage/storage_utility
utils/popups/dialogs
utils/popups/exports
utils/popups/full_screen_loader
utils/popups/loaders
utils/validators/validation