搜索插件、代码仓与 APP 分类

empty_widget 封面
插件详情v0.0.5

empty_widget

Custom_Empty 小部件是 Flutter 自定义小部件,旨在通知用户某些事件。

近 30 天下载
537
喜欢数
70
Pub 分数
65

安装插件

flutter pub add empty_widget

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

empty_widget 是一个 Flutter 自定义控件,旨在通知用户特定事件,例如列表中的空状态或数据缺失。它提供了一个可自定义的占位符界面,通过清晰地指示内容不可用的情况来提升用户体验。该控件设计简洁灵活,支持多种视觉配置,如图标、文本和按钮。非常适合用于具有动态内容的应用程序中,以改善 UI 反馈。

适合场景

  • 在列表中显示空状态
  • 指示缺失数据
  • 增强用户反馈
  • 自定义占位符视觉效果
  • 改善数据加载期间的用户体验
  • 提供操作按钮

主要特点

  • 可自定义图标和文本
  • 支持操作按钮
  • 与现有小部件的轻松集成
  • 可配置的外观
  • 轻便高效
  • 可扩展的设计

适合对象

  • 寻求简单空状态解决方案的开发者
  • 动态内容显示的应用程序
  • 以UI/UX为重点的Flutter项目
  • 希望拥有可重复使用的占位符组件的团队
  • 项目需要最少的样板代码

使用建议

  • 有限的平台特定优化
  • 无内置动画
  • 需要手动样式设置以实现高级设计
  • 不适合复杂的交互式占位符
  • 依赖外部源代码进行更新

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Empty Widget

Open Source Love GitHub last commit GitHub GitHub code size in bytes GitHub stars GitHub forks

pub package Likes Popularity Pub points

Hits

Custom_Empty widget is flutter custom widget which is designed to notify user about some event.

Screenshots

Screenshots Screenshots Screenshots Screenshots

Getting Started

1. Add library to your pubspec.yaml
dependencies:
  empty_widget: ^0.0.3
2. Import library in dart file

import 'package:empty_widget/empty_widget.dart';

3. Use of EmptyWidget
 EmptyWidget(
   image: null,
   packageImage: PackageImage.Image_1,
   title: 'No Notification',
   subTitle: 'No  notification available yet',
   titleTextStyle: TextStyle(
     fontSize: 22,
     color: Color(0xff9da9c7),
     fontWeight: FontWeight.w500,
   ),
   subtitleTextStyle: TextStyle(
     fontSize: 14,
     color: Color(0xffabb8d6),
   ),
 );

Example

import 'package:empty_widget/empty_widget.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
         primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Empty widget demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
 final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        alignment: Alignment.center,
        child: EmptyWidget(
          image: null,
          packageImage: PackageImage.Image_1,
          title: 'No Notification',
          subTitle: 'No  notification available yet',
          titleTextStyle: TextStyle(
            fontSize: 22,
            color: Color(0xff9da9c7),
            fontWeight: FontWeight.w500,
          ),
          subtitleTextStyle: TextStyle(
            fontSize: 14,
            color: Color(0xffabb8d6),
          ),
        ),
      ),
    );
  }
}

Parameters and Value

Parameter Type Description
title string Set text for title
subTitle string Set text for subtitle
image string Display images from project assets
packageImage PackageImage Display image from package assets
titleTextStyle TextStyle Set text style for title
subtitleTextStyle TextStyle Set text style for subtitle
hideBackgroundAnimation bool Hides the background circular ball animation

Download Example App

Pull Requests

I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request.

Created & Maintained By

Sonu Sharma (Twitter) (Youtube) (Insta) Twitter Follow

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of :coffee:

Visitors Count

Loading

所属分类

源码仓库

使用此插件的项目

暂无相关数据。