The package for building grpc channel depending on is it web or not

Overview

The package for building grpc channel depending on is it web or not

Features

  • The util builds gRPC channel for flutter web or other platforms conditionally, depending on the runtime environment

Usage

const webAppPort = 8888;
const someGrpcServicePort = 5555;
const host = 'http://127.0.0.1';

// for web I suggest to use Envoy as a proxy routing from webAppPort to someGrpcServicePort
int get port => kIsWeb ? webAppPort : someGrpcServicePort;

class SomeGrpcService {
  late final SomeGrpcClient stub;

  SomeGrpcService() {
    init();
  }

  void init() {
    final channel = buildGrpcChannel(host: host, port: port, secure: false);
    stub = SomeGrpcClient(channel);
  }

  Future<SomeRpcResponse> someRpc(SomeRpcRequest request) {
    final response = stub.sendQuestion(request);
    return response;
  }
}
You might also like...

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

Oct 8, 2021

Easily swap Flutter web renderers at runtime

renderer_switcher Swap Web Renderers in a Flutter Web app at runtime. Installation To use this plugin, add renderer_switcher as a dependency in your p

Oct 21, 2022

A to do list app for android, apple, and the web.

noted A new Flutter project. Getting Started FlutterFlow projects are built to run on the Flutter stable release. IMPORTANT: For projects with Firesto

Nov 4, 2022

A pure dart package to apply useful rate limiting strategies on regular functions.

A pure dart package to apply useful rate limiting strategies on regular functions.

Rate limiting is a strategy for limiting an action. It puts a cap on how often someone can repeat an action within a certain timeframe. Using rate_limiter we made it easier than ever to apply these strategies on regular dart functions.

Dec 14, 2022

A package that helps with encoding and decoding of geohashes.

A package that helps with encoding and decoding of geohashes.

georange Georange is a package that helps with encoding geohashes, decoding geohashes,calculating distance between 2 points and generating latitudinal

Feb 17, 2022

This package binds to Cronet's native API to expose them in Dart.

Experimental Cronet Dart bindings This package binds to Cronet's native API to expose them in Dart. This is an HTTP Client Package with almost the sam

Dec 9, 2022

This package wraps Airtime, Sms, and Voice call from Africa's Talking APIs.

This package wraps some functionalities from Africa's Talking API The functionalities implemented are; Sms send message fetch messages generate checko

May 31, 2022

With this package you can display numbers or any other text more nicely

With this package you can display numbers or any other text more nicely

flutter_number_animation With this package you can display numbers or any other text more nicely Preview Works with text too! How to use Add this to y

Jun 7, 2022
Owner
Premiumapp
Premiumapp
An example todo list back end project that uses gRPC for client-server communication and Firestore for data storage

An example todo list back end project that uses gRPC for client-server communication and Firestore for data storage

Lucas Coelho 2 Apr 18, 2022
An application built using flutter that works as destiny checker, whether our mind wish is as we desire or not with 8 different option.

magic_8_ball_utter A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

dev_allauddin 3 Feb 3, 2022
An extension to the Flutter SDK for building Flutter applications for Tizen devices.

Flutter for Tizen An extension to the Flutter SDK for building Flutter applications for Tizen devices. Flutter and the related logo are trademarks of

null 356 Dec 16, 2022
A Dart package to web scraping data from websites easily and faster using less code lines.

Chaleno A flutter package to webscraping data from websites This package contains a set of high-level functions that make it easy to webscrap websites

António Nicolau 30 Dec 29, 2022
This is a simple class to package up and send requests to the Kroki.io web service.

Kroki.dart This is a simple class to package up and send requests to the Kroki.io web service. A live editor to editing diagrams that Kroki supports c

Tim Maffett 1 Jun 8, 2022
A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully

Muhammad Hamza 20 Jun 7, 2022
A Dart package which supports checking if a current package is up-to-date.

pub_updater A Dart package which enables checking whether packages are up to date and supports updating them. Intended for use in CLIs for prompting u

Very Good Open Source 47 Oct 27, 2022
null 2 Apr 17, 2022
A high-performance, web standards-compliant rendering engine based on Flutter.

A high-performance, web standards-compliant rendering engine based on Flutter.

OpenKraken 4.8k Dec 30, 2022
Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Alexey Perov 5 Nov 9, 2022