If_Else_Dart

 import "dart:io";


class User {
var uname, password, mobileno, uname1, password1, mobileno1;
void registration(String a, int b, int c) {
uname = a;
password = b;
mobileno = c;
}
void login(String x, int y, int z) {
uname1 = x;
password1 = y;
mobileno1 = z;
if(uname1 == uname && password1 == password && mobileno1 == mobileno) {
print("Login Successfully completed, Congratulations!");
print("Please Enter your Ege : ");
var age = stdin.readLineSync();
if(int.parse(age!) >= 18) {
print("Which Vehicle you had driving ?");
print("Two Wheeler");
print("Four Wheeler");
var wheel = stdin.readLineSync();
if(wheel == "Two Wheeler") {
print("Now you are perfectly Eligible for Voting because Four Wheel is dangerous for accident");
print("Please Select your Nationality from below Options : ");
print("Indian\nPakistani\nCanadian\nRussian\nAmerican\nArabi");
var nation = stdin.readLineSync();
if(nation == "Indian") {
print("You are Eligible because you are Indian");
print("Which party you will select for Voting from below");
print("BJP\nCongress\nAAP\nBSP\nOther party");
var party = stdin.readLineSync();
if(party == "BJP") {
print("Your Voting in BJP");
} else if(party == "Congress") {
print("Your Voting in Congress");
} else if(party == "AAP") {
print("Your Voting in AAP");
} else if(party == "BSP") {
print("Your Voting in BSP");
} else {
print("Your Voting in Other party");
}
} else {
print("Sorry, you are not Eligible because you are not Indian");
}
} else {
print("Sorry, you are not Eligible for Voting");
}
} else {
print("You are Not Eligible for Voting!");
}
} else {
print("Oops, Login Failed!");
}
}
}
void main() {
User userObject = new User(); // Creating object of class

print("Please Enter Username : ");
var us = stdin.readLineSync();
print("Please Enter Password : ");
var pa = stdin.readLineSync();
print("Please Enter Mobile Number : ");
var mo = stdin.readLineSync();
print("Registration Successfully completed!");
userObject.registration(us!, int.parse(pa!), int.parse(mo!));

print("Please Enter Username : ");
var us1 = stdin.readLineSync();
print("Please Enter Password : ");
var pa1 = stdin.readLineSync();
print("Please Enter Mobile Number : ");
var mo1 = stdin.readLineSync();
userObject.login(us1!, int.parse(pa1!), int.parse(mo1!));
}

Comments

Popular posts from this blog

Second GET API Calling with Bloc simple Example in Flutter

Pagination with Bloc Pattern in Flutter

If_Else_Example