authInterceptorTemplate top-level constant

String const authInterceptorTemplate

Implementation

const String authInterceptorTemplate = '''
// Example HTTP interceptor for authentication.
// Adapt to your HTTP client (dio, http, etc.).

class AuthInterceptor {
  final String? token;
  AuthInterceptor({this.token});

  Map<String, String> get headers => {
    if (token != null) 'Authorization': 'Bearer \$token',
  };
}
''';