Skip to content

Commit 4e39950

Browse files
committed
dart format
1 parent 834d350 commit 4e39950

File tree

6 files changed

+27
-31
lines changed

6 files changed

+27
-31
lines changed

compass_app/app/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ publish_to: none
55
version: 0.1.0
66

77
environment:
8-
sdk: ^3.6.0
8+
sdk: ^3.7.0-0
99

1010
dependencies:
1111
cached_network_image: ^3.4.1

testing_app/integration_test/state_mgmt_test.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import 'package:testing_app/screens/favorites.dart';
1212
late Favorites favoritesList;
1313

1414
Widget createFavoritesScreen() => ChangeNotifierProvider<Favorites>(
15-
create: (context) {
16-
favoritesList = Favorites();
17-
return favoritesList;
18-
},
19-
child: const MaterialApp(home: FavoritesPage()),
20-
);
15+
create: (context) {
16+
favoritesList = Favorites();
17+
return favoritesList;
18+
},
19+
child: const MaterialApp(home: FavoritesPage()),
20+
);
2121

2222
void main() {
2323
group('Testing App State Management Tests', () {

testing_app/lib/screens/favorites.dart

+8-11
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ class FavoritesPage extends StatelessWidget {
1717
return Scaffold(
1818
appBar: AppBar(title: const Text('Favorites')),
1919
body: Consumer<Favorites>(
20-
builder:
21-
(context, value, child) =>
22-
value.items.isNotEmpty
23-
? ListView.builder(
24-
itemCount: value.items.length,
25-
padding: const EdgeInsets.symmetric(vertical: 16),
26-
itemBuilder:
27-
(context, index) =>
28-
FavoriteItemTile(value.items[index]),
29-
)
30-
: const Center(child: Text('No favorites added.')),
20+
builder: (context, value, child) => value.items.isNotEmpty
21+
? ListView.builder(
22+
itemCount: value.items.length,
23+
padding: const EdgeInsets.symmetric(vertical: 16),
24+
itemBuilder: (context, index) =>
25+
FavoriteItemTile(value.items[index]),
26+
)
27+
: const Center(child: Text('No favorites added.')),
3128
),
3229
);
3330
}

testing_app/lib/screens/home.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ class ItemTile extends StatelessWidget {
5757
title: Text('Item $itemNo', key: Key('text_$itemNo')),
5858
trailing: IconButton(
5959
key: Key('icon_$itemNo'),
60-
icon:
61-
favoritesList.items.contains(itemNo)
62-
? const Icon(Icons.favorite)
63-
: const Icon(Icons.favorite_border),
60+
icon: favoritesList.items.contains(itemNo)
61+
? const Icon(Icons.favorite)
62+
: const Icon(Icons.favorite_border),
6463
onPressed: () {
6564
!favoritesList.items.contains(itemNo)
6665
? favoritesList.add(itemNo)

testing_app/test/favorites_test.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import 'package:testing_app/screens/favorites.dart';
1111
late Favorites favoritesList;
1212

1313
Widget createFavoritesScreen() => ChangeNotifierProvider<Favorites>(
14-
create: (context) {
15-
favoritesList = Favorites();
16-
return favoritesList;
17-
},
18-
child: const MaterialApp(home: FavoritesPage()),
19-
);
14+
create: (context) {
15+
favoritesList = Favorites();
16+
return favoritesList;
17+
},
18+
child: const MaterialApp(home: FavoritesPage()),
19+
);
2020

2121
void addItems() {
2222
for (var i = 0; i < 5; i++) {

testing_app/test/home_test.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import 'package:testing_app/main.dart';
99
import 'package:testing_app/models/favorites.dart';
1010

1111
Widget createHomeScreen() => ChangeNotifierProvider<Favorites>(
12-
create: (context) => Favorites(),
13-
child: MaterialApp.router(routerConfig: router()),
14-
);
12+
create: (context) => Favorites(),
13+
child: MaterialApp.router(routerConfig: router()),
14+
);
1515

1616
void main() {
1717
group('Home Page Widget Tests', () {

0 commit comments

Comments
 (0)