Pay number added

This commit is contained in:
2023-08-21 10:01:58 +05:30
parent 5a956623b4
commit 00c5238f6c
4 changed files with 40 additions and 24 deletions

View File

@@ -90,7 +90,8 @@ class _DataManager{
Debug.LogResponse(response.body.toString());
joinedServices = jsonDecode(response.body.toString());
Debug.LogResponse(services);
Debug.LogResponse(services,src:"services");
Debug.LogResponse(joinedServices, src:"joined services");
}catch(e){
Debug.LogError(e);
}
@@ -112,6 +113,8 @@ class _DataManager{
}
}
Debug.LogResponse(JoinedServices, src: "Joined ser");
if(!joined){
AvailableServices.add(service);
}

View File

@@ -21,8 +21,8 @@ class _LoginPageState extends State<LoginPage> {
void initState() {
// TODO: implement initState
super.initState();
// Reset();
AutoLogin();
Reset();
// AutoLogin();
}
void Reset() async{
@@ -81,8 +81,11 @@ class _LoginPageState extends State<LoginPage> {
mainAxisSize: MainAxisSize.min,
children: [
// Text("Login"),
ListTile(title: Text("Enter your Phone Number"),
ListTile(title: Text("Phone Number"),
subtitle: TextField(controller: usernameController,decoration: InputDecoration(hintText: "ex: 0701234567"),),),
ListTile(title: Text("Pay Number"),
subtitle: TextField(controller: passwordController,decoration: InputDecoration(hintText: "ex: 0701234567"),),),
SizedBox(height: 30,),
ElevatedButton(autofocus: true,onPressed: () async{
@@ -101,10 +104,15 @@ class _LoginPageState extends State<LoginPage> {
return;
}
if(passwordController.text.length < 6){
Dialogs.showAlertDialog(context, "Invalid Pay Number", "Pay Number length is invalid");
return;
}
setState(() {
isLogging=true;
});
String results = await DataManager.instance().Login(usernameController.text, usernameController.text);
String results = await DataManager.instance().Login(usernameController.text, passwordController.text);
if(results == "0"){
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context)=>HomePage()));
}else{