mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 10:35:10 +00:00
Semi-implemented getting spaces feature
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.dart';
|
||||
|
||||
import '../../../../generated/assets.dart';
|
||||
|
||||
@ -25,10 +26,25 @@ class AppBody extends StatelessWidget {
|
||||
opacity: 0.4,
|
||||
),
|
||||
),
|
||||
child: PageView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: NavCubit.of(context).pageController,
|
||||
children: NavCubit.of(context).pages,
|
||||
child: BlocConsumer<SpacesCubit, SpacesState>(
|
||||
listener: (context, state) {
|
||||
if (state is SpacesError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.errMessage),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
return state is! SpacesLoading
|
||||
? PageView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: NavCubit.of(context).pageController,
|
||||
children: NavCubit.of(context).pages,
|
||||
)
|
||||
: const Center(child: CircularProgressIndicator());
|
||||
},
|
||||
)
|
||||
// NavCubit.of(context).currentPage,
|
||||
);
|
||||
|
Reference in New Issue
Block a user