migrate sample app

This commit is contained in:
Salvatore Giordano
2021-05-12 17:02:43 +02:00
parent 6d1db8d4bf
commit 0303e18945
15 changed files with 261 additions and 260 deletions
@@ -17,13 +17,13 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
final _formKey = GlobalKey<FormState>();
final TextEditingController _apiKeyController = TextEditingController();
String _apiKeyError;
String? _apiKeyError;
final TextEditingController _userIdController = TextEditingController();
String _userIdError;
String? _userIdError;
final TextEditingController _userTokenController = TextEditingController();
String _userTokenError;
String? _userTokenError;
final TextEditingController _usernameController = TextEditingController();
@@ -73,7 +73,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
}
},
validator: (value) {
if (value.isEmpty) {
if (value!.isEmpty) {
setState(() {
_apiKeyError =
'Please enter the Chat API Key'.toUpperCase();
@@ -119,7 +119,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
}
},
validator: (value) {
if (value.isEmpty) {
if (value!.isEmpty) {
setState(() {
_userIdError =
'Please enter the User ID'.toUpperCase();
@@ -165,7 +165,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
},
controller: _userTokenController,
validator: (value) {
if (value.isEmpty) {
if (value!.isEmpty) {
setState(() {
_userTokenError =
'Please enter the user token'.toUpperCase();
@@ -243,7 +243,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
if (loading) {
return;
}
if (_formKey.currentState.validate()) {
if (_formKey.currentState!.validate()) {
final apiKey = _apiKeyController.text;
final userId = _userIdController.text;
final userToken = _userTokenController.text;