From ae8ffbadd544b17da7fb5d6ca795599f1dd59ca5 Mon Sep 17 00:00:00 2001 From: Neha Musale <70088044+Neha62-lit@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:00:10 +0530 Subject: [PATCH] fix(lints): unnecessary_string_interpolations rule (#154) * fix(lints): unnecessary_string_interpolations rule * Formatted the code --- analysis_options.yaml | 2 -- lib/ui/components/cv_flat_button.dart | 2 +- lib/ui/views/groups/assignment_details_view.dart | 7 ++++--- .../views/projects/components/featured_project_card.dart | 5 +++-- lib/ui/views/projects/components/project_card.dart | 5 +++-- lib/ui/views/projects/project_details_view.dart | 7 ++++--- lib/ui/views/projects/project_preview_fullscreen_view.dart | 5 +++-- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index ed253739..706f8b59 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -46,8 +46,6 @@ linter: use_key_in_widget_constructors: false - unnecessary_string_interpolations: false - prefer_const_declarations: false constant_identifier_names: false diff --git a/lib/ui/components/cv_flat_button.dart b/lib/ui/components/cv_flat_button.dart index f2f44379..e1f436ac 100644 --- a/lib/ui/components/cv_flat_button.dart +++ b/lib/ui/components/cv_flat_button.dart @@ -31,7 +31,7 @@ class CVFlatButtonState extends State { onPressed: dynamicFunction == null ? null : () => dynamicFunction.call(widget.context), - child: Text('${widget.buttonText}'), + child: Text(widget.buttonText), ); } } diff --git a/lib/ui/views/groups/assignment_details_view.dart b/lib/ui/views/groups/assignment_details_view.dart index 1ee9e6d3..26f674b7 100644 --- a/lib/ui/views/groups/assignment_details_view.dart +++ b/lib/ui/views/groups/assignment_details_view.dart @@ -144,7 +144,7 @@ class _AssignmentDetailsViewState extends State { ), ), Html( - data: """${_recievedAssignment.attributes.description ?? ''}""", + data: _recievedAssignment.attributes.description ?? '', style: { 'body': Style( fontSize: FontSize(18), @@ -236,8 +236,9 @@ class _AssignmentDetailsViewState extends State { child: FadeInImage.memoryNetwork( fit: BoxFit.cover, placeholder: kTransparentImage, - image: - '${EnvironmentConfig.CV_API_BASE_URL.substring(0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + _model.focussedProject.attributes.imagePreview.url}', + image: EnvironmentConfig.CV_API_BASE_URL.substring( + 0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + + _model.focussedProject.attributes.imagePreview.url, ), ), ) diff --git a/lib/ui/views/projects/components/featured_project_card.dart b/lib/ui/views/projects/components/featured_project_card.dart index c501ef01..c376b318 100644 --- a/lib/ui/views/projects/components/featured_project_card.dart +++ b/lib/ui/views/projects/components/featured_project_card.dart @@ -36,8 +36,9 @@ class _FeaturedProjectCardState extends State { child: FadeInImage.memoryNetwork( fit: BoxFit.cover, placeholder: kTransparentImage, - image: - '${EnvironmentConfig.CV_API_BASE_URL.substring(0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + widget.project.attributes.imagePreview.url}', + image: EnvironmentConfig.CV_API_BASE_URL.substring( + 0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + + widget.project.attributes.imagePreview.url, ), ), ), diff --git a/lib/ui/views/projects/components/project_card.dart b/lib/ui/views/projects/components/project_card.dart index 81f412f5..e5c15f24 100644 --- a/lib/ui/views/projects/components/project_card.dart +++ b/lib/ui/views/projects/components/project_card.dart @@ -90,8 +90,9 @@ class _ProjectCardState extends State { child: FadeInImage.memoryNetwork( fit: BoxFit.cover, placeholder: kTransparentImage, - image: - '${EnvironmentConfig.CV_API_BASE_URL.substring(0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + widget.project.attributes.imagePreview.url}', + image: EnvironmentConfig.CV_API_BASE_URL.substring( + 0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + + widget.project.attributes.imagePreview.url, ), ), ), diff --git a/lib/ui/views/projects/project_details_view.dart b/lib/ui/views/projects/project_details_view.dart index 57dc561f..36638ae6 100644 --- a/lib/ui/views/projects/project_details_view.dart +++ b/lib/ui/views/projects/project_details_view.dart @@ -88,8 +88,9 @@ class _ProjectDetailsViewState extends State { height: 100, width: 50, placeholder: kTransparentImage, - image: - '${EnvironmentConfig.CV_API_BASE_URL.substring(0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + _recievedProject.attributes.imagePreview.url}', + image: EnvironmentConfig.CV_API_BASE_URL.substring( + 0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + + _recievedProject.attributes.imagePreview.url, ), ), Material( @@ -229,7 +230,7 @@ class _ProjectDetailsViewState extends State { ), ), Html( - data: """${_recievedProject.attributes.description ?? ''}""", + data: _recievedProject.attributes.description ?? '', style: {'body': Style(fontSize: FontSize(18))}, ) ], diff --git a/lib/ui/views/projects/project_preview_fullscreen_view.dart b/lib/ui/views/projects/project_preview_fullscreen_view.dart index a1331a6c..b5e6f1f8 100644 --- a/lib/ui/views/projects/project_preview_fullscreen_view.dart +++ b/lib/ui/views/projects/project_preview_fullscreen_view.dart @@ -25,8 +25,9 @@ class ProjectPreviewFullScreen extends StatelessWidget { height: 100, width: 50, placeholder: kTransparentImage, - image: - '${EnvironmentConfig.CV_API_BASE_URL.substring(0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + project.attributes.imagePreview.url}', + image: EnvironmentConfig.CV_API_BASE_URL.substring( + 0, EnvironmentConfig.CV_API_BASE_URL.length - 7) + + project.attributes.imagePreview.url, ), ), ),