This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Azure Static Web Apps CI/CD | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HoverTest extends StatefulWidget { | |
const HoverTest({Key? key}) : super(key: key); | |
@override | |
State<HoverTest> createState() => _State(); | |
} | |
class _State extends State<HoverTest> with SingleTickerProviderStateMixin { | |
late AnimationController controller; | |
late Animation<double> myAnimation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomClass { | |
final String id; | |
final int number; | |
CustomClass({required this.id, required this.number}); | |
factory CustomClass.fromJson(Map<String, dynamic> json){ | |
return CustomClass( | |
id: json.containsKey("id") ? json["id"] : "", | |
number: json.containsKey("number") ? json["number"] : 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _buildContent() { | |
return SizedBox( | |
height: widget.useLargeFonts ? 300 : 200, | |
child: LineChart(LineChartData( | |
// why 1? We scale all values to the interval from 0 (lowest values) to 1 (highest value). | |
// The axis descriptions and horizontal lines will be at 0, 0.25, 0.5, 0.75, and 1 | |
maxY: 1, | |
gridData: gridData, | |
borderData: borderData, | |
titlesData: FlTitlesData( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static List<double> getSalesAxisValues(double maxSalesValue) { | |
// find a good axis description range | |
// we either display 3 values or 5 depending on the maximum of the data | |
if (maxSalesValue < 10) { | |
return [0, 5, 10]; | |
} else if (maxSalesValue < 20) { | |
return [0, 10, 20]; | |
} else if (maxSalesValue < 50) { | |
return [0, 25, 50]; | |
} else if (maxSalesValue < 100) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FlGridData get gridData => const FlGridData( | |
show: true, horizontalInterval: 0.25, verticalInterval: 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<LineTooltipItem?> _buildTooltip(List<LineBarSpot> spots) { | |
// this is the position of the spot where the tooltip should appear | |
final index = spots.first.spotIndex; | |
// find the matching date description for the value | |
// we just create all axis titles again and grab the one at the correct index | |
final allDateStrings = ChartUtils.getMonths(widget.data.length); | |
final dateString = allDateStrings.isEmpty ? "" : allDateStrings[index]; | |
return [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
topTitles: const AxisTitles(sideTitles: SideTitles(showTitles: false)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AxisTitles get rightAxisTitles => AxisTitles( | |
sideTitles: SideTitles( | |
showTitles: true, | |
reservedSize: 60, | |
interval: 0.25, | |
getTitlesWidget: (val, meta) => ...)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AxisTitles get bottomAxisTitles => AxisTitles( | |
sideTitles: SideTitles( | |
showTitles: true, | |
interval: 1, | |
getTitlesWidget: (val, meta) => ..., | |
reservedSize: 42)); |
NewerOlder