Skip to content

Commit

Permalink
Fixing warnings, minor changes to align with Flutter 3.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-saplin committed Dec 16, 2024
1 parent d3189da commit a762525
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion example/lib/screens/async_paginated_data_table2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class _ErrorAndRetry extends StatelessWidget {
Widget build(BuildContext context) => Center(
child: Container(
padding: const EdgeInsets.all(10),
height: 70,
height: 80,
color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down
6 changes: 5 additions & 1 deletion example/macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import Cocoa
import FlutterMacOS

@NSApplicationMain
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}

override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}
4 changes: 3 additions & 1 deletion lib/src/async_paginated_data_table_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ abstract class AsyncDataTableSource extends DataTableSource {
@override
DataRow? getRow(int index) {
if (index - _firstRowAbsoluteIndex < 0 ||
index >= _rows.length + _firstRowAbsoluteIndex) return null;
index >= _rows.length + _firstRowAbsoluteIndex) {
return null;
}
index -= _firstRowAbsoluteIndex;
_fixSelectedState(index);

Expand Down
4 changes: 2 additions & 2 deletions lib/src/data_table_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class DataTable2 extends DataTable {
child: DefaultTextStyle(
style: effectiveDataTextStyle.copyWith(
color: placeholder
? effectiveDataTextStyle.color!.withOpacity(0.6)
? effectiveDataTextStyle.color!.withValues(alpha: 0.6)
: null,
),
child: DropdownButtonHideUnderline(child: label),
Expand Down Expand Up @@ -589,7 +589,7 @@ class DataTable2 extends DataTable {
final defaultRowColor = WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return theme.colorScheme.primary.withOpacity(0.08);
return theme.colorScheme.primary.withValues(alpha: 0.08);
}
return null;
},
Expand Down
4 changes: 2 additions & 2 deletions test/chasing_coverage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void main() {
.first
.widget as DefaultTextStyle;

expect(t.style.color!.opacity, 0.6);
expect(t.style.color!.a, 0.6);
});
testWidgets('DataTable2, placholder text is 0.6 opacity',
(WidgetTester tester) async {
Expand Down Expand Up @@ -107,7 +107,7 @@ void main() {
.first
.widget as DefaultTextStyle;

expect(t.style.color!.opacity, 0.6);
expect(t.style.color!.a, 0.6);
});

testWidgets('DataTable2, divider thickness 0 shows no border',
Expand Down
2 changes: 1 addition & 1 deletion test/data_table_2_data_column_2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ void main() {
await tester.pumpWidget(buildTable(selected: true));
expect(
lastTableRowBoxDecoration().color,
themeData.colorScheme.primary.withOpacity(0.08),
themeData.colorScheme.primary..withValues(alpha: 0.08),
);
});

Expand Down
2 changes: 1 addition & 1 deletion test/data_table_2_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ void main() {
await tester.pumpWidget(buildTable(selected: true));
expect(
lastTableRowBoxDecoration().color,
themeData.colorScheme.primary.withOpacity(0.08),
themeData.colorScheme.primary.withValues(alpha: 0.08),
);
});

Expand Down

0 comments on commit a762525

Please sign in to comment.