feat:副屏页面
This commit is contained in:
1 parent
646912236e
commit
c02c01b442
15 files changed
+117
-17
No files matched your search
+1
-8
@@ -16,14 +16,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
private static final int DATABASE_VERSION = 1;
|
||||
|
||||
public DatabaseHelper(Context context) {
|
||||
super(context, getCustomDatabasePath(context), null, DATABASE_VERSION);
|
||||
}
|
||||
|
||||
private static String getCustomDatabasePath(Context context) {
|
||||
File documentsDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS);
|
||||
File dbDir = new File(documentsDir, "pj/database");
|
||||
if (!dbDir.exists()) dbDir.mkdirs();
|
||||
return new File(dbDir, DATABASE_NAME).getAbsolutePath();
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,5 @@ class MainActivity : FlutterActivity() {
|
||||
// 人脸识别插件
|
||||
val flutterFaceDiscernPlugin = FlutterFaceDiscernPlugin()
|
||||
flutterEngine.plugins.add(flutterFaceDiscernPlugin)
|
||||
|
||||
// 键盘全局键盘插件
|
||||
}
|
||||
}
|
||||
@@ -77,11 +77,11 @@ class FaceManageController extends GetxController {
|
||||
Toast.error(msg: "请先绑定设备");
|
||||
return;
|
||||
}
|
||||
// final isActive = await AppFaceTool.isActiveSdk();
|
||||
// if (!isActive) {
|
||||
// Toast.error(msg: "人脸sdk激活失败");
|
||||
// return;
|
||||
// }
|
||||
final isActive = await AppFaceTool.isActiveSdk();
|
||||
if (!isActive) {
|
||||
Toast.error(msg: "人脸sdk激活失败");
|
||||
return;
|
||||
}
|
||||
final isSure = await appMessageDialog(
|
||||
Get.context!,
|
||||
"是否同步所有人脸,这个过程可能比较长",
|
||||
@@ -121,8 +121,7 @@ class FaceManageController extends GetxController {
|
||||
try {
|
||||
final faceDao = appC.dataBase.getFaceDao;
|
||||
await faceDao.delAll();
|
||||
final bool = await AppFaceTool.removeFace(sampleId: "-1");
|
||||
logger.i(bool);
|
||||
await AppFaceTool.removeFace(sampleId: "-1");
|
||||
} finally {
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
getFaceList();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
library sub_common;
|
||||
|
||||
export './key/index.dart';
|
||||
|
||||
export './routers/index.dart';
|
||||
|
||||
export './utils/index.dart';
|
||||
|
||||
export './values/constants.dart';
|
||||
@@ -0,0 +1,3 @@
|
||||
library sub_key;
|
||||
|
||||
export './navigator_key.dart';
|
||||
@@ -0,0 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
abstract class SubNavigatorKey {
|
||||
static GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
library sub_router;
|
||||
|
||||
export './names.dart';
|
||||
@@ -0,0 +1,7 @@
|
||||
class SubRouteNames {
|
||||
/// 商品页面
|
||||
static const subProduct = '/sub_product';
|
||||
|
||||
/// 首页
|
||||
static const root = '/';
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
library sub_utils;
|
||||
|
||||
export './sub_page_tool.dart';
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
import 'package:pj_supermarket_cloud/sub_screen/common/index.dart';
|
||||
|
||||
class SubPageToool {
|
||||
void switchJump(SubScreenAction type) {
|
||||
switch (type) {
|
||||
case SubScreenAction.jumpSubPage:
|
||||
SubNavigatorKey.navigatorKey.currentState?.pushNamedAndRemoveUntil(
|
||||
SubRouteNames.subProduct,
|
||||
(Route<dynamic> route) => false,
|
||||
);
|
||||
break;
|
||||
case SubScreenAction.jumpSubBack:
|
||||
SubNavigatorKey.navigatorKey.currentState?.pushNamedAndRemoveUntil(
|
||||
SubRouteNames.root,
|
||||
(Route<dynamic> route) => false,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
||||
library sub_values;
|
||||
|
||||
export './constants.dart';
|
||||
@@ -0,0 +1,4 @@
|
||||
library sub_page;
|
||||
|
||||
export './sub_app.dart';
|
||||
export './sub_product.dart';
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:forui/forui.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/sub_screen/page/index.dart';
|
||||
import 'package:pj_supermarket_cloud/sub_screen/common/index.dart';
|
||||
|
||||
class SubAppPage extends StatefulWidget {
|
||||
const SubAppPage({super.key});
|
||||
|
||||
@override
|
||||
State<SubAppPage> createState() => _SubAppPageState();
|
||||
}
|
||||
|
||||
class _SubAppPageState extends State<SubAppPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = FTheme.of(context);
|
||||
return MaterialApp(
|
||||
navigatorKey: SubNavigatorKey.navigatorKey,
|
||||
debugShowCheckedModeBanner: false,
|
||||
routes: {
|
||||
SubRouteNames.subProduct: (context) => const SubProductPage(),
|
||||
},
|
||||
home: Scaffold(
|
||||
backgroundColor: theme.colorScheme.background,
|
||||
body: Text(
|
||||
'SubApp',
|
||||
style: theme.typography.xl4,
|
||||
).center(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class SubProductPage extends StatefulWidget {
|
||||
const SubProductPage({super.key});
|
||||
|
||||
@override
|
||||
State<SubProductPage> createState() => _SubProductPageState();
|
||||
}
|
||||
|
||||
class _SubProductPageState extends State<SubProductPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user