forked from eatvio/eatvio_app
feat(diary): add diary, calendar, meals, products, add product button, modal add product
This commit is contained in:
@@ -35,23 +35,17 @@ class SubscribersBloc extends Bloc<SubscribersEvent, SubscribersState> {
|
||||
'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}',
|
||||
},
|
||||
);
|
||||
print('Got response');
|
||||
print(response.statusCode);
|
||||
print(response.body);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print('Got 200');
|
||||
final data = jsonDecode(response.body);
|
||||
if (data is List<dynamic>) {
|
||||
print('Got List');
|
||||
if (state is SubscribersLoadedState) {
|
||||
print('Got loaded');
|
||||
var currentState = state as SubscribersLoadedState;
|
||||
emit((currentState).copyWith(
|
||||
subscribers: data,
|
||||
myProfileModelObj: currentState.myProfileModelObj,
|
||||
));
|
||||
} else {
|
||||
print('Got unloaded');
|
||||
emit(SubscribersLoadedState(
|
||||
subscribers: data,
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user