use a static map for additional headers

This commit is contained in:
Salvatore Giordano
2021-11-03 12:53:36 +01:00
parent dbe9e38ab0
commit 55e4c1ebd5
9 changed files with 74 additions and 38 deletions
-12
View File
@@ -1,22 +1,10 @@
import 'package:stream_chat/src/client/client.dart';
import 'package:stream_chat/src/core/platform_detector/platform_detector.dart';
/// Current package version
/// Used in [StreamChatClient] to build the `x-stream-client` header
// ignore: constant_identifier_names
const PACKAGE_VERSION = '3.2.0';
/// Default user agent used for the 'x-stream-client' header
final defaultUserAgent = 'stream-chat-dart-client-'
'${CurrentPlatform.name}-'
'${PACKAGE_VERSION.split('+')[0]}';
/// Current used package
/// This is used to set the `x-stream-client` header using info about
/// the package in use
/// For example: llc/core/ui
Package usedPackage = Package.llc;
/// Possible packages
enum Package {
/// The Low Level Client