view_state_widget 1.0.0 copy "view_state_widget: ^1.0.0" to clipboard
view_state_widget: ^1.0.0 copied to clipboard

A lightweight Flutter widget to manage loading, content, and error states in UI.

🧩 View State Widget #

A simple yet powerful Flutter widget for handling loading, content, error, and network error UI states — with just one line of code.


✨ Preview #

[Loading] [Error]
[Network] [Content]


🚀 Features #

✅ Show different UI states effortlessly
✅ Built-in retry support
✅ Easily customizable widgets
✅ Fully theme-aware
✅ Flutter + Dart package ready for production


🛠 Usage #

StateView(
  state: ViewState.loading, // or content, error, networkError
  content: Text("🎉 Content Loaded!"),
  onRetry: _fetchData, // optional retry callback
);

🎯 ViewState Options

ViewState.loading

ViewState.content

ViewState.error

ViewState.networkError

🎨 Customization You can override the default UI for each state:

StateView(
  state: ViewState.error,
  content: YourContentWidget(),
  errorWidget: Column(
    children: [
      Text("Something went wrong"),
      ElevatedButton(onPressed: _retry, child: Text("Retry")),
    ],
  ),
)

📦 Installation Add this to your pubspec.yaml:

dependencies:
  view_state_widget: ^1.0.0

Then run:

flutter pub get
5
likes
0
points
3
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight Flutter widget to manage loading, content, and error states in UI.

Repository (GitHub)
View/report issues

Topics

#state #ui #error-handling #loading #flutter-widget

License

unknown (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on view_state_widget