Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: subosito/flutter-action@v2
with:
channel: 'stable' # 'master', 'beta', 'dev' or 'stable'
channel: 'master' # 'master', 'beta', 'dev' or 'stable'

# flutter build need ninja.
# https://github.com/subosito/flutter-action/issues/49
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
flutter_channel:
description: "run with flutter channel, eg: master, beta, stable"
required: true
default: "stable"
default: "master"

jobs:
build-linux:
Expand Down
80 changes: 42 additions & 38 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:very_good_analysis/analysis_options.3.0.1.yaml
include: package:very_good_analysis/analysis_options.3.1.0.yaml

analyzer:
plugins:
Expand All @@ -19,7 +19,7 @@ analyzer:
implicit_dynamic_variable: ignore
implicit_dynamic_function: ignore
avoid_setters_without_getters: ignore
# experimental lint
# experimental lint
use_build_context_synchronously: ignore
body_might_complete_normally_nullable: ignore
exclude:
Expand All @@ -31,7 +31,7 @@ analyzer:
# custom
- 'lib/generated/**'
- '**.g.dart'
# - 'editable/**'
# - 'editable/**'
- 'third_party/**'

linter:
Expand Down Expand Up @@ -71,22 +71,26 @@ linter:
prefer_asserts_with_message: false
avoid_positional_boolean_parameters: false

depend_on_referenced_packages: false
no_leading_underscores_for_local_identifiers: false
use_if_null_to_convert_nulls_to_bools: false

dart_code_metrics:
rules:
- avoid-banned-imports
- avoid-collection-methods-with-unrelated-types
- avoid-duplicate-exports
# - avoid-dynamic
# - avoid-global-state
# - avoid-ignoring-return-values
# - avoid-late-keyword
# - avoid-dynamic
# - avoid-global-state
# - avoid-ignoring-return-values
# - avoid-late-keyword
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions:
acceptable-level: 2
- avoid-non-ascii-symbols:
exclude:
- test/**
# - avoid-non-null-assertion
# - avoid-non-null-assertion
- avoid-throw-in-catch-block
- avoid-unnecessary-type-assertions
- avoid-unrelated-type-assertions
Expand All @@ -96,48 +100,48 @@ dart_code_metrics:
- ban-name
- binary-expression-operand-order
- double-literal-format
# - format-comment
# - member-ordering:
# alphabetize: true
# - member-ordering-extended
# do not use this
# - newline-before-return
# - format-comment
# - member-ordering:
# alphabetize: true
# - member-ordering-extended
# do not use this
# - newline-before-return
- no-boolean-literal-compare
# - no-empty-block
# todo use
# - no-equal-arguments
# - no-empty-block
# todo use
# - no-equal-arguments
- no-equal-then-else
# todo use
# - no-magic-number
# - no-object-declaration
# - prefer-async-await
# todo use
# - prefer-commenting-analyzer-ignores
# - prefer-conditional-expressions
# todo use
# - prefer-correct-identifier-length
# todo use
# - no-magic-number
# - no-object-declaration
# - prefer-async-await
# todo use
# - prefer-commenting-analyzer-ignores
# - prefer-conditional-expressions
# todo use
# - prefer-correct-identifier-length
- prefer-correct-type-name
- prefer-enums-by-name
- prefer-first
- prefer-immediate-return
- prefer-last
# todo maybe use
# - prefer-match-file-name
# todo maybe use
# - prefer-trailing-comma:
# break-on: 3
# todo maybe use
# - prefer-match-file-name
# todo maybe use
# - prefer-trailing-comma:
# break-on: 3
- tag-name
# Flutter specific
# Flutter specific
- always-remove-listener
# - avoid-border-all
# - avoid-returning-widgets
# - avoid-border-all
# - avoid-returning-widgets
- avoid-unnecessary-setstate
# - avoid-wrapping-in-padding
# - avoid-wrapping-in-padding
- avoid-use-expanded-as-spacer
- prefer-const-border-radius
# - prefer-extracting-callbacks
# - prefer-single-widget-per-file
# Intl specific
# - prefer-extracting-callbacks
# - prefer-single-widget-per-file
# Intl specific
- prefer-intl-name
- provide-correct-intl-args

Expand Down
4 changes: 2 additions & 2 deletions lib/ui/home/bloc/blink_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class BlinkState extends Equatable {
];

BlinkState copyWith({
final Color? color,
final String? messageId,
Color? color,
String? messageId,
}) =>
BlinkState(
color: color ?? this.color,
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/home/bloc/mention_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class MentionState extends Equatable {
List<Object?> get props => [text, users, index];

MentionState copyWith({
final String? text,
final List<User>? users,
final int? index,
String? text,
List<User>? users,
int? index,
}) =>
MentionState(
text: text ?? this.text,
Expand Down
20 changes: 10 additions & 10 deletions lib/ui/home/bloc/message_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ class MessageState extends Equatable {
];

MessageState copyWith({
final String? conversationId,
final List<MessageItem>? top,
final MessageItem? center,
final List<MessageItem>? bottom,
final bool? isLatest,
final bool? isOldest,
final String? lastReadMessageId,
final Object? refreshKey,
String? conversationId,
List<MessageItem>? top,
MessageItem? center,
List<MessageItem>? bottom,
bool? isLatest,
bool? isOldest,
String? lastReadMessageId,
Object? refreshKey,
}) =>
MessageState(
conversationId: conversationId ?? this.conversationId,
Expand Down Expand Up @@ -315,8 +315,8 @@ class MessageBloc extends Bloc<_MessageEvent, MessageState>
});

final isOldest = list.length < limit;
return state.copyWith(
top: [...list.reversed.toList(), ...state.top], isOldest: isOldest);
return state
.copyWith(top: [...list.reversed, ...state.top], isOldest: isOldest);
}

Future<MessageState> _after(String conversationId) async {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/home/bloc/slide_category_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class SlideCategoryState extends Equatable {
List<Object?> get props => [type, id];

SlideCategoryState copyWith({
final SlideCategoryType? type,
final String? id,
SlideCategoryType? type,
String? id,
}) =>
SlideCategoryState(
type: type ?? this.type,
Expand Down
Loading