240 lines
8.0 KiB
Dart
240 lines
8.0 KiB
Dart
// import 'package:flutter/cupertino.dart';
|
|
// import 'package:flutter/material.dart';
|
|
// import 'package:flutter/src/widgets/framework.dart';
|
|
// import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
// import 'package:google_fonts/google_fonts.dart';
|
|
//
|
|
// import '../../../../data/models/bar_data.dart';
|
|
// import '../../../themes/charts/barChart.dart';
|
|
//
|
|
// class BussinessDashboard extends ConsumerStatefulWidget {
|
|
// const BussinessDashboard({super.key});
|
|
//
|
|
// @override
|
|
// ConsumerState<BussinessDashboard> createState() => _BussinessDashboardState();
|
|
// }
|
|
//
|
|
// class _BussinessDashboardState extends ConsumerState<BussinessDashboard> {
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// final data = [
|
|
// BarData(Colors.blue, 10, 8),
|
|
// BarData(Colors.orange, 12, 10),
|
|
// BarData(Colors.green, 8, 5),
|
|
// ];
|
|
//
|
|
// return Container(
|
|
// margin: EdgeInsets.all(10),
|
|
// // color: Colors.white,
|
|
// // color: Colors.amber.shade100,
|
|
// child: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// children: [
|
|
// // Text('PRODUCT WISE', style: _headerStyle2),
|
|
// Row(
|
|
// children: [
|
|
// Expanded(
|
|
// child: Container(
|
|
// padding: EdgeInsets.all(20.0),
|
|
// margin: EdgeInsets.only(right: 20),
|
|
// decoration: BoxDecoration(
|
|
// color: Color(0XFFFFFFFF),
|
|
// borderRadius: BorderRadius.circular(10),
|
|
// ),
|
|
//
|
|
// // width: MediaQuery.of(context).size.width * 0.2,
|
|
// height: 200,
|
|
// child: CustomBarChart(
|
|
// dataList: data,
|
|
// labels: ['A', 'B', 'C'],
|
|
// ),
|
|
// ),
|
|
// ),
|
|
//
|
|
// Expanded(
|
|
// child: Container(
|
|
// padding: EdgeInsets.all(20.0),
|
|
// margin: EdgeInsets.only(right: 10),
|
|
// decoration: BoxDecoration(
|
|
// color: Color(0XFFFFFFFF),
|
|
// borderRadius: BorderRadius.circular(10),
|
|
// ),
|
|
// // width: MediaQuery.of(context).size.width * 0.02,
|
|
// height: 200,
|
|
// child: CustomBarChart(
|
|
// dataList: data,
|
|
// labels: ['A', 'B', 'C'],
|
|
// ),
|
|
// ),
|
|
// ),
|
|
//
|
|
// Expanded(
|
|
// child: Container(
|
|
// padding: EdgeInsets.all(20.0),
|
|
// margin: EdgeInsets.only(right: 10),
|
|
// decoration: BoxDecoration(
|
|
// color: Color(0XFFFFFFFF),
|
|
// borderRadius: BorderRadius.circular(10),
|
|
// ),
|
|
// // width: MediaQuery.of(context).size.width * 0.2,
|
|
// height: 200,
|
|
// child: CustomBarChart(
|
|
// dataList: data,
|
|
// labels: ['A', 'B', 'C'],
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ],
|
|
// ),
|
|
//
|
|
// // Column(children: [Text('Insurer WISE', style: _headerStyle2)]),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// }
|
|
// }
|
|
//
|
|
// // class _BussinessDashboardState extends ConsumerState<BussinessDashboard> {
|
|
// // int? expandedIndex; // tracks which container is expanded
|
|
// //
|
|
// // @override
|
|
// // Widget build(BuildContext context) {
|
|
// // final data = [
|
|
// // BarData(Colors.blue, 10, 8),
|
|
// // BarData(Colors.orange, 12, 10),
|
|
// // BarData(Colors.green, 8, 5),
|
|
// // ];
|
|
// //
|
|
// // return Container(
|
|
// // margin: EdgeInsets.all(10),
|
|
// // child: Column(
|
|
// // crossAxisAlignment: CrossAxisAlignment.start,
|
|
// // children: [
|
|
// // Text('PRODUCT WISE', style: _headerStyle2),
|
|
// //
|
|
// // SizedBox(height: 10),
|
|
// //
|
|
// // // If a container is expanded → show only that container
|
|
// // if (expandedIndex != null)
|
|
// // _buildExpandedItem(context, expandedIndex!, data)
|
|
// // else
|
|
// // Row(
|
|
// // children: [
|
|
// // _buildChartItem(
|
|
// // context,
|
|
// // 0,
|
|
// // data,
|
|
// // margin: EdgeInsets.only(right: 20),
|
|
// // ),
|
|
// // _buildChartItem(
|
|
// // context,
|
|
// // 1,
|
|
// // data,
|
|
// // margin: EdgeInsets.only(right: 20),
|
|
// // ),
|
|
// // _buildChartItem(
|
|
// // context,
|
|
// // 2,
|
|
// // data,
|
|
// // margin: EdgeInsets.only(right: 10),
|
|
// // ),
|
|
// // ],
|
|
// // ),
|
|
// //
|
|
// // SizedBox(height: 20),
|
|
// // Text('INSURER WISE', style: _headerStyle2),
|
|
// // if (expandedIndex != null)
|
|
// // _buildExpandedItem(context, expandedIndex!, data)
|
|
// // else
|
|
// // Row(
|
|
// // children: [
|
|
// // _buildChartItem(
|
|
// // context,
|
|
// // 3,
|
|
// // data,
|
|
// // margin: EdgeInsets.only(right: 20),
|
|
// // ),
|
|
// // _buildChartItem(
|
|
// // context,
|
|
// // 4,
|
|
// // data,
|
|
// // margin: EdgeInsets.only(right: 20),
|
|
// // ),
|
|
// // _buildChartItem(
|
|
// // context,
|
|
// // 5,
|
|
// // data,
|
|
// // margin: EdgeInsets.only(right: 10),
|
|
// // ),
|
|
// // ],
|
|
// // ),
|
|
// // ],
|
|
// // ),
|
|
// // );
|
|
// // }
|
|
// //
|
|
// // // 🔵 Regular item in row
|
|
// // Widget _buildChartItem(
|
|
// // BuildContext context,
|
|
// // int index,
|
|
// // List<BarData> data, {
|
|
// // EdgeInsets margin = EdgeInsets.zero,
|
|
// // }) {
|
|
// // return Expanded(
|
|
// // child: GestureDetector(
|
|
// // onTap: () {
|
|
// // setState(() {
|
|
// // expandedIndex = index; // expand clicked chart
|
|
// // });
|
|
// // },
|
|
// // child: Container(
|
|
// // padding: EdgeInsets.all(20),
|
|
// // margin: margin,
|
|
// // decoration: BoxDecoration(
|
|
// // color: Colors.white,
|
|
// // borderRadius: BorderRadius.circular(10),
|
|
// // ),
|
|
// // height: 200,
|
|
// // child: CustomBarChart(dataList: data, labels: ['A', 'B', 'C']),
|
|
// // ),
|
|
// // ),
|
|
// // );
|
|
// // }
|
|
// //
|
|
// // // 🔵 Expanded full screen widget
|
|
// // Widget _buildExpandedItem(
|
|
// // BuildContext context,
|
|
// // int index,
|
|
// // List<BarData> data,
|
|
// // ) {
|
|
// // return GestureDetector(
|
|
// // onTap: () {
|
|
// // setState(() {
|
|
// // expandedIndex = null; // collapse back to row
|
|
// // });
|
|
// // },
|
|
// // child: Container(
|
|
// // width: double.infinity,
|
|
// // height: MediaQuery.of(context).size.height * 0.6,
|
|
// // padding: EdgeInsets.all(20),
|
|
// // decoration: BoxDecoration(
|
|
// // color: Colors.white,
|
|
// // borderRadius: BorderRadius.circular(10),
|
|
// // ),
|
|
// // child: CustomBarChart(dataList: data, labels: ['A', 'B', 'C']),
|
|
// // ),
|
|
// // );
|
|
// // }
|
|
// // }
|
|
//
|
|
// final _headerStyle2 = GoogleFonts.poppins(
|
|
// fontSize: 12,
|
|
// color: Colors.black,
|
|
// fontWeight: FontWeight.w500,
|
|
// );
|