UniversalTranslatorInit constructor
const
UniversalTranslatorInit(
- String path, {
- required Widget builder(),
- required Map<
String, dynamic> bodyPattern(), - required String? responsePattern(
- Response response
- Map<
String, dynamic> ? headers, - bool? automaticDetection,
- Locale? translateTo,
- Duration cacheDuration = const Duration(days: 7),
- bool forceRefresh = false,
- HttpMethod method = HttpMethod.post,
Implementation
const UniversalTranslatorInit(this.path,
{required this.builder,
required this.bodyPattern,
required this.responsePattern,
this.headers,
this.automaticDetection,
this.translateTo,
this.cacheDuration = const Duration(days: 7),
this.forceRefresh = false,
this.method = HttpMethod.post})
: assert(automaticDetection == true || translateTo != null,
'Please select a language to translate');