Add horizontal scrollbars to dashboard panels
This commit is contained in:
parent
eeed8276ca
commit
9e89e6cc24
|
|
@ -43,6 +43,21 @@ class DashboardChart extends StatefulWidget {
|
||||||
class _DashboardChartState extends State<DashboardChart> {
|
class _DashboardChartState extends State<DashboardChart> {
|
||||||
String? _selected;
|
String? _selected;
|
||||||
int _selectedIndex = 0;
|
int _selectedIndex = 0;
|
||||||
|
late ScrollController _controller;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
_controller = ScrollController();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
void _onSelectionChanged(charts.SelectionModel model) {
|
void _onSelectionChanged(charts.SelectionModel model) {
|
||||||
if (widget.onDateSelected == null) {
|
if (widget.onDateSelected == null) {
|
||||||
|
|
@ -139,9 +154,12 @@ class _DashboardChartState extends State<DashboardChart> {
|
||||||
Divider(height: 1.0),
|
Divider(height: 1.0),
|
||||||
LimitedBox(
|
LimitedBox(
|
||||||
maxHeight: settings.enableComparison ? 122 : 102,
|
maxHeight: settings.enableComparison ? 122 : 102,
|
||||||
|
child: Scrollbar(
|
||||||
|
controller: _controller,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
|
controller: _controller,
|
||||||
children: widget.data!.map((dataGroup) {
|
children: widget.data!.map((dataGroup) {
|
||||||
final int index = widget.data!.indexOf(dataGroup);
|
final int index = widget.data!.indexOf(dataGroup);
|
||||||
final bool isSelected = index == _selectedIndex;
|
final bool isSelected = index == _selectedIndex;
|
||||||
|
|
@ -217,6 +235,7 @@ class _DashboardChartState extends State<DashboardChart> {
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Divider(height: 1.0),
|
Divider(height: 1.0),
|
||||||
],
|
],
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue