Skip to content

Commit 2b71aba

Browse files
committed
TF-1487 Apply linter rule
1 parent 117a8a8 commit 2b71aba

File tree

155 files changed

+798
-1039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+798
-1039
lines changed

analysis_options.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,7 @@
1010
include: package:flutter_lints/flutter.yaml
1111

1212
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
2413
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
28-
# Additional information about this file can be found at
29-
# https://dart.dev/guides/language/analysis-options
14+
constant_identifier_names: false
15+
non_constant_identifier_names: false
16+
unnecessary_string_escapes: false

contact/analysis_options.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
110
include: package:flutter_lints/flutter.yaml
211

3-
# Additional information about this file can be found at
4-
# https://dart.dev/guides/language/analysis-options
12+
linter:
13+
rules:
14+
constant_identifier_names: false
15+
non_constant_identifier_names: false
16+
unnecessary_string_escapes: false

core/analysis_options.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,7 @@
1010
include: package:flutter_lints/flutter.yaml
1111

1212
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
2413
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
28-
# Additional information about this file can be found at
29-
# https://dart.dev/guides/language/analysis-options
14+
constant_identifier_names: false
15+
non_constant_identifier_names: false
16+
unnecessary_string_escapes: false

core/lib/core.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export 'presentation/views/bottom_popup/confirmation_dialog_action_sheet_builder
7373
export 'presentation/views/modal_sheets/edit_text_modal_sheet_builder.dart';
7474
export 'presentation/views/search/search_bar_view.dart';
7575
export 'presentation/views/popup_menu/popup_menu_item_widget.dart';
76-
export 'presentation/views/tab_bar/custom_tab_indicator.dart';
7776
export 'presentation/views/quick_search/quick_search_input_form.dart';
7877
export 'presentation/views/toast/toast_position.dart';
7978
export 'presentation/views/toast/tmail_toast.dart';
@@ -95,8 +94,6 @@ export 'data/network/dio_client.dart';
9594
export 'data/network/download/download_client.dart';
9695
export 'data/network/download/download_manager.dart';
9796
export 'data/network/download/downloaded_response.dart';
98-
export 'data/network/download/download_client.dart';
99-
export 'domain/exceptions/web_session_exception.dart';
10097

10198
// State
10299
export 'presentation/state/success.dart';

core/lib/presentation/extensions/color_extension.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:ui' show Color;
2-
31
import 'package:flutter/material.dart';
42

53
extension AppColor on Color {
@@ -197,3 +195,12 @@ extension AppColor on Color {
197195
.toUpperCase()}';
198196
}
199197

198+
extension ColorNullableExtension on Color? {
199+
ColorFilter? asFilter({BlendMode? blendMode}) {
200+
if (this == null) {
201+
return null;
202+
} else {
203+
return ColorFilter.mode(this!, blendMode ?? BlendMode.srcIn);
204+
}
205+
}
206+
}

core/lib/presentation/extensions/url_extension.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extension URLExtension on String {
1111
} else if (startsWith(prefixUrlHttp)) {
1212
return kReleaseMode ? replaceAll(prefixUrlHttp, prefixUrlHttps) : this;
1313
} else {
14-
return '$prefixUrlHttps${this}';
14+
return '$prefixUrlHttps$this';
1515
}
1616
}
1717
return '';

core/lib/presentation/state/app_state.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import 'package:core/core.dart';
1+
import 'package:core/presentation/state/failure.dart';
2+
import 'package:core/presentation/state/success.dart';
23
import 'package:dartz/dartz.dart';
3-
import 'package:meta/meta.dart';
44
import 'package:equatable/equatable.dart';
5+
import 'package:flutter/material.dart';
56

67
@immutable
78
abstract class AppState with EquatableMixin {

core/lib/presentation/utils/app_toast.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class AppToast {
171171
width: 24,
172172
height: 24,
173173
fit: BoxFit.fill,
174-
color: iconColor),
174+
colorFilter: iconColor.asFilter()),
175175
if (icon != null)
176176
const SizedBox(width: 10.0),
177177
Expanded(child: Text(

core/lib/presentation/utils/theme_utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class ThemeUtils {
2121

2222
static TextTheme get _textTheme {
2323
return const TextTheme(
24-
bodyText1: TextStyle(color: AppColor.baseTextColor),
25-
bodyText2: TextStyle(color: AppColor.baseTextColor),
24+
bodyMedium: TextStyle(color: AppColor.baseTextColor),
25+
bodySmall: TextStyle(color: AppColor.baseTextColor),
2626
);
2727
}
2828

core/lib/presentation/views/background/background_widget_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class BackgroundWidgetBuilder extends StatelessWidget {
4343
return Container(
4444
color: Colors.transparent,
4545
padding: const EdgeInsets.symmetric(horizontal: 12),
46+
height: MediaQuery.of(context).size.height,
4647
child: Column(
4748
mainAxisAlignment: responsiveUtils.isLandscapeMobile(context)
4849
? MainAxisAlignment.start
@@ -83,7 +84,6 @@ class BackgroundWidgetBuilder extends StatelessWidget {
8384
)
8485
],
8586
),
86-
height: MediaQuery.of(context).size.height,
8787
);
8888
}
8989
}

0 commit comments

Comments
 (0)