110 lines
3.8 KiB
Dart
110 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
|
import 'package:vbvs_app/enum/APPPackageType.dart';
|
|
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
|
|
|
class TrendDataTablePage extends StatefulWidget {
|
|
final String title;
|
|
final String tipText;
|
|
final Widget? chartContent;
|
|
final double? padding;
|
|
|
|
const TrendDataTablePage({
|
|
Key? key,
|
|
required this.title,
|
|
required this.tipText,
|
|
required this.chartContent,
|
|
required this.padding,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
State<TrendDataTablePage> createState() => _TrendDataTablePageState();
|
|
}
|
|
|
|
class _TrendDataTablePageState extends State<TrendDataTablePage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
color: themeController.currentColor.sc5,
|
|
borderRadius: BorderRadius.circular(25.rpx)),
|
|
padding:
|
|
EdgeInsets.fromLTRB(26.rpx, 29.rpx, 26.rpx, widget.padding ?? 45.rpx),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
widget.title,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 30.rpx,
|
|
),
|
|
),
|
|
ClickableContainer(
|
|
backgroundColor: Colors.transparent,
|
|
highlightColor: Colors.white, // 或设置为你需要的水波纹颜色
|
|
padding: EdgeInsetsDirectional.fromSTEB(
|
|
14.rpx, 10.rpx, 14.rpx, 10.rpx), //
|
|
borderRadius: 0.rpx,
|
|
onTap: () {
|
|
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
|
showTipDialog(
|
|
context,
|
|
Container(
|
|
child: Text(
|
|
widget.tipText,
|
|
style: TextStyle(
|
|
fontSize: 26.rpx,
|
|
color: Colors.black,
|
|
),
|
|
),
|
|
),
|
|
backgroundColor: Color(0xFFFFFFFF),
|
|
colors: [
|
|
Color(0XFF1592AA),
|
|
Color(0xFF0C83A7),
|
|
Color(0xFF006FA3)
|
|
],
|
|
);
|
|
} else {
|
|
showTipDialog(
|
|
context,
|
|
Container(
|
|
child: Text(
|
|
widget.tipText,
|
|
style: TextStyle(
|
|
fontSize: 26.rpx,
|
|
color: themeController.currentColor.sc3,
|
|
),
|
|
),
|
|
),
|
|
backgroundColor: themeController.currentColor.sc17,
|
|
colors: AppConstants().thNormalButton,
|
|
);
|
|
}
|
|
},
|
|
child: Container(
|
|
width: 30.rpx,
|
|
height: 30.rpx,
|
|
child: SvgPicture.asset('assets/img/icon/explain.svg',
|
|
color: Color(0xFFD3D3D3)),
|
|
)),
|
|
],
|
|
),
|
|
SizedBox(height: 47.rpx),
|
|
widget.chartContent ?? Container(),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|