chore(repo): finish adding dart_code_metrics.yaml

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-10-01 16:45:18 +05:30
committed by xsahil03x
parent f7723198de
commit bf21f7b350
14 changed files with 203 additions and 221 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ jobs:
flutter-version: ${{ env.flutter_version }} flutter-version: ${{ env.flutter_version }}
- name: "Install Tools" - name: "Install Tools"
run: flutter pub global activate melos run: flutter pub global activate melos 1.0.0-dev.3
- name: "Bootstrap Workspace" - name: "Bootstrap Workspace"
run: melos bootstrap run: melos bootstrap
@@ -31,7 +31,7 @@ jobs:
flutter-version: ${{ env.flutter_version }} flutter-version: ${{ env.flutter_version }}
- name: "Install Tools" - name: "Install Tools"
run: | run: |
flutter pub global activate melos flutter pub global activate melos 1.0.0-dev.3
- name: "Bootstrap Workspace" - name: "Bootstrap Workspace"
run: melos bootstrap run: melos bootstrap
- name: "Dart Analyze" - name: "Dart Analyze"
+1 -7
View File
@@ -149,12 +149,6 @@ linter:
# https://dartcodemetrics.dev/docs/getting-started/introduction # https://dartcodemetrics.dev/docs/getting-started/introduction
dart_code_metrics: dart_code_metrics:
metrics-exclude:
- packages/*/test/**
metrics:
source-lines-of-code: 90
maximum-nesting-level: 5
halstead-volume: 150
rules: rules:
# Dart Specific # Dart Specific
- binary-expression-operand-order - binary-expression-operand-order
@@ -162,6 +156,7 @@ dart_code_metrics:
- prefer-match-file-name: - prefer-match-file-name:
exclude: exclude:
- packages/*/test/** - packages/*/test/**
- packages/*/example/**
- packages/**/util/** - packages/**/util/**
- packages/**/utils.dart - packages/**/utils.dart
- packages/stream_chat/lib/src/client/client.dart - packages/stream_chat/lib/src/client/client.dart
@@ -182,4 +177,3 @@ dart_code_metrics:
# Flutter specific # Flutter specific
- always-remove-listener - always-remove-listener
- avoid-unnecessary-setstate - avoid-unnecessary-setstate
- avoid-wrapping-in-padding
+1 -1
View File
@@ -4,7 +4,7 @@ versioning:
mode: independent mode: independent
packages: packages:
- packages/stream_chat*/* - packages/**
scripts: scripts:
lint:all: lint:all:
+2 -3
View File
@@ -1,4 +1,4 @@
name: example name: stream_chat_example
description: A new Flutter project. description: A new Flutter project.
publish_to: "none" publish_to: "none"
@@ -11,8 +11,7 @@ dependencies:
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.0
flutter: flutter:
sdk: flutter sdk: flutter
stream_chat: stream_chat: ^2.2.1
path: ../
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@@ -1,4 +1,4 @@
name: example name: stream_chat_flutter_example
description: A new Flutter project. description: A new Flutter project.
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
@@ -27,18 +27,9 @@ dependencies:
cupertino_icons: ^1.0.3 cupertino_icons: ^1.0.3
flutter: flutter:
sdk: flutter sdk: flutter
stream_chat_flutter: ^2.2.1
dependency_overrides: stream_chat_localizations: ^1.1.0
stream_chat: stream_chat_persistence: ^2.2.0
path: ../../stream_chat
stream_chat_flutter:
path: ../../stream_chat_flutter
stream_chat_flutter_core:
path: ../../stream_chat_flutter_core
stream_chat_localizations:
path: ../../stream_chat_localizations
stream_chat_persistence:
path: ../../stream_chat_persistence
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@@ -54,8 +54,9 @@ class AttachmentActionsModal extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
const SizedBox(height: kToolbarHeight), const SizedBox(height: kToolbarHeight),
Container( Padding(
padding: const EdgeInsets.only(right: 8), padding: const EdgeInsets.only(right: 8),
child: Container(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -108,7 +109,8 @@ class AttachmentActionsModal extends StatelessWidget {
}) saveImage = imageDownloader ?? _downloadAttachment; }) saveImage = imageDownloader ?? _downloadAttachment;
final downloader = isImage ? saveImage : saveFile; final downloader = isImage ? saveImage : saveFile;
final progressNotifier = ValueNotifier<_DownloadProgress?>( final progressNotifier =
ValueNotifier<_DownloadProgress?>(
_DownloadProgress.initial(), _DownloadProgress.initial(),
); );
@@ -139,7 +141,8 @@ class AttachmentActionsModal extends StatelessWidget {
); );
}, },
), ),
if (StreamChat.of(context).currentUser?.id == message.user?.id) if (StreamChat.of(context).currentUser?.id ==
message.user?.id)
_buildButton( _buildButton(
context, context,
context.translations.deleteLabel.capitalize(), context.translations.deleteLabel.capitalize(),
@@ -182,6 +185,7 @@ class AttachmentActionsModal extends StatelessWidget {
), ),
), ),
), ),
),
], ],
); );
} }
@@ -112,8 +112,8 @@ class _FullScreenMediaState extends State<FullScreenMedia>
attachment.assetUrl ?? attachment.assetUrl ??
attachment.thumbUrl; attachment.thumbUrl;
return PhotoView( return PhotoView(
loadingBuilder: (context, image) => loadingBuilder: (context, image) => const Offstage(),
const Offstage(),imageProvider: (imageUrl == null && imageProvider: (imageUrl == null &&
attachment.localUri != null && attachment.localUri != null &&
attachment.file?.bytes != null) attachment.file?.bytes != null)
? Image.memory(attachment.file!.bytes!).image ? Image.memory(attachment.file!.bytes!).image
@@ -251,8 +251,10 @@ class _GalleryFooterState extends State<GalleryFooter> {
children: [ children: [
media, media,
if (widget.message.user != null) if (widget.message.user != null)
Container( Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(8),
child: Container(
padding: const EdgeInsets.all(2),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
@@ -273,6 +275,7 @@ class _GalleryFooterState extends State<GalleryFooter> {
showOnlineStatus: false, showOnlineStatus: false,
), ),
), ),
),
], ],
); );
}, },
@@ -752,8 +752,9 @@ class MessageInputState extends State<MessageInput> {
? Row( ? Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: Container(
constraints: BoxConstraints.tight(const Size(64, 24)), constraints: BoxConstraints.tight(const Size(64, 24)),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@@ -769,13 +770,15 @@ class MessageInputState extends State<MessageInput> {
), ),
Text( Text(
_chosenCommand?.name.toUpperCase() ?? '', _chosenCommand?.name.toUpperCase() ?? '',
style: _streamChatTheme.textTheme.footnoteBold.copyWith( style:
_streamChatTheme.textTheme.footnoteBold.copyWith(
color: Colors.white, color: Colors.white,
), ),
), ),
], ],
), ),
), ),
),
], ],
) )
: (widget.actionsLocation == ActionsLocation.leftInside : (widget.actionsLocation == ActionsLocation.leftInside
@@ -1024,8 +1027,10 @@ class MessageInputState extends State<MessageInput> {
_attachments.isNotEmpty) _attachments.isNotEmpty)
? null ? null
: () { : () {
pickFile(DefaultAttachmentTypes.image, pickFile(
camera: true); DefaultAttachmentTypes.image,
camera: true,
);
}, },
), ),
IconButton( IconButton(
@@ -1038,8 +1043,10 @@ class MessageInputState extends State<MessageInput> {
_attachments.isNotEmpty) _attachments.isNotEmpty)
? null ? null
: () { : () {
pickFile(DefaultAttachmentTypes.video, pickFile(
camera: true); DefaultAttachmentTypes.video,
camera: true,
);
}, },
), ),
], ],
@@ -1053,10 +1060,11 @@ class MessageInputState extends State<MessageInput> {
), ),
), ),
child: Center( child: Center(
child: Padding(
padding: const EdgeInsets.all(8),
child: Container( child: Container(
width: 40, width: 40,
height: 4, height: 4,
padding: const EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: _streamChatTheme.colorTheme.inputBg, color: _streamChatTheme.colorTheme.inputBg,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
@@ -1064,6 +1072,7 @@ class MessageInputState extends State<MessageInput> {
), ),
), ),
), ),
),
if (_openFilePickerSection) if (_openFilePickerSection)
Expanded( Expanded(
child: DecoratedBox( child: DecoratedBox(
@@ -189,7 +189,7 @@ class QuotedMessageWidget extends StatelessWidget {
image: DecorationImage( image: DecorationImage(
fit: BoxFit.cover, fit: BoxFit.cover,
image: CachedNetworkImageProvider( image: CachedNetworkImageProvider(
attachment.imageUrl!, attachment.thumbUrl!,
), ),
), ),
), ),
@@ -1,4 +1,4 @@
name: example name: stream_chat_flutter_core_example
description: Example app for testing stream_chat_flutter_core description: Example app for testing stream_chat_flutter_core
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
@@ -26,13 +26,7 @@ dependencies:
cupertino_icons: ^1.0.3 cupertino_icons: ^1.0.3
flutter: flutter:
sdk: flutter sdk: flutter
stream_chat_flutter_core: ^2.2.1
dependency_overrides:
stream_chat:
path: ../../stream_chat
stream_chat_flutter_core:
path: ../../stream_chat_flutter_core
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@@ -1,4 +1,4 @@
name: example name: stream_chat_localizations_example
description: A new Flutter project. description: A new Flutter project.
publish_to: 'none' publish_to: 'none'
@@ -11,16 +11,8 @@ dependencies:
cupertino_icons: ^1.0.3 cupertino_icons: ^1.0.3
flutter: flutter:
sdk: flutter sdk: flutter
stream_chat_flutter: ^2.2.1
dependency_overrides: stream_chat_localizations: ^1.1.0
stream_chat:
path: ../../stream_chat
stream_chat_flutter:
path: ../../stream_chat_flutter
stream_chat_flutter_core:
path: ../../stream_chat_flutter_core
stream_chat_localizations:
path: ../../stream_chat_localizations
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@@ -1,4 +1,4 @@
name: example name: stream_chat_persistence_example
description: A new Flutter project. description: A new Flutter project.
publish_to: 'none' publish_to: 'none'
@@ -11,12 +11,8 @@ dependencies:
cupertino_icons: ^1.0.3 cupertino_icons: ^1.0.3
flutter: flutter:
sdk: flutter sdk: flutter
stream_chat: ^2.2.1
dependency_overrides: stream_chat_persistence: ^2.2.0
stream_chat:
path: ../../stream_chat
stream_chat_persistence:
path: ../../stream_chat_persistence
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: