Skip to content

Commit

Permalink
fix(lints): unnecessary_string_escapes and prefer_function_declaratio…
Browse files Browse the repository at this point in the history
…ns_over_variables rules (#160)

* fix(lints): unnecessary_string_escapes rule

* fix(lints):  prefer_function_declarations_over_variables rule

* Remove prefer_function_declarations_over_variables rule

* Formatted the code

* Remove the #prefer_const_constructors comment

* Formatted the code for prefer_function_declarations_over_variables rule

* Formatted the 3 files
  • Loading branch information
Neha62-lit authored Oct 15, 2021
1 parent 36edacf commit fb4df78
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
4 changes: 0 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ linter:

join_return_with_assignment: false

prefer_function_declarations_over_variables: false

unnecessary_string_escapes: false

non_constant_identifier_names: false

constant_identifier_names: false
Expand Down
2 changes: 1 addition & 1 deletion test/setup/test_data/mock_ib_raw_page_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Map<String, dynamic> mockIbRawPageData1 = {
'description': '',
'permalink': '/',
'content':
'<h1 class=\"fs-9\" id=\"interactive-book\">Interactive-Book</h1>\n\n<p class=\"fs-6 fw-300\">Learn Digital Logic Design easily.</p>\n\n<p>The Computer Logical Organization is basically the abstraction which is below the operating system and above the digital logic level.\nNow at this point, the important points are the functional units/subsystems that refer to some hardware which is made up of lower level building blocks.</p>\n\n<p>This interactive book gives a complete understanding on Computer Logical Organization starting from basic computer overview till the advanced level.\nThis book is aimed to provide the knowledge to the reader on how to analyze the combinational and sequential circuits and implement them. You can use the combinational circuit/sequential circuit/combination of both the circuits, as per the requirement.\nAfter completing this book, you will be able to implement the type of digital circuit, which is suitable for specific application.</p>\n\n<hr />\n\n<h2 id=\"audience\">Audience</h2>\n\n<p>This book is mainly prepared for the students who are interested in the concepts of digital circuits and Computer Logical Organization. Digital circuits contain a set of Logic gates and these can be operated with binary values, 0 and 1.</p>\n\n<h3 id=\"prerequisites\">Prerequisites</h3>\n<p>Before you start learning from this Book, I hope that you have some basic knowledge about computers and how they work.\nA basic idea regarding the initial concepts of Digital Electronics is enough to understand the topics covered in this tutorial.</p>\n',
'<h1 class="fs-9" id="interactive-book">Interactive-Book</h1>\n\n<p class="fs-6 fw-300">Learn Digital Logic Design easily.</p>\n\n<p>The Computer Logical Organization is basically the abstraction which is below the operating system and above the digital logic level.\nNow at this point, the important points are the functional units/subsystems that refer to some hardware which is made up of lower level building blocks.</p>\n\n<p>This interactive book gives a complete understanding on Computer Logical Organization starting from basic computer overview till the advanced level.\nThis book is aimed to provide the knowledge to the reader on how to analyze the combinational and sequential circuits and implement them. You can use the combinational circuit/sequential circuit/combination of both the circuits, as per the requirement.\nAfter completing this book, you will be able to implement the type of digital circuit, which is suitable for specific application.</p>\n\n<hr />\n\n<h2 id="audience">Audience</h2>\n\n<p>This book is mainly prepared for the students who are interested in the concepts of digital circuits and Computer Logical Organization. Digital circuits contain a set of Logic gates and these can be operated with binary values, 0 and 1.</p>\n\n<h3 id="prerequisites">Prerequisites</h3>\n<p>Before you start learning from this Book, I hope that you have some basic knowledge about computers and how they work.\nA basic idea regarding the initial concepts of Digital Electronics is enough to understand the topics covered in this tutorial.</p>\n',
'dir': '/',
'url': '/',
'raw_content':
Expand Down
7 changes: 3 additions & 4 deletions test/ui_tests/authentication/forgot_password_view_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ void main() {
await _pumpForgotPasswordView(tester);
await tester.pumpAndSettle();

var _forgotPasswordImagePredicate =
(Widget widget) => widget is Image && widget.height == 300;

expect(find.byWidgetPredicate(_forgotPasswordImagePredicate),
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Image && widget.height == 300),
findsOneWidget);
expect(find.byType(CVTextField), findsOneWidget);
expect(find.byType(CVPrimaryButton), findsOneWidget);
Expand Down
7 changes: 4 additions & 3 deletions test/ui_tests/authentication/login_view_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ void main() {
await _pumpLoginView(tester);
await tester.pumpAndSettle();

var _loginImagePredicate =
(Widget widget) => widget is Image && widget.height == 300;
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Image && widget.height == 300),
findsOneWidget);

expect(find.byWidgetPredicate(_loginImagePredicate), findsOneWidget);
expect(find.byType(CVTextField), findsOneWidget);
expect(find.byType(CVPasswordField), findsOneWidget);
expect(find.text('Forgot Password?'), findsOneWidget);
Expand Down
24 changes: 14 additions & 10 deletions test/ui_tests/authentication/signup_view_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ void main() {
await _pumpSignupView(tester);
await tester.pumpAndSettle();

var _signupImagePredicate =
(Widget widget) => widget is Image && widget.height == 300;

expect(find.byWidgetPredicate(_signupImagePredicate), findsOneWidget);
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Image && widget.height == 300),
findsOneWidget);
expect(find.byType(CVTextField), findsNWidgets(2));
expect(find.byType(CVPasswordField), findsOneWidget);
expect(find.byType(CVPrimaryButton), findsOneWidget);
Expand All @@ -63,10 +63,10 @@ void main() {
await _pumpSignupView(tester);
await tester.pumpAndSettle();

var _nameFieldPredicate =
(Widget widget) => widget is CVTextField && widget.label == 'Name';
var _emailFieldPredicate =
(Widget widget) => widget is CVTextField && widget.label == 'Email';
expect(
find.byWidgetPredicate((Widget widget) =>
widget is CVTextField && widget.label == 'Name'),
findsOneWidget);

await tester.tap(find.byType(CVPrimaryButton));
await tester.pumpAndSettle();
Expand All @@ -77,7 +77,9 @@ void main() {
expect(find.text('Password can\'t be empty'), findsOneWidget);

await tester.enterText(
find.byWidgetPredicate(_nameFieldPredicate), 'test');
find.byWidgetPredicate((Widget widget) =>
widget is CVTextField && widget.label == 'Name'),
'test');
await tester.tap(find.byType(CVPrimaryButton));
await tester.pumpAndSettle();

Expand All @@ -86,7 +88,9 @@ void main() {
expect(find.text('Password can\'t be empty'), findsOneWidget);

await tester.enterText(
find.byWidgetPredicate(_emailFieldPredicate), '[email protected]');
find.byWidgetPredicate((Widget widget) =>
widget is CVTextField && widget.label == 'Email'),
'[email protected]');
await tester.tap(find.byType(CVPrimaryButton));
await tester.pumpAndSettle();

Expand Down

0 comments on commit fb4df78

Please sign in to comment.