Coder Social home page Coder Social logo

arnold-parge / screen_loader Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 5.0 21.45 MB

Easy to use mixin ScreenLoader, which will handle the loading on the screen. You can customize the loading as well, check below how it is done.

License: MIT License

Dart 100.00%
dart flutter loader screen-loader stream

screen_loader's People

Contributors

arnold-parge avatar projectaj14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

screen_loader's Issues

performFuture in didChangeDependencies

Can any one help me here , Looks performFuture is not working properly inside didChangeDependencies

  Future<dynamic> _loadUser() {
    return Provider.of<Users>(context, listen: false).fetchUsers();
  }
@override
  void didChangeDependencies() async {
    if (_isInit) {
      _isInit = false;
      await this.performFuture(_loadUser); // This line does not show loader 
      await this.performFuture(NetworkService.getData); // This line show loader 
 
    }


    super.didChangeDependencies();
  }
class NetworkService {
  static` Future getData() async {
    return await Future.delayed(Duration(seconds: 2));
  }
}

Screen is always blurry

After updating flutter to latest version the screen is always blurry, even if no future is being performed

Screenshot_1623448593

How to handle exceptions?

I just tried out this widget, and I noticed that if I throw an exception inside the method used in performFuture(), the loading screen never disappears. In my case, I don't want to catch the exception inside the method.

Is it possible to make the loader disappear in case the method throws an exception? Or would it be possible to add this feature (perhaps with an optional bool hideOnError flag in performFuture())?

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.