66 lines
1.7 KiB
Dart
66 lines
1.7 KiB
Dart
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:forui/forui.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:pj_supermarket_cloud/common/index.dart';
|
|
|
|
import 'index.dart';
|
|
|
|
class PanelPage extends GetView<PanelController> {
|
|
const PanelPage({super.key});
|
|
|
|
// 主视图
|
|
Widget _buildView() {
|
|
final theme = FTheme.of(Get.context!);
|
|
return SizedBox(
|
|
width: Get.context!.sizes.width * 0.2,
|
|
height: double.infinity,
|
|
child: <Widget>[
|
|
appLogo(),
|
|
Obx(
|
|
() => controller.panelBtnList
|
|
.map((v) {
|
|
if (!v.visible) return SizedBox.shrink();
|
|
return FButton(
|
|
label: Text(
|
|
v.title,
|
|
style: theme.typography.lg.copyWith(
|
|
color: theme.colorScheme.secondary,
|
|
),
|
|
),
|
|
onPress: () => controller.doBtn(v.type),
|
|
).marginOnly(bottom: 20.h);
|
|
})
|
|
.toList()
|
|
.toColumn(),
|
|
),
|
|
]
|
|
.toColumnSpace(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.max,
|
|
space: 20.h,
|
|
)
|
|
.scrollable()
|
|
.center(),
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetBuilder<PanelController>(
|
|
init: PanelController(),
|
|
id: "panel",
|
|
builder: (_) {
|
|
return FScaffold(
|
|
header: FHeader(title: SizedBox.shrink()),
|
|
content: _buildView(),
|
|
contentPad: true,
|
|
resizeToAvoidBottomInset: false,
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|