Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Upgrade to Flutter 3.27.0 #1805

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/lib/presentation/samples/bar/bar_chart_sample1.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:async';
import 'dart:math';

import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/util/extensions/color_extensions.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';

class BarChartSample1 extends StatefulWidget {
Expand All @@ -19,7 +19,7 @@ class BarChartSample1 extends StatefulWidget {
];

final Color barBackgroundColor =
AppColors.contentColorWhite.darken().withOpacity(0.3);
AppColors.contentColorWhite.darken().withValues(alpha: 0.3);
final Color barColor = AppColors.contentColorWhite;
final Color touchedBarColor = AppColors.contentColorGreen;

Expand Down
12 changes: 6 additions & 6 deletions example/lib/presentation/samples/bar/bar_chart_sample2.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/util/extensions/color_extensions.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';

class BarChartSample2 extends StatefulWidget {
Expand Down Expand Up @@ -243,39 +243,39 @@ class BarChartSample2State extends State<BarChartSample2> {
Container(
width: width,
height: 10,
color: Colors.white.withOpacity(0.4),
color: Colors.white.withValues(alpha: 0.4),
),
const SizedBox(
width: space,
),
Container(
width: width,
height: 28,
color: Colors.white.withOpacity(0.8),
color: Colors.white.withValues(alpha: 0.8),
),
const SizedBox(
width: space,
),
Container(
width: width,
height: 42,
color: Colors.white.withOpacity(1),
color: Colors.white.withValues(alpha: 1),
),
const SizedBox(
width: space,
),
Container(
width: width,
height: 28,
color: Colors.white.withOpacity(0.8),
color: Colors.white.withValues(alpha: 0.8),
),
const SizedBox(
width: space,
),
Container(
width: width,
height: 10,
color: Colors.white.withOpacity(0.4),
color: Colors.white.withValues(alpha: 0.4),
),
],
);
Expand Down
4 changes: 2 additions & 2 deletions example/lib/presentation/samples/bar/bar_chart_sample4.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/util/extensions/color_extensions.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';

class BarChartSample4 extends StatefulWidget {
Expand Down Expand Up @@ -103,7 +103,7 @@ class BarChartSample4State extends State<BarChartSample4> {
show: true,
checkToShowHorizontalLine: (value) => value % 10 == 0,
getDrawingHorizontalLine: (value) => FlLine(
color: AppColors.borderColor.withOpacity(0.1),
color: AppColors.borderColor.withValues(alpha: 0.1),
strokeWidth: 1,
),
drawVerticalLine: false,
Expand Down
22 changes: 11 additions & 11 deletions example/lib/presentation/samples/bar/bar_chart_sample5.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/util/app_utils.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';

class BarChartSample5 extends StatefulWidget {
Expand Down Expand Up @@ -221,29 +221,29 @@ class BarChartSample5State extends State<BarChartSample5> {
BarChartRodStackItem(
0,
-value1,
AppColors.contentColorGreen
.withOpacity(isTouched ? shadowOpacity * 2 : shadowOpacity),
AppColors.contentColorGreen.withValues(
alpha: isTouched ? shadowOpacity * 2 : shadowOpacity),
const BorderSide(color: Colors.transparent),
),
BarChartRodStackItem(
-value1,
-(value1 + value2),
AppColors.contentColorYellow
.withOpacity(isTouched ? shadowOpacity * 2 : shadowOpacity),
AppColors.contentColorYellow.withValues(
alpha: isTouched ? shadowOpacity * 2 : shadowOpacity),
const BorderSide(color: Colors.transparent),
),
BarChartRodStackItem(
-(value1 + value2),
-(value1 + value2 + value3),
AppColors.contentColorPink
.withOpacity(isTouched ? shadowOpacity * 2 : shadowOpacity),
AppColors.contentColorPink.withValues(
alpha: isTouched ? shadowOpacity * 2 : shadowOpacity),
const BorderSide(color: Colors.transparent),
),
BarChartRodStackItem(
-(value1 + value2 + value3),
-(value1 + value2 + value3 + value4),
AppColors.contentColorBlue
.withOpacity(isTouched ? shadowOpacity * 2 : shadowOpacity),
AppColors.contentColorBlue.withValues(
alpha: isTouched ? shadowOpacity * 2 : shadowOpacity),
const BorderSide(color: Colors.transparent),
),
],
Expand Down Expand Up @@ -328,12 +328,12 @@ class BarChartSample5State extends State<BarChartSample5> {
getDrawingHorizontalLine: (value) {
if (value == 0) {
return FlLine(
color: AppColors.borderColor.withOpacity(0.1),
color: AppColors.borderColor.withValues(alpha: 0.1),
strokeWidth: 3,
);
}
return FlLine(
color: AppColors.borderColor.withOpacity(0.05),
color: AppColors.borderColor.withValues(alpha: 0.05),
strokeWidth: 0.8,
);
},
Expand Down
6 changes: 3 additions & 3 deletions example/lib/presentation/samples/bar/bar_chart_sample7.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:math' as math;

import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:flutter/material.dart';

class BarChartSample7 extends StatefulWidget {
Expand Down Expand Up @@ -61,7 +61,7 @@ class _BarChartSample7State extends State<BarChartSample7> {
show: true,
border: Border.symmetric(
horizontal: BorderSide(
color: AppColors.borderColor.withOpacity(0.2),
color: AppColors.borderColor.withValues(alpha: 0.2),
),
),
),
Expand Down Expand Up @@ -103,7 +103,7 @@ class _BarChartSample7State extends State<BarChartSample7> {
show: true,
drawVerticalLine: false,
getDrawingHorizontalLine: (value) => FlLine(
color: AppColors.borderColor.withOpacity(0.2),
color: AppColors.borderColor.withValues(alpha: 0.2),
strokeWidth: 1,
),
),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/presentation/samples/bar/bar_chart_sample8.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import 'dart:math';

import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart_app/util/extensions/color_extensions.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';

class BarChartSample8 extends StatefulWidget {
BarChartSample8({super.key});

final Color barBackgroundColor =
AppColors.contentColorWhite.darken().withOpacity(0.3);
AppColors.contentColorWhite.darken().withValues(alpha: 0.3);
final Color barColor = AppColors.contentColorWhite;

@override
Expand Down
22 changes: 12 additions & 10 deletions example/lib/presentation/samples/line/line_chart_sample1.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:flutter/material.dart';

class _LineChart extends StatelessWidget {
Expand Down Expand Up @@ -42,7 +42,8 @@ class _LineChart extends StatelessWidget {
LineTouchData get lineTouchData1 => LineTouchData(
handleBuiltInTouches: true,
touchTooltipData: LineTouchTooltipData(
getTooltipColor: (touchedSpot) => Colors.blueGrey.withOpacity(0.8),
getTooltipColor: (touchedSpot) =>
Colors.blueGrey.withValues(alpha: 0.8),
),
);

Expand Down Expand Up @@ -168,8 +169,8 @@ class _LineChart extends StatelessWidget {
FlBorderData get borderData => FlBorderData(
show: true,
border: Border(
bottom:
BorderSide(color: AppColors.primary.withOpacity(0.2), width: 4),
bottom: BorderSide(
color: AppColors.primary.withValues(alpha: 0.2), width: 4),
left: const BorderSide(color: Colors.transparent),
right: const BorderSide(color: Colors.transparent),
top: const BorderSide(color: Colors.transparent),
Expand Down Expand Up @@ -202,7 +203,7 @@ class _LineChart extends StatelessWidget {
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(
show: false,
color: AppColors.contentColorPink.withOpacity(0),
color: AppColors.contentColorPink.withValues(alpha: 0),
),
spots: const [
FlSpot(1, 1),
Expand Down Expand Up @@ -233,7 +234,7 @@ class _LineChart extends StatelessWidget {
LineChartBarData get lineChartBarData2_1 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: AppColors.contentColorGreen.withOpacity(0.5),
color: AppColors.contentColorGreen.withValues(alpha: 0.5),
barWidth: 4,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
Expand All @@ -251,13 +252,13 @@ class _LineChart extends StatelessWidget {

LineChartBarData get lineChartBarData2_2 => LineChartBarData(
isCurved: true,
color: AppColors.contentColorPink.withOpacity(0.5),
color: AppColors.contentColorPink.withValues(alpha: 0.5),
barWidth: 4,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(
show: true,
color: AppColors.contentColorPink.withOpacity(0.2),
color: AppColors.contentColorPink.withValues(alpha: 0.2),
),
spots: const [
FlSpot(1, 1),
Expand All @@ -272,7 +273,7 @@ class _LineChart extends StatelessWidget {
LineChartBarData get lineChartBarData2_3 => LineChartBarData(
isCurved: true,
curveSmoothness: 0,
color: AppColors.contentColorCyan.withOpacity(0.5),
color: AppColors.contentColorCyan.withValues(alpha: 0.5),
barWidth: 2,
isStrokeCapRound: true,
dotData: const FlDotData(show: true),
Expand Down Expand Up @@ -342,7 +343,8 @@ class LineChartSample1State extends State<LineChartSample1> {
IconButton(
icon: Icon(
Icons.refresh,
color: Colors.white.withOpacity(isShowingMainData ? 1.0 : 0.5),
color:
Colors.white.withValues(alpha: isShowingMainData ? 1.0 : 0.5),
),
onPressed: () {
setState(() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class _LineChartSample10State extends State<LineChartSample10> {
show: false,
),
gradient: LinearGradient(
colors: [widget.sinColor.withOpacity(0), widget.sinColor],
colors: [widget.sinColor.withValues(alpha: 0), widget.sinColor],
stops: const [0.1, 1.0],
),
barWidth: 4,
Expand All @@ -130,7 +130,7 @@ class _LineChartSample10State extends State<LineChartSample10> {
show: false,
),
gradient: LinearGradient(
colors: [widget.cosColor.withOpacity(0), widget.cosColor],
colors: [widget.cosColor.withValues(alpha: 0), widget.cosColor],
stops: const [0.1, 1.0],
),
barWidth: 4,
Expand Down
12 changes: 7 additions & 5 deletions example/lib/presentation/samples/line/line_chart_sample2.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:fl_chart_app/presentation/resources/app_resources.dart';
import 'package:flutter/material.dart';

class LineChartSample2 extends StatefulWidget {
Expand Down Expand Up @@ -48,7 +48,9 @@ class _LineChartSample2State extends State<LineChartSample2> {
'avg',
style: TextStyle(
fontSize: 12,
color: showAvg ? Colors.white.withOpacity(0.5) : Colors.white,
color: showAvg
? Colors.white.withValues(alpha: 0.5)
: Colors.white,
),
),
),
Expand Down Expand Up @@ -184,7 +186,7 @@ class _LineChartSample2State extends State<LineChartSample2> {
show: true,
gradient: LinearGradient(
colors: gradientColors
.map((color) => color.withOpacity(0.3))
.map((color) => color.withValues(alpha: 0.3))
.toList(),
),
),
Expand Down Expand Up @@ -278,10 +280,10 @@ class _LineChartSample2State extends State<LineChartSample2> {
colors: [
ColorTween(begin: gradientColors[0], end: gradientColors[1])
.lerp(0.2)!
.withOpacity(0.1),
.withValues(alpha: 0.1),
ColorTween(begin: gradientColors[0], end: gradientColors[1])
.lerp(0.2)!
.withOpacity(0.1),
.withValues(alpha: 0.1),
],
),
),
Expand Down
Loading
Loading