Skip to content

Commit

Permalink
chore: fix require_trailing_commas (#3977)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Oct 14, 2023
1 parent dc1958c commit 950d70d
Show file tree
Hide file tree
Showing 29 changed files with 136 additions and 138 deletions.
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ linter:
- implicit_call_tearoffs
- implicit_reopen
- invalid_case_patterns
- iterable_contains_unrelated_type
- join_return_with_assignment
- leading_newlines_in_multiline_strings
- library_annotations
- library_names
- library_prefixes
- library_private_types_in_public_api
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void main() {
models: mockModels,
model: mockModel,
years: mockYears,
).copyWith(year: mockYear)
).copyWith(year: mockYear),
],
verify: (_) => verifyInOrder([
newCarRepository.fetchBrands,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class HomePage extends StatelessWidget {
onPressed: () {
context.read<AppBloc>().add(const AppLogoutRequested());
},
)
),
],
),
body: Align(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void main() {
(p) => p.child,
'child',
isA<HomePage>(),
)
),
],
);
});
Expand All @@ -27,7 +27,7 @@ void main() {
(p) => p.child,
'child',
isA<LoginPage>(),
)
),
],
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void main() {
email: validEmail,
password: validPassword,
isValid: true,
)
),
],
);

Expand Down Expand Up @@ -174,7 +174,7 @@ void main() {
email: validEmail,
password: validPassword,
isValid: true,
)
),
],
);

Expand Down Expand Up @@ -208,7 +208,7 @@ void main() {
email: validEmail,
password: validPassword,
isValid: true,
)
),
],
);
});
Expand All @@ -230,7 +230,7 @@ void main() {
act: (cubit) => cubit.logInWithGoogle(),
expect: () => const <LoginState>[
LoginState(status: FormzSubmissionStatus.inProgress),
LoginState(status: FormzSubmissionStatus.success)
LoginState(status: FormzSubmissionStatus.success),
],
);

Expand All @@ -249,7 +249,7 @@ void main() {
LoginState(
status: FormzSubmissionStatus.failure,
errorMessage: 'oops',
)
),
],
);

Expand All @@ -265,7 +265,7 @@ void main() {
act: (cubit) => cubit.logInWithGoogle(),
expect: () => const <LoginState>[
LoginState(status: FormzSubmissionStatus.inProgress),
LoginState(status: FormzSubmissionStatus.failure)
LoginState(status: FormzSubmissionStatus.failure),
],
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void main() {
password: validPassword,
confirmedPassword: validConfirmedPassword,
isValid: true,
)
),
],
);

Expand Down Expand Up @@ -283,7 +283,7 @@ void main() {
password: validPassword,
confirmedPassword: validConfirmedPassword,
isValid: true,
)
),
],
);

Expand Down Expand Up @@ -320,7 +320,7 @@ void main() {
password: validPassword,
confirmedPassword: validConfirmedPassword,
isValid: true,
)
),
],
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
group('PostBloc', () {
const mockPosts = [Post(id: 1, title: 'post title', body: 'post body')];
const extraMockPosts = [
Post(id: 2, title: 'post title', body: 'post body')
Post(id: 2, title: 'post title', body: 'post body'),
];

late http.Client httpClient;
Expand Down Expand Up @@ -58,7 +58,7 @@ void main() {
build: () => PostBloc(httpClient: httpClient),
act: (bloc) => bloc.add(PostFetched()),
expect: () => const <PostState>[
PostState(status: PostStatus.success, posts: mockPosts)
PostState(status: PostStatus.success, posts: mockPosts),
],
verify: (_) {
verify(() => httpClient.get(_postsUrl(start: 0))).called(1);
Expand All @@ -80,7 +80,7 @@ void main() {
..add(PostFetched())
..add(PostFetched()),
expect: () => const <PostState>[
PostState(status: PostStatus.success, posts: mockPosts)
PostState(status: PostStatus.success, posts: mockPosts),
],
verify: (_) {
verify(() => httpClient.get(any())).called(1);
Expand All @@ -104,7 +104,7 @@ void main() {
bloc.add(PostFetched());
},
expect: () => const <PostState>[
PostState(status: PostStatus.success, posts: mockPosts)
PostState(status: PostStatus.success, posts: mockPosts),
],
verify: (_) {
verify(() => httpClient.get(any())).called(1);
Expand Down Expand Up @@ -145,7 +145,7 @@ void main() {
status: PostStatus.success,
posts: mockPosts,
hasReachedMax: true,
)
),
],
verify: (_) {
verify(() => httpClient.get(_postsUrl(start: 1))).called(1);
Expand Down Expand Up @@ -173,7 +173,7 @@ void main() {
PostState(
status: PostStatus.success,
posts: [...mockPosts, ...extraMockPosts],
)
),
],
verify: (_) {
verify(() => httpClient.get(_postsUrl(start: 1))).called(1);
Expand Down
2 changes: 1 addition & 1 deletion examples/flutter_shopping_cart/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class App extends StatelessWidget {
create: (_) => CartBloc(
shoppingRepository: shoppingRepository,
)..add(CartStarted()),
)
),
],
child: MaterialApp(
title: 'Flutter Bloc Shopping Cart',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CartPage extends StatelessWidget {
),
),
Divider(height: 4, color: Colors.black),
CartTotal()
CartTotal(),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void main() {
seed: () => CartLoaded(cart: Cart(items: mockItems)),
act: (bloc) => bloc.add(CartItemAdded(mockItemToAdd)),
expect: () => <CartState>[
CartLoaded(cart: Cart(items: [...mockItems, mockItemToAdd]))
CartLoaded(cart: Cart(items: [...mockItems, mockItemToAdd])),
],
verify: (_) {
verify(() => shoppingRepository.addItemToCart(mockItemToAdd)).called(1);
Expand Down Expand Up @@ -112,7 +112,7 @@ void main() {
seed: () => CartLoaded(cart: Cart(items: mockItems)),
act: (bloc) => bloc.add(CartItemRemoved(mockItemToRemove)),
expect: () => <CartState>[
CartLoaded(cart: Cart(items: [...mockItems]..remove(mockItemToRemove)))
CartLoaded(cart: Cart(items: [...mockItems]..remove(mockItemToRemove))),
],
verify: (_) {
verify(
Expand Down
2 changes: 1 addition & 1 deletion examples/flutter_timer/lib/timer/view/timer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Actions extends StatelessWidget {
context.read<TimerBloc>().add(const TimerReset()),
),
]
}
},
],
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class LocalStorageTodosApi extends TodosApi {
final changedTodosAmount =
todos.where((t) => t.isCompleted != isCompleted).length;
final newTodos = [
for (final todo in todos) todo.copyWith(isCompleted: isCompleted)
for (final todo in todos) todo.copyWith(isCompleted: isCompleted),
];
_todoStreamController.add(newTodos);
await _setValue(kTodosCollectionKey, json.encode(newTodos));
Expand Down
Loading

0 comments on commit 950d70d

Please sign in to comment.