mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 17:26:35 +00:00
Update breaking fl_chart dependency
This commit is contained in:
parent
073b7bfcb6
commit
bef625a934
|
@ -35,9 +35,7 @@ class CpuChart extends StatelessWidget {
|
||||||
spots: getSpots(),
|
spots: getSpots(),
|
||||||
isCurved: true,
|
isCurved: true,
|
||||||
barWidth: 1,
|
barWidth: 1,
|
||||||
colors: [
|
color: Colors.red,
|
||||||
Colors.red,
|
|
||||||
],
|
|
||||||
dotData: FlDotData(
|
dotData: FlDotData(
|
||||||
show: false,
|
show: false,
|
||||||
),
|
),
|
||||||
|
@ -47,28 +45,45 @@ class CpuChart extends StatelessWidget {
|
||||||
maxY: 100,
|
maxY: 100,
|
||||||
minX: data.length - 200,
|
minX: data.length - 200,
|
||||||
titlesData: FlTitlesData(
|
titlesData: FlTitlesData(
|
||||||
topTitles: SideTitles(showTitles: false),
|
topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
|
||||||
bottomTitles: SideTitles(
|
bottomTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
interval: 20,
|
interval: 20,
|
||||||
rotateAngle: 90.0,
|
reservedSize: 50,
|
||||||
showTitles: true,
|
getTitlesWidget: (value, titleMeta) {
|
||||||
getTextStyles: (_, __) => const TextStyle(
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: RotatedBox(
|
||||||
|
child: Text(bottomTitle(value.toInt()),
|
||||||
|
style: TextStyle(
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
color: Colors.purple,
|
color: Colors.purple,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
)),
|
||||||
|
quarterTurns: 1,
|
||||||
),
|
),
|
||||||
getTitles: (value) {
|
);
|
||||||
return bottomTitle(value.toInt());
|
},
|
||||||
}),
|
showTitles: true,
|
||||||
leftTitles: SideTitles(
|
),
|
||||||
getTextStyles: (_, __) => progressTextStyleLight.copyWith(
|
),
|
||||||
|
leftTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
getTitlesWidget: (value, titleMeta) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(right: 15),
|
||||||
|
child: Text(
|
||||||
|
value.toInt().toString(),
|
||||||
|
style: progressTextStyleLight.copyWith(
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
? BrandColors.gray4
|
? BrandColors.gray4
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
margin: 15,
|
));
|
||||||
|
},
|
||||||
interval: 25,
|
interval: 25,
|
||||||
showTitles: true,
|
showTitles: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
gridData: FlGridData(show: true),
|
gridData: FlGridData(show: true),
|
||||||
|
|
|
@ -44,7 +44,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
spots: getSpots(listData[0]),
|
spots: getSpots(listData[0]),
|
||||||
isCurved: true,
|
isCurved: true,
|
||||||
barWidth: 1,
|
barWidth: 1,
|
||||||
colors: [Colors.red],
|
color: Colors.red,
|
||||||
dotData: FlDotData(
|
dotData: FlDotData(
|
||||||
show: false,
|
show: false,
|
||||||
),
|
),
|
||||||
|
@ -53,7 +53,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
spots: getSpots(listData[1]),
|
spots: getSpots(listData[1]),
|
||||||
isCurved: true,
|
isCurved: true,
|
||||||
barWidth: 1,
|
barWidth: 1,
|
||||||
colors: [Colors.green],
|
color: Colors.green,
|
||||||
dotData: FlDotData(
|
dotData: FlDotData(
|
||||||
show: false,
|
show: false,
|
||||||
),
|
),
|
||||||
|
@ -67,34 +67,51 @@ class NetworkChart extends StatelessWidget {
|
||||||
1.2,
|
1.2,
|
||||||
minX: listData[0].length - 200,
|
minX: listData[0].length - 200,
|
||||||
titlesData: FlTitlesData(
|
titlesData: FlTitlesData(
|
||||||
topTitles: SideTitles(showTitles: false),
|
topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
|
||||||
bottomTitles: SideTitles(
|
bottomTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
interval: 20,
|
interval: 20,
|
||||||
rotateAngle: 90.0,
|
reservedSize: 50,
|
||||||
showTitles: true,
|
getTitlesWidget: (value, titleMeta) {
|
||||||
getTextStyles: (_, __) => const TextStyle(
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: RotatedBox(
|
||||||
|
child: Text(bottomTitle(value.toInt()),
|
||||||
|
style: TextStyle(
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
color: Colors.purple,
|
color: Colors.purple,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
)),
|
||||||
|
quarterTurns: 1,
|
||||||
),
|
),
|
||||||
getTitles: (value) {
|
);
|
||||||
return bottomTitle(value.toInt());
|
},
|
||||||
}),
|
showTitles: true,
|
||||||
leftTitles: SideTitles(
|
),
|
||||||
|
),
|
||||||
|
leftTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
reservedSize: 50,
|
reservedSize: 50,
|
||||||
margin: 5,
|
getTitlesWidget: (value, titleMeta) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(right: 5),
|
||||||
|
child: Text(
|
||||||
|
value.toInt().toString(),
|
||||||
|
style: progressTextStyleLight.copyWith(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? BrandColors.gray4
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
interval: [
|
interval: [
|
||||||
...listData[0].map((e) => e.value),
|
...listData[0].map((e) => e.value),
|
||||||
...listData[1].map((e) => e.value)
|
...listData[1].map((e) => e.value)
|
||||||
].reduce(max) *
|
].reduce(max) *
|
||||||
2 /
|
2 /
|
||||||
10,
|
10,
|
||||||
getTextStyles: (_, __) => progressTextStyleLight.copyWith(
|
showTitles: false,
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
|
||||||
? BrandColors.gray4
|
|
||||||
: null,
|
|
||||||
),
|
),
|
||||||
showTitles: true,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
gridData: FlGridData(show: true),
|
gridData: FlGridData(show: true),
|
||||||
|
|
|
@ -301,7 +301,7 @@ packages:
|
||||||
name: fl_chart
|
name: fl_chart
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.45.0"
|
version: "0.50.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
@ -17,7 +17,7 @@ dependencies:
|
||||||
easy_localization: ^3.0.0
|
easy_localization: ^3.0.0
|
||||||
either_option: ^2.0.1-dev.1
|
either_option: ^2.0.1-dev.1
|
||||||
equatable: ^2.0.3
|
equatable: ^2.0.3
|
||||||
fl_chart: ^0.45.0
|
fl_chart: ^0.50.1
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_bloc: ^8.0.1
|
flutter_bloc: ^8.0.1
|
||||||
|
|
Loading…
Reference in a new issue