搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。