Skip to content

Commit

Permalink
fix(lints): single quote and const constructor rules (#150)
Browse files Browse the repository at this point in the history
Fix lint rules for these rules:
* prefer_single_quotes
* prefer_const_constructors

Signed-off-by: Manjot Sidhu <[email protected]>
  • Loading branch information
manjotsidhu authored Oct 6, 2021
1 parent b67696e commit d0305c2
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,4 @@ linter:

prefer_typing_uninitialized_variables: false

prefer_const_constructors_in_immutables: false

prefer_single_quotes: false
prefer_const_constructors_in_immutables: true
2 changes: 1 addition & 1 deletion lib/ui/components/cv_flat_button.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

class CVFlatButton extends StatefulWidget {
CVFlatButton({
const CVFlatButton({
@required Key key,
@required this.triggerFunction,
@required this.buttonText,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/components/cv_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CVTabBar extends StatelessWidget implements PreferredSizeWidget {
final Color color;
final TabBar tabBar;

CVTabBar({this.color, this.tabBar});
const CVTabBar({this.color, this.tabBar});

@override
Size get preferredSize => tabBar.preferredSize;
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/components/cv_typeahead_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CVTypeAheadField extends StatelessWidget {
/// When a [TextInputType] is not specified, it defaults to [TextInputType.text]
///
/// When `maxLines` is not specified, it defaults to 1
CVTypeAheadField({
const CVTypeAheadField({
Key key,
@required this.label,
this.type = TextInputType.text,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/base_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BaseView<T extends BaseModel> extends StatefulWidget {
final Function(T) onModelDestroy;
final T model;

BaseView({
const BaseView({
@required this.builder,
this.onModelReady,
this.onModelDestroy,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/ib/components/ib_pop_quiz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class IbPopQuiz extends StatelessWidget {
final BuildContext context;
final List<IbPopQuizQuestion> questions;

IbPopQuiz({this.context, this.questions});
const IbPopQuiz({this.context, this.questions});

Widget _buildQuestion(int questionNumber, IbPopQuizQuestion question) {
var buttonsWidgets = <Widget>[];
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/ib/components/ib_pop_quiz_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class IbPopQuizButton extends StatefulWidget {
final String content;
final bool isCorrect;

IbPopQuizButton({
const IbPopQuizButton({
@required this.content,
@required this.isCorrect,
});
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/ib/ib_page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IbPageView extends StatefulWidget {
final SetPageCallback setPage;
final IbChapter chapter;

IbPageView({
const IbPageView({
@required Key key,
@required this.tocCallback,
@required this.chapter,
Expand Down

0 comments on commit d0305c2

Please sign in to comment.