48 lines
1.1 KiB
Dart
48 lines
1.1 KiB
Dart
import 'dart:async';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart';
|
|
import 'package:hub/shared/helpers/db_helper.dart';
|
|
|
|
class QrCodePageModel extends FlutterFlowModel<QrCodePageWidget> {
|
|
/// Local state fields for this page.
|
|
|
|
bool isAccess = false;
|
|
|
|
String? key = null;
|
|
|
|
DateTime? time;
|
|
final DatabaseHelper db = DatabaseHelper();
|
|
late final bool isFingerprint;
|
|
late final String userDevUUID;
|
|
|
|
/// State fields for stateful widgets in this page.
|
|
|
|
final unfocusNode = FocusNode();
|
|
|
|
@override
|
|
void initState(BuildContext context) {
|
|
initVariable();
|
|
}
|
|
|
|
Future<void> initVariable() async {
|
|
isFingerprint = await db
|
|
.get(key: 'fingerprint', field: 'value')
|
|
.then((value) => value.toString() == 'true');
|
|
userDevUUID = await db
|
|
.get(key: 'userDevUUID', field: 'value')
|
|
.then((value) => value.toString());
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
unfocusNode.dispose();
|
|
}
|
|
|
|
/// Action blocks.
|
|
Future qrCodeEncoder(
|
|
BuildContext context, {
|
|
required String? key,
|
|
}) async {}
|
|
}
|