|
@@ -42,145 +42,145 @@ class ReportFinancePage extends BaseStatelessPage<ReportFinanceController> {
|
|
|
Widget buildWidget(BuildContext context) {
|
|
|
return autoCtlGetBuilder(builder: (controller) {
|
|
|
return Scaffold(
|
|
|
- extendBodyBehindAppBar: true,
|
|
|
- appBar: MyAppBar.appBar(context, "Finance Report".tr),
|
|
|
- body: SafeArea(
|
|
|
- bottom: false,
|
|
|
- top: false,
|
|
|
- child: Container(
|
|
|
- width: double.infinity,
|
|
|
- height: double.infinity,
|
|
|
- padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
|
|
|
- decoration: const BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- Color(0xFF091D44),
|
|
|
- Color(0xFF245A8A),
|
|
|
- Color(0xFF7F7CEC),
|
|
|
- ],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- ),
|
|
|
- ),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- // 时间筛选
|
|
|
- Container(
|
|
|
- width: double.infinity,
|
|
|
- height: 36,
|
|
|
- margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
- borderRadius: BorderRadius.circular(20.0), // 设置圆角
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- DateTimeUtils.formatDate(state.startDateTime, format: "yyyy-MM-dd"),
|
|
|
- hint: "Start Date".tr,
|
|
|
- textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
- fontSize: 15,
|
|
|
- textAlign: TextAlign.center,
|
|
|
- isFontRegular: true,
|
|
|
- onClick: controller.pickerStartDate,
|
|
|
- textColor: ColorConstants.textGrayAECAE5,
|
|
|
- ).expanded(),
|
|
|
- Container(color: ColorConstants.dividerBar, height: 21.5, width: 0.5),
|
|
|
- MyTextView(
|
|
|
- DateTimeUtils.formatDate(state.endDateTime, format: "yyyy-MM-dd"),
|
|
|
- hint: "End Date".tr,
|
|
|
- textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
- fontSize: 15,
|
|
|
- textAlign: TextAlign.center,
|
|
|
- isFontRegular: true,
|
|
|
- onClick: controller.pickerEndDate,
|
|
|
- textColor: ColorConstants.textGrayAECAE5,
|
|
|
- ).expanded(),
|
|
|
- ],
|
|
|
- )),
|
|
|
+ extendBodyBehindAppBar: true,
|
|
|
+ appBar: MyAppBar.appBar(context, "Finance Report".tr),
|
|
|
+ body: SafeArea(
|
|
|
+ bottom: MediaQuery.of(context).padding.bottom > 38,
|
|
|
+ top: false,
|
|
|
+ child: Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: double.infinity,
|
|
|
+ padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [
|
|
|
+ Color(0xFF091D44),
|
|
|
+ Color(0xFF245A8A),
|
|
|
+ Color(0xFF7F7CEC),
|
|
|
+ ],
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ // 时间筛选
|
|
|
+ Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: 36,
|
|
|
+ margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
+ borderRadius: BorderRadius.circular(20.0), // 设置圆角
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ DateTimeUtils.formatDate(state.startDateTime, format: "yyyy-MM-dd"),
|
|
|
+ hint: "Start Date".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 15,
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ isFontRegular: true,
|
|
|
+ onClick: controller.pickerStartDate,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ ).expanded(),
|
|
|
+ Container(color: ColorConstants.dividerBar, height: 21.5, width: 0.5),
|
|
|
+ MyTextView(
|
|
|
+ DateTimeUtils.formatDate(state.endDateTime, format: "yyyy-MM-dd"),
|
|
|
+ hint: "End Date".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 15,
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ isFontRegular: true,
|
|
|
+ onClick: controller.pickerEndDate,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ )),
|
|
|
|
|
|
- //总数据
|
|
|
- Container(
|
|
|
- margin: const EdgeInsets.only(left: 15, right: 15),
|
|
|
- width: double.infinity,
|
|
|
- height: 45,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
- borderRadius: BorderRadius.circular(5), // 设置圆角
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- "Total RQST:",
|
|
|
- fontSize: 14,
|
|
|
- isFontRegular: true,
|
|
|
- onClick: controller.pickerStartDate,
|
|
|
- textColor: ColorConstants.textGrayAECAE5,
|
|
|
- ),
|
|
|
- MyTextView(
|
|
|
- state.entity?.requestTotal.toString() ?? "",
|
|
|
- fontSize: 14,
|
|
|
- marginLeft: 5,
|
|
|
- isFontRegular: true,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ).expanded(),
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- "Total Actual:",
|
|
|
- fontSize: 14,
|
|
|
- isFontRegular: true,
|
|
|
- onClick: controller.pickerStartDate,
|
|
|
- textColor: ColorConstants.textGrayAECAE5,
|
|
|
- ),
|
|
|
- MyTextView(
|
|
|
- state.entity?.actualTotal.toString() ?? "",
|
|
|
- fontSize: 14,
|
|
|
- marginLeft: 5,
|
|
|
- isFontRegular: true,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ).expanded(),
|
|
|
- ],
|
|
|
- )),
|
|
|
+ //总数据
|
|
|
+ Container(
|
|
|
+ margin: const EdgeInsets.only(left: 15, right: 15),
|
|
|
+ width: double.infinity,
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
+ borderRadius: BorderRadius.circular(5), // 设置圆角
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "Total RQST:",
|
|
|
+ fontSize: 14,
|
|
|
+ isFontRegular: true,
|
|
|
+ onClick: controller.pickerStartDate,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ ),
|
|
|
+ MyTextView(
|
|
|
+ state.entity?.requestTotal.toString() ?? "",
|
|
|
+ fontSize: 14,
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).expanded(),
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "Total Actual:",
|
|
|
+ fontSize: 14,
|
|
|
+ isFontRegular: true,
|
|
|
+ onClick: controller.pickerStartDate,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ ),
|
|
|
+ MyTextView(
|
|
|
+ state.entity?.actualTotal.toString() ?? "",
|
|
|
+ fontSize: 14,
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ )),
|
|
|
|
|
|
- //动态列表
|
|
|
- LoadStateLayout(
|
|
|
- state: controller.loadingState,
|
|
|
- errorMessage: controller.errorMessage,
|
|
|
- errorRetry: () {
|
|
|
- controller.retryRequest();
|
|
|
- },
|
|
|
- successSliverWidget: [
|
|
|
- SliverGrid(
|
|
|
- delegate: SliverChildBuilderDelegate(
|
|
|
- (context, index) {
|
|
|
- return ReportFinanceItem(item: state.datas[index]);
|
|
|
- },
|
|
|
- childCount: state.datas.length,
|
|
|
- ),
|
|
|
- gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
- crossAxisCount: 2, // 每行2个项目
|
|
|
- mainAxisSpacing: 8.5, // 主轴方向的间距
|
|
|
- crossAxisSpacing: 9.5, // 交叉轴方向的间距
|
|
|
- childAspectRatio: 168.16 / 107.22, // 子项目的宽高比
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ).marginOnly(left: 15, right: 15, top: 10).expanded(),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
+ //动态列表
|
|
|
+ LoadStateLayout(
|
|
|
+ state: controller.loadingState,
|
|
|
+ errorMessage: controller.errorMessage,
|
|
|
+ errorRetry: () {
|
|
|
+ controller.retryRequest();
|
|
|
+ },
|
|
|
+ successSliverWidget: [
|
|
|
+ SliverGrid(
|
|
|
+ delegate: SliverChildBuilderDelegate(
|
|
|
+ (context, index) {
|
|
|
+ return ReportFinanceItem(item: state.datas[index]);
|
|
|
+ },
|
|
|
+ childCount: state.datas.length,
|
|
|
+ ),
|
|
|
+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
+ crossAxisCount: 2, // 每行2个项目
|
|
|
+ mainAxisSpacing: 8.5, // 主轴方向的间距
|
|
|
+ crossAxisSpacing: 9.5, // 交叉轴方向的间距
|
|
|
+ childAspectRatio: 168.16 / 107.22, // 子项目的宽高比
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ).marginOnly(left: 15, right: 15, top: 10).expanded(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
);
|
|
|
});
|
|
|
}
|