override_api_endpoint 2.0.0+1 copy "override_api_endpoint: ^2.0.0+1" to clipboard
override_api_endpoint: ^2.0.0+1 copied to clipboard

This package is prepared so that backend developers can override api endpoint for some local one without the need to compile the app. The desired behavior is realized with deeplinks. The override URL [...]

Banner

override_api_endpoint #

override_api_endpoint pub.dev badge

Overrides and persists default API endpoint for the test environment.

  • deeplinkOverrideSegment - part of deeplink that uniquely identifies deeplink that is used to override API endpoint eg. override in app://app/override?apiAddress=https%3A%2F%2Fexample.com
  • deeplinkQueryParameter - query parameter of the override API endpoint deeplink that contains url encoded API endpoint to be used eg. apiAddress in app://app/override?apiAddress=https%3A%2F%2Fexample.com
  • defaultEndpoint - fallback URL that should be used if app does not have any endpoint introduced via deeplink or if deeplinkQueryParameter is not provided

Usage #

import 'package:shared_preferences/shared_preferences.dart';
import 'package:uni_links/uni_links.dart';

final apiEndpoint = await overrideApiEndpoint(
  sharedPreferences: await SharedPreferences.getInstance(),
  getInitialUri: getInitialUri,
  deeplinkOverrideSegment: 'override',
  deeplinkQueryParameter: 'apiAddress',
  defaultEndpoint: Uri.parse('https://api.example.com'),
);

🛠️ Maintained by LeanCode #

LeanCode Logo

This package is built with 💙 by LeanCode. We are top-tier experts focused on Flutter Enterprise solutions.

Why LeanCode? #

  • Creators of Patrol – the next-gen testing framework for Flutter.

  • Production-Ready – We use this package in apps with millions of users.

  • Full-Cycle Product Development – We take your product from scratch to long-term maintenance.


Need help with your Flutter project?

👉 Hire our team   •   Check our other packages

9
likes
140
points
65
downloads

Publisher

verified publisherleancode.co

Weekly Downloads

This package is prepared so that backend developers can override api endpoint for some local one without the need to compile the app. The desired behavior is realized with deeplinks. The override URL is persisted until a new deeplink is used.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

shared_preferences

More

Packages that depend on override_api_endpoint