Skip to content

Commit

Permalink
upgrade to latest flutter
Browse files Browse the repository at this point in the history
  • Loading branch information
doonfrs committed Jan 6, 2025
1 parent 891ec23 commit 81443ea
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/src/helper/filter_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class FilterHelper {
};
}

/// Converts List<PlutoRow> type with filtering information to Map type.
/// Converts List&lt;PlutoRow&gt; type with filtering information to Map type.
///
/// [allField] determines the key value of the filter applied to the entire scope.
/// Default is all.
Expand Down
6 changes: 3 additions & 3 deletions lib/src/helper/pluto_aggregate_helper.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:collection/collection.dart'
show IterableExtension, IterableNullableExtension, IterableNumberExtension;
show IterableExtension, IterableNumberExtension;
import 'package:pluto_grid_plus/pluto_grid_plus.dart';

class PlutoAggregateHelper {
Expand All @@ -23,7 +23,7 @@ class PlutoAggregateHelper {
.map(
(e) => e.cells[column.field]?.value as num?,
)
.whereNotNull();
.nonNulls;

return numbers.isNotEmpty
? numberColumn.toNumber(numberColumn.applyFormat(numbers.sum))
Expand All @@ -50,7 +50,7 @@ class PlutoAggregateHelper {
.map(
(e) => e.cells[column.field]?.value as num?,
)
.whereNotNull();
.nonNulls;

return numbers.isNotEmpty
? numberColumn.toNumber(numberColumn.applyFormat(numbers.average))
Expand Down
2 changes: 0 additions & 2 deletions lib/src/helper/pluto_move_direction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ enum PlutoMoveDirection {
case PlutoMoveDirection.right:
case PlutoMoveDirection.down:
return 1;
default:
return 0;
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/helper/show_column_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ List<PopupMenuEntry<PlutoGridColumnMenuItem>> _getDefaultColumnMenuItems({
}) {
final Color textColor = stateManager.style.cellTextStyle.color!;

final Color disableTextColor = textColor.withOpacity(0.5);
final Color disableTextColor = textColor.withAlpha((0.5 * 255).toInt());

final bool enoughFrozenColumnsWidth = stateManager.enoughFrozenColumnsWidth(
stateManager.maxWidth! - column.width,
Expand Down Expand Up @@ -182,7 +182,7 @@ PopupMenuItem<PlutoGridColumnMenuItem> _buildMenuItem<PlutoGridColumnMenuItem>({
child: Text(
text,
style: TextStyle(
color: enabled ? textColor : textColor!.withOpacity(0.5),
color: enabled ? textColor : textColor!.withAlpha((0.5 * 255).toInt()),
fontSize: 13,
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/src/manager/event/pluto_grid_cell_gesture_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class PlutoGridCellGestureEvent extends PlutoGridEvent {
case PlutoGridGestureType.onSecondaryTap:
_onSecondaryTap(stateManager);
break;
default:
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/manager/pluto_grid_state_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class PlutoGridStateManager extends PlutoGridStateChangeNotifier {
/// [PlutoGridStateManager.initializeRowsAsync] repeats [Timer] every [duration],
/// Process the setting of [refRows] by the size of [chunkSize].
/// [Isolate] is a good way to handle CPU heavy work, but
/// The condition that List<PlutoRow> cannot be passed to Isolate
/// The condition that List&lt;PlutoRow&gt; cannot be passed to Isolate
/// solves the problem of UI freezing by dividing the work with Timer.
///
/// {@macro initialize_rows_params}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/manager/state/row_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:pluto_grid_plus/pluto_grid_plus.dart';
abstract class IRowState {
List<PlutoRow> get rows;

/// [refRows] is a List<PlutoRow> type and holds the entire row data.
/// [refRows] is a List&lt;PlutoRow&gt; type and holds the entire row data.
///
/// [refRows] returns a list of final results
/// according to pagination and filtering status.
Expand Down
1 change: 0 additions & 1 deletion lib/src/manager/state/selecting_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ mixin SelectingState implements IPlutoGridState {
setCurrentSelectingRowsByRange(0, refRows.length - 1);
break;
case PlutoGridSelectingMode.none:
default:
break;
}
}
Expand Down
12 changes: 7 additions & 5 deletions lib/src/widgets/pluto_scrollbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -982,20 +982,20 @@ class _ScrollbarPainter extends ChangeNotifier implements CustomPainter {
Paint get _paintThumb {
return Paint()
..color =
color.withOpacity(color.opacity * fadeoutOpacityAnimation.value);
color.withAlpha((color.a * fadeoutOpacityAnimation.value).toInt());
}

Paint _paintTrack({bool isBorder = false}) {
if (isBorder) {
return Paint()
..color = trackBorderColor.withOpacity(
trackBorderColor.opacity * fadeoutOpacityAnimation.value)
..color = trackBorderColor.withAlpha(
(trackBorderColor.a * fadeoutOpacityAnimation.value).toInt())
..style = PaintingStyle.stroke
..strokeWidth = 1.0;
}
return Paint()
..color = trackColor
.withOpacity(trackColor.opacity * fadeoutOpacityAnimation.value);
.withAlpha((trackColor.a * fadeoutOpacityAnimation.value).toInt());
}

void _paintScrollbar(
Expand Down Expand Up @@ -1200,7 +1200,9 @@ class _ScrollbarPainter extends ChangeNotifier implements CustomPainter {
void paint(Canvas canvas, Size size) {
if (_lastAxisDirection == null ||
_lastMetrics == null ||
_lastMetrics!.maxScrollExtent <= _lastMetrics!.minScrollExtent) return;
_lastMetrics!.maxScrollExtent <= _lastMetrics!.minScrollExtent) {
return;
}

// Skip painting if there's not enough space.
if (_lastMetrics!.viewportDimension <= _mainAxisPadding ||
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/pluto_shadow_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PlutoShadowContainer extends StatelessWidget {
),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
color: Colors.grey.withAlpha((0.5 * 255).toInt()),
spreadRadius: 5,
blurRadius: 7,
offset: const Offset(0, 3), // changes position of shadow
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/pluto_shadow_line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PlutoShadowLine extends StatelessWidget {
boxShadow: shadow == true
? [
BoxShadow(
color: Colors.grey.withOpacity(0.15),
color: Colors.grey.withAlpha((0.15 * 255).toInt()),
spreadRadius: 1,
blurRadius: 3,
offset: reverse == true
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
sdk: flutter
# Follows the intl version included in Flutter.
# https://github.com/flutter/flutter/blob/84a1e904f44f9b0e9c4510138010edcc653163f8/packages/flutter_localizations/pubspec.yaml#L11
intl: ^0.19.0
intl: ^0.20.1
rxdart: ^0.28.0
collection: ^1.18.0

Expand Down

0 comments on commit 81443ea

Please sign in to comment.