From 757e9be21222e518d6e051c4197f32b30ea4401d Mon Sep 17 00:00:00 2001 From: William Jordan-Cooley Date: Tue, 21 May 2024 17:53:37 -0400 Subject: [PATCH] allowing user_l1 and user_l2 to be nullable in request --- .../controllers/language_detection_controller.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/pangea/controllers/language_detection_controller.dart b/lib/pangea/controllers/language_detection_controller.dart index 400cd4419..0a233a12d 100644 --- a/lib/pangea/controllers/language_detection_controller.dart +++ b/lib/pangea/controllers/language_detection_controller.dart @@ -9,9 +9,18 @@ import 'package:http/http.dart' as http; import '../network/requests.dart'; class LanguageDetectionRequest { + /// The full text from which to detect the language. String fullText; - String userL1; - String userL2; + + /// The base language of the user, if known. Including this is much preferred + /// and should return better results; however, it is not absolutely necessary. + /// This property is nullable to allow for situations where the languages are not set + /// at the time of the request. + String? userL1; + + /// The target language of the user. This is expected to be set for the request + /// but is nullable to handle edge cases where it might not be. + String? userL2; LanguageDetectionRequest({ required this.fullText,