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

refactor: fixed project infos and warnings for flutter version 3.27.1 #357

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 1 addition & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,11 @@ jobs:
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: "3.24.1"
flutter-version: "3.27.1"
channel: stable
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}

- name: 🀫 Set SSH Key
uses: webfactory/ssh-agent@fd34b8dee206fe74b288a5e61bc95fba2f1911eb
with:
ssh-private-key: ${{secrets.SSH_PRIVATE_KEY}}

- name: πŸ“¦ Install Dependencies
run: flutter pub get

Expand Down
11 changes: 11 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ linter:
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- cascade_invocations
- close_sinks
# - comment_references
- collection_methods_unrelated_type
- constant_identifier_names
- control_flow_in_finally
- curly_braces_in_flow_control_structures
# - directives_ordering
- dangling_library_doc_comments
- empty_catches
- empty_constructor_bodies
- empty_statements
Expand All @@ -62,13 +65,17 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
- implicit_call_tearoffs
- join_return_with_assignment
- library_annotations
- library_names
- library_prefixes
# - lines_longer_than_80_chars
- no_adjacent_strings_in_list
- no_duplicate_case_values
- no_wildcard_variable_uses
- non_constant_identifier_names
- null_check_on_nullable_type_parameter
- null_closures
- only_throw_errors
- overridden_fields
Expand Down Expand Up @@ -102,15 +109,18 @@ linter:
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- provide_deprecation_message
- public_member_api_docs
- recursive_getters
- secure_pubspec_urls
- slash_for_doc_comments
- sort_constructors_first
# - sort_pub_dependencies
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- type_init_formals
- type_literal_in_constant_pattern
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
Expand All @@ -128,6 +138,7 @@ linter:
- use_rethrow_when_possible
- use_setters_to_change_properties
- use_string_buffers
- use_string_in_part_of_directives
- use_to_and_as_if_applicable
- valid_regexps
- void_checks
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ dependencies:
pref: ^2.7.1
flutter_deriv_api:
git:
url: git@github.com:deriv-com/flutter-deriv-api.git
url: https://github.com/deriv-com/flutter-deriv-api.git
ref: v1.3.0
win32: ^5.9.0

dev_dependencies:
deriv_lint:
git:
url: git@github.com:regentmarkets/flutter-deriv-packages.git
url: https://github.com/deriv-com/flutter-deriv-packages.git
path: packages/deriv_lint
ref: dev
flutter_test:
Expand Down
1 change: 0 additions & 1 deletion lib/src/add_ons/drawing_tools_ui/distance_constants.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// This involves calculating the distance from the marker to its
/// edges for the purpose of creating lines ( horizontal , line drawing tool)

class DrawingToolDistance {
/// horizontal distance
static const double horizontalDistance = 99999;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:deriv_chart/src/add_ons/drawing_tools_ui/line/line_drawing_tool_
import 'package:deriv_chart/src/deriv_chart/chart/data_visualization/drawing_tools/data_model/drawing_pattern.dart';
import 'package:deriv_chart/src/deriv_chart/chart/data_visualization/drawing_tools/data_model/edge_point.dart';
import 'package:deriv_chart/src/deriv_chart/chart/data_visualization/drawing_tools/data_model/point.dart';
import 'package:deriv_chart/src/misc/extensions.dart';
import 'package:deriv_chart/src/theme/colors.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -121,7 +122,7 @@ class LineDrawingToolConfigMobile extends DrawingToolConfig {
return null;
}
return {
'color': instance.color.value,
'color': instance.color.toInt32,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MobileLineDrawingToolLabelPainter extends LineDrawingToolLabelPainter {
..strokeWidth = 1.0;

_barrierPaint = Paint()
..color = _style.color.withOpacity(0.2)
..color = _style.color.withValues(alpha: 0.2)
..style = PaintingStyle.fill;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class CrosshairLinePainter extends CustomPainter {
Offset(0, size.height),
<Color>[
// TODO(Ramin): Use theme color when cross-hair design got updated
Colors.white.withOpacity(0.1),
Colors.white.withOpacity(0.3),
Colors.white.withOpacity(0.1),
Colors.white.withValues(alpha: 0.1),
Colors.white.withValues(alpha: 0.3),
Colors.white.withValues(alpha: 0.1),
],
const <double>[
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AccumulatorsClosedIndicatorPainter
}
_linePaint.color = color;
_linePaintFill.color = color;
_rectPaint.color = color.withOpacity(0.08);
_rectPaint.color = color.withValues(alpha: 0.08);

final AccumulatorsClosedIndicator indicator = series;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AccumulatorIndicatorPainter extends SeriesPainter<AccumulatorIndicator> {
}
_linePaint.color = color;
_linePaintFill.color = color;
_rectPaint.color = color.withOpacity(0.08);
_rectPaint.color = color.withValues(alpha: 0.08);

final AccumulatorIndicator indicator = series;

Expand Down Expand Up @@ -442,14 +442,14 @@ class AccumulatorIndicatorPainter extends SeriesPainter<AccumulatorIndicator> {
center.dy,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.64))
arrowPaint..color = _paint.color.withValues(alpha: 0.64))
..drawPath(
getUpwardArrowPath(
center.dx,
center.dy - arrowSize + 1,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.32));
arrowPaint..color = _paint.color.withValues(alpha: 0.32));
}

void _paintDownwardArrows(
Expand Down Expand Up @@ -477,14 +477,14 @@ class AccumulatorIndicatorPainter extends SeriesPainter<AccumulatorIndicator> {
center.dy,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.64))
arrowPaint..color = _paint.color.withValues(alpha: 0.64))
..drawPath(
getDownwardArrowPath(
center.dx,
center.dy + arrowSize - 1,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.32));
arrowPaint..color = _paint.color.withValues(alpha: 0.32));
}

void _paintLine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class AccumulatorsRecentlyClosedIndicatorPainter
}
_linePaint.color = color;
_linePaintFill.color = color;
_rectPaint.color = color.withOpacity(0.08);
_rectPaint.color = color.withValues(alpha: 0.08);

final AccumulatorsRecentlyClosedIndicator indicator = series;

Expand Down Expand Up @@ -218,7 +218,7 @@ class AccumulatorsRecentlyClosedIndicatorPainter
final RRect rRect =
RRect.fromRectAndRadius(dialogRect, const Radius.circular(4));

_rectPaint.color = color.withOpacity(1);
_rectPaint.color = color.withValues(alpha: 1);
canvas.drawRRect(rRect, _rectPaint);

final Offset winLossPosition = Offset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ class HorizontalBarrierPainter<T extends HorizontalBarrier>
center.dy,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.64))
arrowPaint..color = _paint.color.withValues(alpha: 0.64))
..drawPath(
getUpwardArrowPath(
center.dx,
center.dy - arrowSize + 1,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.32));
arrowPaint..color = _paint.color.withValues(alpha: 0.32));
}

void _paintDownwardArrows(
Expand Down Expand Up @@ -315,14 +315,14 @@ class HorizontalBarrierPainter<T extends HorizontalBarrier>
center.dy,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.64))
arrowPaint..color = _paint.color.withValues(alpha: 0.64))
..drawPath(
getDownwardArrowPath(
center.dx,
center.dy + arrowSize - 1,
size: arrowSize,
),
arrowPaint..color = _paint.color.withOpacity(0.32));
arrowPaint..color = _paint.color.withValues(alpha: 0.32));
}
}

Expand Down Expand Up @@ -368,7 +368,7 @@ class IconBarrierPainter extends HorizontalBarrierPainter<IconTickIndicator> {
..drawCircle(
_barrierPosition!,
(iconSize / 2) - 2,
Paint()..color = Colors.black.withOpacity(0.32),
Paint()..color = Colors.black.withValues(alpha: 0.32),
);

TextPainter(textDirection: TextDirection.ltr)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// A model class to hold an Entry of type [T] and its index in the whole list
/// of entries.

class IndexedEntry<T> {
/// Initializes
const IndexedEntry(this.entry, this.index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ class ADXSeries extends Series {
positiveDISeries,
negativeDISeries,
firstUpperChannelFillColor:
config.positiveLineStyle.color.withOpacity(0.2),
config.positiveLineStyle.color.withValues(alpha: 0.2),
secondUpperChannelFillColor:
config.negativeLineStyle.color.withOpacity(0.2),
config.negativeLineStyle.color.withValues(alpha: 0.2),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class BollingerBandSeries extends Series {
return ChannelFillPainter(
upperSeries,
lowerSeries,
firstUpperChannelFillColor: bbOptions.fillColor.withOpacity(0.2),
secondUpperChannelFillColor: bbOptions.fillColor.withOpacity(0.2),
firstUpperChannelFillColor: bbOptions.fillColor.withValues(alpha: 0.2),
secondUpperChannelFillColor: bbOptions.fillColor.withValues(alpha: 0.2),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class DonchianChannelsSeries extends Series {
return ChannelFillPainter(
upperChannelSeries,
lowerChannelSeries,
firstUpperChannelFillColor: config.fillColor.withOpacity(0.2),
secondUpperChannelFillColor: config.fillColor.withOpacity(0.2),
firstUpperChannelFillColor: config.fillColor.withValues(alpha: 0.2),
secondUpperChannelFillColor: config.fillColor.withValues(alpha: 0.2),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class FractalChaosBandSeries extends Series {
return ChannelFillPainter(
fcbHighSeries,
fcbLowSeries,
firstUpperChannelFillColor: config.fillColor.withOpacity(0.2),
secondUpperChannelFillColor: config.fillColor.withOpacity(0.2),
firstUpperChannelFillColor: config.fillColor.withValues(alpha: 0.2),
secondUpperChannelFillColor: config.fillColor.withValues(alpha: 0.2),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ class IchimokuCloudSeries extends Series {
return ChannelFillPainter(
spanASeries,
spanBSeries,
firstUpperChannelFillColor: config.spanALineStyle.color.withOpacity(0.2),
secondUpperChannelFillColor: config.spanBLineStyle.color.withOpacity(0.2),
firstUpperChannelFillColor:
config.spanALineStyle.color.withValues(alpha: 0.2),
secondUpperChannelFillColor:
config.spanBLineStyle.color.withValues(alpha: 0.2),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ class MAEnvSeries extends Series {
return ChannelFillPainter(
upperSeries,
lowerSeries,
firstUpperChannelFillColor: maEnvOptions?.fillColor.withOpacity(0.2),
secondUpperChannelFillColor: maEnvOptions?.fillColor.withOpacity(0.2),
firstUpperChannelFillColor:
maEnvOptions?.fillColor.withValues(alpha: 0.2),
secondUpperChannelFillColor:
maEnvOptions?.fillColor.withValues(alpha: 0.2),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class ChannelFillPainter extends DataPainter<DataSeries<Tick>> {
..strokeWidth = firstLineStyle.thickness;

final Paint firstChannelFillPaint = Paint()
..color =
firstUpperChannelFillColor ?? firstLineStyle.color.withOpacity(0.2)
..color = firstUpperChannelFillColor ??
firstLineStyle.color.withValues(alpha: 0.2)
..style = PaintingStyle.fill
..strokeWidth = 0;

Expand All @@ -71,8 +71,8 @@ class ChannelFillPainter extends DataPainter<DataSeries<Tick>> {
..strokeWidth = secondLineStyle.thickness;

final Paint secondChannelFillPaint = Paint()
..color =
secondUpperChannelFillColor ?? secondLineStyle.color.withOpacity(0.2)
..color = secondUpperChannelFillColor ??
secondLineStyle.color.withValues(alpha: 0.2)
..style = PaintingStyle.fill
..strokeWidth = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class LinePainter extends DataPainter<DataSeries<Tick>> {
const Offset(0, 0),
Offset(0, size.height),
<Color>[
style.color.withOpacity(0.2),
style.color.withOpacity(0.01),
style.color.withValues(alpha: 0.2),
style.color.withValues(alpha: 0.01),
],
);

Expand Down
Loading
Loading