@@ -19,13 +19,12 @@ class AddCategoryToFollowPage extends StatelessWidget {
1919  Widget  build (BuildContext  context) {
2020    final  l10n =  context.l10n;
2121    return  BlocProvider (
22-       create:  (context) =>  CategoriesFilterBloc (
23-         categoriesRepository:  context.read <HtDataRepository <Category >>(),
24-       )..add (CategoriesFilterRequested ()),
22+       create: 
23+           (context) =>  CategoriesFilterBloc (
24+             categoriesRepository:  context.read <HtDataRepository <Category >>(),
25+           )..add (CategoriesFilterRequested ()),
2526      child:  Scaffold (
26-         appBar:  AppBar (
27-           title:  Text (l10n.addCategoriesPageTitle),
28-         ),
27+         appBar:  AppBar (title:  Text (l10n.addCategoriesPageTitle)),
2928        body:  BlocBuilder <CategoriesFilterBloc , CategoriesFilterState >(
3029          builder:  (context, categoriesState) {
3130            if  (categoriesState.status ==  CategoriesFilterStatus .loading) {
@@ -34,15 +33,17 @@ class AddCategoryToFollowPage extends StatelessWidget {
3433            if  (categoriesState.status ==  CategoriesFilterStatus .failure) {
3534              var  errorMessage =  l10n.categoryFilterError;
3635              if  (categoriesState.error is  HtHttpException ) {
37-                 errorMessage =  (categoriesState.error!  as  HtHttpException ).message;
36+                 errorMessage = 
37+                     (categoriesState.error!  as  HtHttpException ).message;
3838              } else  if  (categoriesState.error !=  null ) {
3939                errorMessage =  categoriesState.error.toString ();
4040              }
4141              return  FailureStateWidget (
4242                message:  errorMessage,
43-                 onRetry:  () =>  context
44-                     .read <CategoriesFilterBloc >()
45-                     .add (CategoriesFilterRequested ()),
43+                 onRetry: 
44+                     () =>  context.read <CategoriesFilterBloc >().add (
45+                       CategoriesFilterRequested (),
46+                     ),
4647              );
4748            }
4849            if  (categoriesState.categories.isEmpty) {
@@ -52,9 +53,11 @@ class AddCategoryToFollowPage extends StatelessWidget {
5253            }
5354
5455            return  BlocBuilder <AccountBloc , AccountState >(
55-               buildWhen:  (previous, current) => 
56-                   previous.preferences? .followedCategories !=  current.preferences? .followedCategories || 
57-                   previous.status !=  current.status,
56+               buildWhen: 
57+                   (previous, current) => 
58+                       previous.preferences? .followedCategories != 
59+                           current.preferences? .followedCategories || 
60+                       previous.status !=  current.status,
5861              builder:  (context, accountState) {
5962                final  followedCategories = 
6063                    accountState.preferences? .followedCategories ??  [];
@@ -64,44 +67,49 @@ class AddCategoryToFollowPage extends StatelessWidget {
6467                  itemCount:  categoriesState.categories.length,
6568                  itemBuilder:  (context, index) {
6669                    final  category =  categoriesState.categories[index];
67-                     final  isFollowed =  followedCategories
68-                         .any ((fc) =>  fc.id ==  category.id);
70+                     final  isFollowed =  followedCategories.any (
71+                       (fc) =>  fc.id ==  category.id,
72+                     );
6973
7074                    return  Card (
7175                      margin:  const  EdgeInsets .only (bottom:  AppSpacing .sm),
7276                      child:  ListTile (
73-                         leading:  category.iconUrl !=  null  && 
74-                                 Uri .tryParse (category.iconUrl! )? .isAbsolute == 
75-                                     true 
76-                             ?  SizedBox (
77-                                 width:  36 ,
78-                                 height:  36 ,
79-                                 child:  Image .network (
80-                                   category.iconUrl! ,
81-                                   fit:  BoxFit .contain,
82-                                   errorBuilder: 
83-                                       (context, error, stackTrace) => 
84-                                           const  Icon (Icons .category_outlined),
85-                                 ),
86-                               )
87-                             :  const  Icon (Icons .category_outlined),
77+                         leading: 
78+                             category.iconUrl !=  null  && 
79+                                     Uri .tryParse (
80+                                           category.iconUrl! ,
81+                                         )? .isAbsolute == 
82+                                         true 
83+                                 ?  SizedBox (
84+                                   width:  36 ,
85+                                   height:  36 ,
86+                                   child:  Image .network (
87+                                     category.iconUrl! ,
88+                                     fit:  BoxFit .contain,
89+                                     errorBuilder: 
90+                                         (context, error, stackTrace) => 
91+                                             const  Icon (Icons .category_outlined),
92+                                   ),
93+                                 )
94+                                 :  const  Icon (Icons .category_outlined),
8895                        title:  Text (category.name),
8996                        trailing:  IconButton (
90-                           icon:  isFollowed
91-                               ?  Icon (
92-                                   Icons .check_circle,
93-                                   color:  Theme .of (context).colorScheme.primary,
94-                                 )
95-                               :  const  Icon (Icons .add_circle_outline),
96-                           tooltip:  isFollowed
97-                               ?  l10n.unfollowCategoryTooltip (category.name)
98-                               :  l10n.followCategoryTooltip (category.name),
97+                           icon: 
98+                               isFollowed
99+                                   ?  Icon (
100+                                     Icons .check_circle,
101+                                     color: 
102+                                         Theme .of (context).colorScheme.primary,
103+                                   )
104+                                   :  const  Icon (Icons .add_circle_outline),
105+                           tooltip: 
106+                               isFollowed
107+                                   ?  l10n.unfollowCategoryTooltip (category.name)
108+                                   :  l10n.followCategoryTooltip (category.name),
99109                          onPressed:  () {
100110                            context.read <AccountBloc >().add (
101-                                   AccountFollowCategoryToggled (
102-                                     category:  category,
103-                                   ),
104-                                 );
111+                               AccountFollowCategoryToggled (category:  category),
112+                             );
105113                          },
106114                        ),
107115                      ),
0 commit comments