ios added phone/card switch
This commit is contained in:
@@ -104,8 +104,18 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
} else if (call.method == 'findUserAndPurchase') {
|
||||
|
||||
var userResponse;
|
||||
print(call.arguments[1]);
|
||||
|
||||
try {
|
||||
userResponse = await getUserByCard(call.arguments[0],token);
|
||||
switch (call.arguments[1]) {
|
||||
case 'card':
|
||||
userResponse = await getUserByCard(call.arguments[0],token);
|
||||
break;
|
||||
case 'phone':
|
||||
userResponse = await getUserByPhone(call.arguments[0],token);
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
print(error.toString());
|
||||
}
|
||||
@@ -127,13 +137,8 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
print(userString);
|
||||
print(card);
|
||||
pushRoute(context, new PurchaseScreen(helper, app, JSON.encode(users[0]), card));
|
||||
// var route = new MaterialPageRoute<Null>(
|
||||
// builder: (BuildContext context) =>
|
||||
// new PurchaseScreen(helper, app,));
|
||||
// while (Navigator.of(context).canPop()) {
|
||||
// Navigator.of(context).pop();
|
||||
// }
|
||||
// Navigator.of(context).pushReplacement(route);
|
||||
} else {
|
||||
throw new FlutterError("Users not found");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user