state_msg_builder 0.0.2
state_msg_builder: ^0.0.2 copied to clipboard
A Flutter package to display customizable state messages such as error, no items, or loading messages with customizable text styles and colors.
state_msg_builder #
A Flutter package designed to easily display various state messages such as error, no items, or loading messages with customizable text styles and colors.
Features #
- ErrorMsgBuilder: Displays an error message with customizable title and text color.
- NoItemBuilder: Shows a message when no items are available, with a customizable title.
- StateMessageBuilder: A generic widget for displaying state messages, allowing customization of text and color.
- Simple to integrate and customize.
Installation #
Add this to your pubspec.yaml
:
dependencies:
state_msg_builder: <latest_version>
Then run:
flutter pub get
Usage #
Import #
import 'package:state_msg_builder/state_msg_builder.dart';
Example: ErrorMsgBuilder #
ErrorMsgBuilder(
title: 'Something Went Wrong',
txtColor: Colors.red,
)
Example: NoItemBuilder #
NoItemBuilder(
title: 'No Data Available',
)
Example: StateMessageBuilder #
StateMessageBuilder(
title: 'Loading...',
txtColor: Colors.blue,
)
Widgets #
Widget | Purpose |
---|---|
ErrorMsgBuilder |
Displays an error message |
NoItemBuilder |
Shows a message when no items are available |
StateMessageBuilder |
Displays a generic state message |
Constructor Parameters (StateMessageBuilder) #
Name | Type | Description |
---|---|---|
title |
String? |
The message text to display (default: 'No Items') |
txtColor |
Color? |
The text color for the message (default: deepOrange ) |
Notes #
StateMessageBuilder
andErrorMsgBuilder
can be easily customized for different use cases.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to open issues or contribute if you find ways to improve this widget!
Author #
Shohidul Islam