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 readingTag: if-statement
map function returns a list of Unit instead of Char
Issue why this function returns a list of Unit type instead of returning [c,c,c,c] list fun convert(name:String) { val list = name.map { if (it == ‘a’) { return@map } else { it+1 } } println(list) } fun main(args: Array<String>)
Continue readingMy issue is with if else condition is not running correctly
Issue I want to run if else condition but it seems to be an error i don’t know what the error.I also print Correct option it seems to be equal to selected value but it is not running my if
Continue readingFlutter || Check condition inside ListView.builder and use the result outside
Issue i’m quite new to flutter and i have some difficulties to understand some things. I’m using Firebase to store data, and i have a ListView.builder that builds a ListView based on data retrieved from the database. I want that
Continue readingHow to use conditional statement within child attribute for Expanded Widget, Flutter
Issue I want the Expanded widget to change dependent on ‘Button 1’, ‘Button 2′ or "Button 3’ is pressed. The buttons is just text wrapped in a InkWell, I can change this, but it is only for purpose of understanding
Continue readingUnexpected 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 readingHow 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 readingHow can I correctly use If conditionals in onPressed and setState (dart, flutter)
Issue Im supposed to make it so that a different text appears after pressing the floating button, according to the item chosen in the dropdown menu. So, how to connect floating button to the item in dropdown menu? Right now,
Continue readingConditionals bugged on Android Studio with Kotlin
Issue I am teaching a simple comparisons on programming, but I have found something odd when I am trying to list all the natural numbers below 10 that are multiples of 3 or 5, when I add the following conditions
Continue readingHow can I define a boolean value under an if statement
Issue import "dart:io"; import "dart:math"; String promptStudent(){ print("are you a student?"); String Student = stdin.readLineSync()!; return Student; } String promptSmart(){ print("2+2=?"); String Smart = stdin.readLineSync()!; return Smart; } void main() { String student = promptStudent(); if (student == "yes") {
Continue reading