GithubHelp home page GithubHelp logo

ovprogresshud's Introduction

progresshud

一个好用的Hud框架,通过Flutter调用原生代码的方式实现,包含loading(默认),success,error,info等样式。通过一行代码即可在任何地方调出Hud,并控制其隐藏,在示例App中,你可以看到具体如何使用它。

在iOS上使用SVProgressHUD,安卓上使用SVProgressHUD-Android(这个包就是仿写的iOS版本)。ui均来自原生层,所以没有过多的可定义空间,如果需要自定义,可以分别在各个平台上重写框架代码(比较麻烦)。

A useful Hud framework is implemented by calling native code by Flutter. With one line of code, you can call Hud out anywhere and control its hiding. In the example App, you can see how to use it. SVProgress HUD is used on iOS and SVProgress HUD-Android is used on Android (this package is a copy of iOS version). UI comes from the native layer, so there is not too much definition space. If you need to customize, you can rewrite the framework code on each platform separately (more troublesome).

EasyUse ProgressHUD for flutter app.

Install

Add this to your package's pubspec.yaml file: 把如下字段加入你的pubspec.yaml文件:

dependencies:
  flutter:
    sdk: flutter
  // 添加下面这一行
  ovprogresshud: any

然后运行flutter packages get即可

Usage

Progresshud.show();

Show

Progresshud.showWithStatus('myinfo');

Status

Progresshud.showSuccessWithStatus('myinfo');

Success

Progresshud.showInfoWithStatus('myinfo');

Info

Progresshud.showErrorWithStatus('myinfo');

Error

Progresshud.setDefaultMaskTypeBlack();

MaskTypeBlack

Progresshud.setDefaultMaskTypeGradient('myinfo');

MaskTypeGradient

ovprogresshud's People

Contributors

bootansvi avatar jerryliao26 avatar mjl0602 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ovprogresshud's Issues

About Progresshud.set***() in Android

For example, when calling Progresshud.setDefaultMaskTypeBlack(); . HUD should not appear, but it will appear on Android. But there is no problem on iOS.

Please check the problem. Thank you.

Feature Request

Allow to change hud background and foreground colour. Icon can also be change to something else, but still configurable to use out own child property so can use loading animation widget.

On iOS works fine, but on Android is not working

It's fine on iOS, but it's does not work on Android.

On Android, it stops at code:
await Progresshud.showWithStatus('Login ...'); // blocked here
the following code not excuting
Anyone has the same problem.

Can't update progress from an isolate

https://stackoverflow.com/questions/59170836/calling-a-ui-method-from-isolate-listen-method-in-flutter-throws-exception

I tried to use ovprogresshud (https://pub.dev/packages/ovprogresshud) to show download progress. I used flutter_downloader (https://pub.dev/packages/flutter_downloader) for download.

I try to update progress via an Isolate, but receive errors.
(If I call Progresshud.showWithStatusdirectly in my code, say before download, it works)

My code:

ReceivePort _port = ReceivePort();
...

IsolateNameServer.registerPortWithName(
        _port.sendPort, 'downloader_send_port');
_port.listen(
      (dynamic data) {
        String id = data[0];
        DownloadTaskStatus status = data[1];
        int progress = data[2];
        if (status == DownloadTaskStatus.complete) {
        } else if (status == DownloadTaskStatus.running) {
          Progresshud.showWithStatus("%$progress Downloaded");
        }
      },
      onDone: () {
        checkIfDictionaryUnzipped(DBFilePath);
      },
      onError: (error) {},
    );

The error I receive:

Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.view.ViewParent android.view.ViewGroup.getParent()' on a null object reference, null)
E/flutter (29114): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (29114): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (29114): <asynchronous suspension>
E/flutter (29114): #2      Progresshud.showWithStatus (package:ovprogresshud/progresshud.dart:18:27)
E/flutter (29114): <asynchronous suspension>
....

希望能设置HUD默认样式

希望大佬能增加原生库里设置默认字体、颜色、dismiss时间等样式的api,目前只能设置mask。

Bugs showSuccessWithStatus on next call

Calling Progresshud.show()/dismiss() works fine, but when calling showSuccess or Info or Error make the screen blocked since the progresshud does not dismiss for the second time it's called.

Progresshud.showSuccessWithStatus("Please wait...");
//Do something a bit long 2 - 3 seconds
await Progresshud.dismiss();

Not able to Build apk

Execution failed for task ':ovprogresshud:verifyReleaseResources'.

1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

打包时,报资源文件出错

  • 开发环境:
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.41.0)
[✓] Connected device (2 available)
  • 错误信息:
[        ] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Execution failed for task ':ovprogresshud:verifyReleaseResources'.
[        ] > java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
[        ]   /Users/wml/Development/workspace@Flutter/mobile_design_studio/build/ovprogresshud/intermediates/res/merged/release/values/values.xml:265: error:
resource android:attr/fontVariationSettings not found.
[        ]   /Users/wml/Development/workspace@Flutter/mobile_design_studio/build/ovprogresshud/intermediates/res/merged/release/values/values.xml:266: error:
resource android:attr/ttcIndex not found.
[        ]   error: failed linking references.
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 2m 31s

我搜索到其它一些插件也有类似问题,这个情况应该是升级 flutter 到 v1.12.13 版本后出现的。希望开发者能修复一下~

Update existing message and close

When one calls showLoading() and showSuccess(), it closes the first dialog then shows the 2nd one

would be nice to have a way to have an extra parameter to note close the current dialog and just change the dialog content, and then closing it like when showSuccess() is called.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.