pull to refresh

This commit is contained in:
mohammad
2024-07-03 16:48:46 +03:00
parent cef32e9bf3
commit 038ed680dd
6 changed files with 734 additions and 664 deletions
@@ -63,20 +63,25 @@ class ACsView extends StatelessWidget {
opacity: 0.4,
),
),
child: state is AcsLoadingState
? const Center(
child: DefaultContainer(
width: 50, height: 50, child: CircularProgressIndicator()),
)
: Container(
padding: const EdgeInsets.only(top: 40),
alignment: AlignmentDirectional.center,
child:
deviceModel != null ? AcInterface(ac: deviceModel!) : const ACsList(),
),
child: state is AcsLoadingState
? const Center(
child: DefaultContainer(
width: 50, height: 50, child: CircularProgressIndicator()),)
: RefreshIndicator(
onRefresh: () async {
BlocProvider.of<ACsBloc>(context).add(AcsInitial(allAcs: deviceModel != null ? false : true));
},
child:ListView(
children: [
Container(
padding: const EdgeInsets.only(top: 40),
alignment: AlignmentDirectional.center,
child: deviceModel != null ? AcInterface(ac: deviceModel!) : const ACsList(),
),
],
),),
),
);
));
},
),
);