Is there any way to convert this if function to switch case type?

Issue if (textLetter.toLowerCase().contains(‘1’)) { textCodeElec += ‘ 19’; textLetter = textLetter.substring(1); } if (textLetter.toLowerCase().contains(‘2’)) { textCodeElec += ‘ 00’; textLetter = textLetter.substring(1); } if (textLetter.toLowerCase().contains(‘3’)) { textCodeElec += ‘ 70’; textLetter = textLetter.substring(1); } if (textLetter.toLowerCase().contains(‘4’)) { textCodeElec += ‘

Continue reading

Unexpected token else Android Studio

Issue This my code about authentification, but I do not understand why when I run my code "else" display "Unexpected token". username = (EditText) findViewById(R.id.editTextUsername_id); motdepasse = (EditText) findViewById(R.id.editTextPassword_id); signin = (Button) findViewById(R.id.btnSignIn_id); signin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View

Continue reading

How can I run IF conditions after getting the data from the database and not before?

Issue I have this funtion which gets data from a database. Future reg() async { try { getData().then((value) async { Dio dio = Dio(); Response response = await dio.get( ‘http://${value["serverIP"]}:${value["port"]}/${value["passwordMain"]}/reg/${controllerEmail.text}/${controllerPassword.text}/${controllerUsername.text}’); return response; }); } catch (e) {} } Now I

Continue reading