update
This commit is contained in:
parent
b13b385cb7
commit
fcecb5aad5
11 changed files with 186 additions and 129 deletions
|
@ -2,9 +2,8 @@ import 'package:cdb_ui/api.dart' as API;
|
|||
import 'package:cdb_ui/pages/expandable_list.dart';
|
||||
import 'package:cdb_ui/pages/flow/active_flow_page.dart';
|
||||
import 'package:cdb_ui/pages/flow/flow_info_page.dart';
|
||||
import 'package:cdb_ui/pages/transaction.dart';
|
||||
import 'package:cdb_ui/pages/supply.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_bar_code_scanner_dialog/qr_bar_code_scanner_dialog.dart';
|
||||
|
||||
class FlowsPage extends StatefulWidget {
|
||||
const FlowsPage({super.key});
|
||||
|
@ -156,24 +155,18 @@ class _FlowsPageState extends State<FlowsPage> {
|
|||
_ => const Text("..."),
|
||||
},
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
// scan flow code
|
||||
QrBarCodeScannerDialog().getScannedQrBarCode(
|
||||
context: context,
|
||||
onCode: (code) {
|
||||
// library is retarded
|
||||
code = code!.replaceFirst("Code scanned = ", "");
|
||||
var code = await scanQRCode(context, title: "Scan Flow Code");
|
||||
|
||||
API.API().getFlow(code).then((flow) {
|
||||
var info = API.API().getFlowInfo(flow.kind);
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return ActiveFlowPage(flow, info);
|
||||
},
|
||||
));
|
||||
});
|
||||
},
|
||||
);
|
||||
API.API().getFlow(code!).then((flow) {
|
||||
var info = API.API().getFlowInfo(flow.kind);
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return ActiveFlowPage(flow, info);
|
||||
},
|
||||
));
|
||||
});
|
||||
},
|
||||
child: const Icon(Icons.qr_code),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue