Skip to content

TomJack1/loading_progress_hud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loading_progress_hud

a simple widget wrapper to enable modal progress HUD (a modal progress indicator, HUD = Heads Up Display)

Demo

Usage

Add the package to your pubspec.yml file.

dependencies:
  loading_progress_hud: ^0.0.1

Next, import the library into your widget.

import 'package:loading_progress_hud/loading_progress_hud.dart';

eg:

    LELoadingController _controller;

  @override
  void initState() {
    _controller = LELoadingController(initType: LoadingOrgStatus.none);
    super.initState();
  }
  
  
  Future<LoadingOrgStatus> loadData() async {
    await Future.delayed(Duration(seconds: 2));
    return widget.netWorkEndType;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('Demo'),
          backgroundColor: Colors.blue,
        ),
        body: LELoadingProgressHUD(
          controller: _controller,
          loadingCallBack: loadData,
          child: new Container(
            child: Center(
              child: Text('loading demo 😁😁'),
            ),
          ),
        ));
  }

Options

The current parameters are customizable in the constructor

LELoadingProgressHUD({
    Key key,
    @required this.controller,
    @required this.child,
    this.loadingCallBack,
    emptyIcon,
    this.textColor,
    this.bacgroundColor,
    this.progressIndicator = const CircularProgressIndicator(),
    this.loadingIndicator = const CircularProgressIndicator(),
  }) 

controller hud

LELoadingController({
    Key key,
    this.initType = LoadingOrgStatus.loading,
    this.emptyText = '暂无数据',//Empty Title
    this.refreshText = '重新获取数据',//refresh Title
    this.errorText = '数据错误',// error Title
    this.loadingText = '正在加载...',//loading title
  });

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published