myapi 0.0.24 copy "myapi: ^0.0.24" to clipboard
myapi: ^0.0.24 copied to clipboard

unlisted

Processing Api with template.

myapi #

A new Flutter package.

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Usage #


  ScrollController _scrollController = ScrollController();


createApps(){
    Config.environment = Env.development; // position url on apps.
    Config.appName = 'xxx Mobile'; // app name
    Config.developmentDomain = 'api-asd.developement.com'; //url
    Config.stagingDomain = 'api-asd.com'; //url
    Config.productionDomain = 'asd.com'; //url

    Config.developmentAuthId = 'xxx'; // auth id
    Config.stagingAuthId = 'xxx'; // auth id
    Config.productionAuthId = 'xxxx'; // auth id

    Config.bearer = 'xxxxx'; // bearer

    Config.colorMain = Colors.red; // main colors/
  }

  callApi(){
    Api.createDefaultParams((parameter) {
      parameter.set('data', '1'); // parameter
      Api(context).execute('login', MethodApi.post, parameter, (response) {
        List data = response.data()['response']; // response api
      });
    });

    // or 

    Api.createDefaultParams((parameter) {
       parameter.set('data','xxx');
       Api api = new Api(context);
       api.createPaginator().setScrollController(_scrollController);
       api.setErrorListener((error) {
         config.isLoading = false;
         setState(() {

         });
       });
        api.execute(ApiMethod.bookingInvoice, Methodapi.isGet, parameter, (response) {

          List data = response.data()['response'];
          

        });
    });

  }