An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

Overview

network_requests

An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

Platform Supported
Android
iOS
Web
Windows
Linux
Mac

Features

  • Interceptors

    The package adds functionality to add interceptors to http requests.

  • Safe Logging

    The package offers safe logging where logs only happen on an active dart debug vm.

  • Error Handling

    The package offers error handling out of the box to handle almost all http errors.

Getting started

Add the package to pubspec.yaml

    network_requests: // use the latest version

Platform specific configuration

Android

To allow your application to access the Internet, add the following permission to your AndroidManifest.xml file:

    <uses-permission android:name="android.permission.INTERNET"/>

Usage

import 'package:network_requests/network_requests.dart' as req;

final client = req.NetworkRequest.instance;

// * Add auth header interceptor.
// * Ideally this should be done on the main method before doing any network calls.
client.addInterceptor(AuthHeaderInterceptor());

final url = Uri.https('example.com', 'whatsit/create');
final response = await client.post(url, body: {'name': 'doodle', 'color': 'blue'});

print(response.status);
print(response.message);
print(response.data);

Additional information

The below shows the structure of the ApiResponse class returned from every API call.

Name Description Type
status The status code returned from the api call int
message The status code message received from the api call String
success The success status of api call, will be true if the request is successful and false if vice-versa bool
data The data received from the api call Object
exception The error received from the api call Object

Issues and Feature Requests

If you notice any bug or want to request for a feature, please fill free to raise an issue at: Issues/Feature

You might also like...

A Dart/Flutter package to perform network calls. It uses Isolates to perform network calls on Dart VM environments and WebWorkers on Web.

ArDriveHTTP ArDriveHTTP is a package to perform network calls for ArDrive Web. It uses Isolates to perform network calls on Dart VM environments and W

Dec 15, 2022

Sink - Verify that you're spending more than you can afford

Sink - Verify that you're spending more than you can afford

Sink Sink is an app that allows you to track your income and expenses. Current Status Usable Visually bearable Unusable Local App Setup While working

Jan 3, 2023

Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Oct 29, 2022

A google browser clone which is made by using flutter and fetching the google search api for the search requests.

A google browser clone which is made by using flutter and fetching the google search api for the search requests.

google_clone A new Flutter project. Project Preview Getting Started This project is a starting point for a Flutter application. A few resources to get

May 31, 2022

Listen to remote Flutter GTK application instances' command-line arguments and file open requests.

gtk_application This package allows the primary Flutter GTK application instance to listen to remote application instances' command-line arguments and

Dec 15, 2022

🌈 Repository for a compass project, basically an App for displaying bank transfers, with API requests, Flag persistence, Infinite Scroll, Error Handling, Unit Tests, Extract Sharing working with SOLID, BLoC and Designer Patterns.

🌈 Repository for a compass project, basically an App for displaying bank transfers, with API requests, Flag persistence, Infinite Scroll, Error Handling, Unit Tests, Extract Sharing working with SOLID, BLoC and Designer Patterns.

💸 Green Bank Aplicação desenvolvida em Flutter com intuito de trabalhar conexão com API, Gerenciamento de estado usando BLoC, Refatoração, Arquitetur

Oct 7, 2022

Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or video from the device gallery, whether it is Android or iOS

Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or video from the device gallery, whether it is Android or iOS

Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or vide

Oct 13, 2022

A flutter widget to indicate loading progress. Easy to use, easy to extend

💙 👾 💫 A flutter widget to indicate loading progress. Easy to use, easy to extend

May 30, 2022

A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

easy_tab_controller A user-friendly TabBarController widget for flutter developer. Getting Started This project is a starting point for a Flutter plug

May 26, 2022
Releases(v1.0.2)
Owner
Coder_Manuel
Full Stack Mobile Engineer || Flutter || NestJS || FastApi || Codemagic || Circle CI || ALC 7.0 Mentor
Coder_Manuel
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.

flutter-ui-nice ❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Twitter Medium QQ Group Flutter Open NieBin Flutter O

Flutter开源社区 3.4k Jan 3, 2023
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.

flutter-ui-nice ❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Twitter Medium QQ Group Flutter Open NieBin Flutter O

Flutter开源社区 3.4k Jan 5, 2023
Charlatan - A library for configuring and providing fake http responses to your dio HTTP client.

charlatan This package provides the ability to configure and return fake HTTP responses from your Dio HTTP Client. This makes it easy to test the beha

Betterment 14 Nov 28, 2022
Getx and Dio APi-Integration - Flutter RestApi Integration using Dio

Flutter RestApi Integration using Dio. Click this image to find videos==> //Crud

Fsd Ramjan 9 Nov 5, 2022
A composable API for making HTTP requests in Dart.

A composable, Future-based library for making HTTP requests. This package contains a set of high-level functions and classes that make it easy to cons

Dart 888 Dec 26, 2022
This example handles HTTP GET requests by responding with 'Hello, World!'

Hello world example This example handles HTTP GET requests by responding with 'Hello, World!'. // lib/functions.dart import 'package:functions_framewo

TryIt (김동현) 0 May 25, 2022
A ready-made structure that holds HTTP requests.

A ready-made structure that holds HTTP requests. Usage import 'package:flutter/material.dart'; import 'package:uigitdev_request_holder/src/http_reques

Uigitdev 2 Oct 21, 2022
Flutter user authentication with back-end handler

user_auth Dart - Backend user auth helpe, with common methods Show some ❤️ and star the repo usage import package:user_auth/user_auth.dart. create ins

Mohamed Sayed 9 Jan 2, 2022
LakhanKumawat ᵖ⁺ 12 Dec 6, 2022
Dart / Flutter package that allows discovering network devices in local network (LAN).

lan_scanner Dart / Flutter package that allows discovering network devices in local network (LAN). Note: This library is intended to be used on Class

null 12 Dec 9, 2022