Skip to content

Commit 30a2835

Browse files
committed
Refactor: Use dart format command
1 parent cf6a5cc commit 30a2835

77 files changed

Lines changed: 1157 additions & 1004 deletions

File tree

Some content is hidden

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

coverage/lcov.info

Lines changed: 483 additions & 477 deletions
Large diffs are not rendered by default.

lib/src/core/adapters/google_books_adapter.dart

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ abstract class GoogleBooksAdapter {
1313
if (json['items'] == null) {
1414
return [];
1515
}
16-
return (json['items'] as List)
17-
.map((bookMap) => fromJson(bookMap))
18-
.toList();
16+
return (json['items'] as List).map((bookMap) => fromJson(bookMap)).toList();
1917
}
2018

2119
/// This method was extracted from the [BookModel] class in order to ensure that if one were to change the book API,
@@ -24,21 +22,21 @@ abstract class GoogleBooksAdapter {
2422
return BookModel(
2523
id: map['id'],
2624
title: map['volumeInfo']['title'],
27-
authors:
28-
List<String>.from(map['volumeInfo']['authors'] ?? ['Unknown Author'])
29-
.map((author) => AuthorModel(name: author))
30-
.toList(),
25+
authors: List<String>.from(
26+
map['volumeInfo']['authors'] ?? ['Unknown Author'],
27+
).map((author) => AuthorModel(name: author)).toList(),
3128
publisher: map['volumeInfo']['publisher'] ?? 'Unknown Publisher',
3229
description:
3330
map['volumeInfo']['description'] ?? 'No description available',
3431
categories: List<String>.from(
35-
map['volumeInfo']['categories'] ?? ['Unknown category'])
36-
.map((category) => CategoryModel(name: category))
37-
.toList(),
32+
map['volumeInfo']['categories'] ?? ['Unknown category'],
33+
).map((category) => CategoryModel(name: category)).toList(),
3834
pageCount: map['volumeInfo']['pageCount'] ?? 0,
39-
imageUrl: (map['volumeInfo']['imageLinks']?['thumbnail'] ??
35+
imageUrl:
36+
(map['volumeInfo']['imageLinks']?['thumbnail'] ??
4037
'https://books.google.com.br/googlebooks/images/no_cover_thumb.gif'),
41-
buyLink: map['volumeInfo']['infoLink'] ??
38+
buyLink:
39+
map['volumeInfo']['infoLink'] ??
4240
'https://play.google.com/store/books?',
4341
averageRating: (map['volumeInfo']['averageRating'] ?? 0.0).toDouble(),
4442
ratingsCount: map['volumeInfo']['ratingsCount'] ?? 0,

lib/src/core/database/local_database_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ class LocalDatabaseImpl implements LocalDatabase {
452452
descriptionMessage: e.toString(),
453453
);
454454
}
455-
455+
456456
if (e.isNotNullConstraintError()) {
457457
return LocalDatabaseException(
458458
LocalDatabaseErrorCode.notNullConstraint,

lib/src/core/models/book_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ enum BookStatus {
1010
return switch (this) {
1111
BookStatus.library => 1,
1212
BookStatus.reading => 2,
13-
BookStatus.loaned => 3
13+
BookStatus.loaned => 3,
1414
};
1515
}
1616

lib/src/core/models/loan_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class LoanModel {
66
final String idContact;
77
final String bookId;
88

9-
const LoanModel({
9+
const LoanModel({
1010
this.id,
1111
this.observation,
1212
required this.loanDate,

lib/src/core/models/user_hour_time_model.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ class UserHourTimeModel {
2323
// Calculate total minutes in starting time
2424
int startingTimeInMinutes = (startingHour * 60) + startingMinute;
2525

26-
// Calculate total minutes in ending time
26+
// Calculate total minutes in ending time
2727
int endingTimeInMinutes = (endingHour * 60) + endingMinute;
2828

29-
// Calculate the difference in minutes (handling negative values)
29+
// Calculate the difference in minutes (handling negative values)
3030
int differenceInMinutes = endingTimeInMinutes - startingTimeInMinutes;
3131
if (differenceInMinutes < 0) {
3232
// Add a day's worth of minutes if negative
3333
differenceInMinutes += 24 * 60;
3434
}
3535

36-
// Convert the difference in minutes to seconds
36+
// Convert the difference in minutes to seconds
3737
int differenceInSeconds = differenceInMinutes * 60;
3838
return differenceInSeconds;
3939
}
@@ -66,8 +66,9 @@ class UserHourTimeModel {
6666

6767
factory UserHourTimeModel.fromMap(Map<String, dynamic> map) {
6868
return UserHourTimeModel(
69-
repeatHourTimeType:
70-
RepeatHourTimeType.toType(map['repeatHourTimeType'] as int),
69+
repeatHourTimeType: RepeatHourTimeType.toType(
70+
map['repeatHourTimeType'] as int,
71+
),
7172
startingHour: map['startingHour'] as int,
7273
startingMinute: map['startingMinute'] as int,
7374
endingHour: map['endingHour'] as int,
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
abstract interface class BookCategoriesRepository {
2-
Future<List<Map<String, dynamic>>> getRelationshipsById(
3-
{required String bookId});
2+
Future<List<Map<String, dynamic>>> getRelationshipsById({
3+
required String bookId,
4+
});
45
Future<int> insert({required String bookId, required int categoryId});
56
Future<int> delete({required String bookId});
67
}

lib/src/core/repositories/book_on_case_repository/book_on_case_repository.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
abstract interface class BookOnCaseRepository {
2-
Future<List<Map<String, dynamic>>> getBooksOnCaseRelationship(
3-
{required int bookcaseId});
2+
Future<List<Map<String, dynamic>>> getBooksOnCaseRelationship({
3+
required int bookcaseId,
4+
});
45
Future<int> insert({
56
required int bookcaseId,
67
required String bookId,

lib/src/core/repositories/books_repository/books_repository.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ abstract interface class BooksRepository {
77
Future<List<BookModel>> getBooksByTitle({required String title});
88
Future<int> insert({required BookModel bookModel});
99
Future<bool> verifyBookIsAlreadyInserted({required String id});
10-
Future<BookStatus>getBookStatus({required String id});
11-
Future<int> updateBookStatus({required String id, required BookStatus status});
10+
Future<BookStatus> getBookStatus({required String id});
11+
Future<int> updateBookStatus({
12+
required String id,
13+
required BookStatus status,
14+
});
1215
Future<int> updateBookPageCount({required String id, required int pageCount});
1316
Future<int> countBooks();
1417
Future<int> deleteBookById({required String id});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:bookify/src/core/models/category_model.dart';
22

33
abstract interface class CategoriesRepository {
4-
Future<CategoryModel> getCategoryById({required int id});
4+
Future<CategoryModel> getCategoryById({required int id});
55
Future<int> insert({required CategoryModel categoryModel});
66
Future<int> getCategoryIdByColumnName({required String categoryName});
77
Future<int> deleteCategoryById({required int id});
8-
}
8+
}

0 commit comments

Comments
 (0)