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 latest library #54

Open
wants to merge 2 commits into
base: main
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
161 changes: 104 additions & 57 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,116 @@
analyzer:
plugins:
- dart_code_metrics

# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
language:
strict-raw-types: false
errors:
todo: ignore
exclude:
- "**/*.g.dart"
- "**/*.gr.dart"
- "**/*.freezed.dart"
- "**/*.config.dart"
- "**/*.module.dart"

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
- unnecessary_const
- always_declare_return_types
- avoid_unused_constructor_parameters
# - always_put_control_body_on_new_line
- always_require_non_null_named_parameters
- prefer_relative_imports
- valid_regexps
- void_checks
- annotate_overrides
- prefer_single_quotes
- avoid_empty_else
- avoid_print
- avoid_field_initializers_in_const_classes
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_returning_null
- avoid_returning_null_for_void
- avoid_return_types_on_setters
- avoid_returning_null_for_future
- avoid_returning_this
- avoid_single_cascade_in_expression_statements
- await_only_futures
- camel_case_types
- avoid_void_async
# - cascade_invocations
- close_sinks
- cancel_subscriptions
# - constant_identifier_names
- curly_braces_in_flow_control_structures
- directives_ordering
- omit_local_variable_types
- prefer_expression_function_bodies
- prefer_spread_collections
- prefer_constructors_over_static_methods
- empty_statements
- empty_catches
- empty_constructor_bodies
- unnecessary_getters_setters
- file_names
- implementation_imports
- library_names
- library_prefixes
- literal_only_boolean_expressions
- no_adjacent_strings_in_list
- no_duplicate_case_values
- null_closures
- only_throw_errors
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
- prefer_asserts_with_message
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_contains
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
- prefer_relative_imports
- prefer_single_quotes
- sized_box_for_whitespace
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_inlined_adds
- prefer_interpolation_to_compose_strings
- prefer_iterable_whereType
- prefer_null_aware_operators
- prefer_typing_uninitialized_variables
- provide_deprecation_message
- recursive_getters
- slash_for_doc_comments
- sort_child_properties_last
- sort_pub_dependencies
- sort_unnamed_constructors_first
- test_types_in_equals
- type_annotate_public_apis
- type_init_formals
- unawaited_futures
- use_named_constants
- use_super_parameters
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_this
- unrelated_type_equality_checks
- unsafe_html
- use_full_hex_values_for_flutter_colors
- use_rethrow_when_possible
- use_setters_to_change_properties
- use_string_buffers

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

dart_code_metrics:
rules:
- always-remove-listener
- avoid-unused-parameters
- format-comment
- member-ordering:
alphabetize: false
order:
- constructors
- public-fields
- public-getters
- public-setters
- private-fields
- private-getters
- private-setters
- public-methods
- private-methods
- no-boolean-literal-compare
- prefer-trailing-comma
# nice to have
- avoid_double_and_int_checks
- avoid_bool_literals_in_conditional_expressions
# - avoid_function_literals_in_foreach_calls
- unnecessary_lambdas
- flutter_style_todos
- join_return_with_assignment
# - lines_longer_than_80_chars
- prefer_foreach
- use_to_and_as_if_applicable
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

Expand Down
5 changes: 4 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -200,10 +200,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -214,6 +216,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/link_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ class _LinkPreviewState extends State<LinkPreview>
requestTimeout: widget.requestTimeout,
userAgent: widget.userAgent,
);
_handlePreviewDataFetched(previewData);
await _handlePreviewDataFetched(previewData);
return previewData;
}

void _handlePreviewDataFetched(PreviewData previewData) async {
Future<void> _handlePreviewDataFetched(PreviewData previewData) async {
await Future.delayed(
widget.animationDuration ?? const Duration(milliseconds: 300),
);
Expand Down
21 changes: 12 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ name: flutter_link_previewer
description: >
Customizable link and URL preview extracted from the
provided text with the ability to render from the cache.
version: 3.1.0
version: 3.1.1
homepage: https://flyer.chat
repository: https://github.com/flyerhq/flutter_link_previewer

screenshots:
- description: 'Customizable link and URL preview extracted from the'
path: screenshots/screenshot.png

environment:
sdk: '>=2.17.0 <3.0.0'
flutter: '>=2.0.0'

dependencies:
flutter:
sdk: flutter
flutter_chat_types: ^3.5.0
flutter_linkify: ^5.0.2
html: ^0.15.0
http: ^0.13.5
linkify: ^4.1.0
meta: ^1.8.0
url_launcher: ^6.1.6
flutter_chat_types: ^3.6.1
flutter_linkify: ^6.0.0
html: ^0.15.4
http: ^1.0.0
linkify: ^5.0.0
meta: ^1.9.1
url_launcher: ^6.1.11

dev_dependencies:
dart_code_metrics: ^4.19.1
flutter_lints: ^2.0.1
flutter_test:
sdk: flutter
Binary file added screenshots/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.