All checks were successful
ci/woodpecker/push/build Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@posteo.com>
17 lines
460 B
Dart
17 lines
460 B
Dart
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:grpc/grpc_web.dart';
|
|
|
|
final grpcChannelProvider = Provider<GrpcWebClientChannel>((ref) {
|
|
String backendURL = dotenv.env['SOFTPLAYER_BACKEND_URL']!;
|
|
final GrpcWebClientChannel channel = GrpcWebClientChannel.xhr(
|
|
Uri.parse(backendURL),
|
|
);
|
|
|
|
ref.onDispose(() async {
|
|
await channel.shutdown();
|
|
});
|
|
|
|
return channel;
|
|
});
|