pub-web.flutter-io.cn

Introduction

A simple and powerful HTTP validator for Flutter.

Getting Started

Add Arna Response Validation as a dependency in your pubspec.yaml:

dependencies:
  arna_response_validation: ^1.3.0

Import it:

import 'package:arna_response_validation/arna_response_validation.dart';

Use it!

final Response? response = await webService.get(
  Uri.parse('https://api.ipify.org'),
);
final body = validateResponse(response);
arnaLogger(title: 'Your IP', data: body);

dynamic validateResponse(final Response? response) {
  final StatusCode? statuscode = ArnaResponseValidation().getStatusCode(response);
  if (statuscode != null) {
    arnaLogger(title: 'StatusCode', data: statuscode);
    return ArnaResponseValidation().getBody(response);
  }
  return null;
}

Libraries

arna_response_validation
Arna Response Validation is a simple and powerful HTTP validator for Flutter.