mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
pull to refresh
This commit is contained in:
@ -66,17 +66,22 @@ class ACsView extends StatelessWidget {
|
|||||||
child: state is AcsLoadingState
|
child: state is AcsLoadingState
|
||||||
? const Center(
|
? const Center(
|
||||||
child: DefaultContainer(
|
child: DefaultContainer(
|
||||||
width: 50, height: 50, child: CircularProgressIndicator()),
|
width: 50, height: 50, child: CircularProgressIndicator()),)
|
||||||
)
|
: RefreshIndicator(
|
||||||
: Container(
|
onRefresh: () async {
|
||||||
|
BlocProvider.of<ACsBloc>(context).add(AcsInitial(allAcs: deviceModel != null ? false : true));
|
||||||
|
},
|
||||||
|
child:ListView(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
padding: const EdgeInsets.only(top: 40),
|
padding: const EdgeInsets.only(top: 40),
|
||||||
alignment: AlignmentDirectional.center,
|
alignment: AlignmentDirectional.center,
|
||||||
child:
|
child: deviceModel != null ? AcInterface(ac: deviceModel!) : const ACsList(),
|
||||||
deviceModel != null ? AcInterface(ac: deviceModel!) : const ACsList(),
|
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),),
|
||||||
),
|
),
|
||||||
),
|
));
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -29,6 +29,7 @@ class CeilingSensorInterface extends StatelessWidget {
|
|||||||
// .firstWhere((element) => element.code == "presence_state")
|
// .firstWhere((element) => element.code == "presence_state")
|
||||||
// .value
|
// .value
|
||||||
// .toString();
|
// .toString();
|
||||||
|
|
||||||
return BlocProvider(
|
return BlocProvider(
|
||||||
create: (context) =>
|
create: (context) =>
|
||||||
CeilingSensorBloc(deviceId: ceilingSensor.uuid ?? '')..add(InitialEvent()),
|
CeilingSensorBloc(deviceId: ceilingSensor.uuid ?? '')..add(InitialEvent()),
|
||||||
@ -69,14 +70,23 @@ class CeilingSensorInterface extends StatelessWidget {
|
|||||||
child: state is LoadingInitialState
|
child: state is LoadingInitialState
|
||||||
? const Center(
|
? const Center(
|
||||||
child: RefreshProgressIndicator(),
|
child: RefreshProgressIndicator(),
|
||||||
)
|
) : SafeArea(
|
||||||
: SafeArea(
|
child:
|
||||||
|
RefreshIndicator(
|
||||||
|
onRefresh: () async {
|
||||||
|
BlocProvider.of<CeilingSensorBloc>(context).add(InitialEvent());
|
||||||
|
},
|
||||||
|
child:Container(
|
||||||
|
child: ListView(
|
||||||
|
shrinkWrap: true,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
// InkWell(
|
// InkWell(
|
||||||
// onTap: () {
|
// onTap: () {
|
||||||
@ -116,6 +126,7 @@ class CeilingSensorInterface extends StatelessWidget {
|
|||||||
// },
|
// },
|
||||||
// child:
|
// child:
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
ceilingSensorModel.presenceState.toLowerCase() == 'motion'
|
ceilingSensorModel.presenceState.toLowerCase() == 'motion'
|
||||||
? Assets.assetsIconsPresenceSensorAssetsPresenceSensorMotion
|
? Assets.assetsIconsPresenceSensorAssetsPresenceSensorMotion
|
||||||
@ -150,8 +161,8 @@ class CeilingSensorInterface extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 3,
|
||||||
child: ListView(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
DefaultContainer(
|
DefaultContainer(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
@ -316,6 +327,12 @@ class CeilingSensorInterface extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
) ,
|
||||||
|
)
|
||||||
|
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -40,8 +40,7 @@ class GateWayView extends StatelessWidget {
|
|||||||
extendBody: true,
|
extendBody: true,
|
||||||
appBar:DeviceAppbar(
|
appBar:DeviceAppbar(
|
||||||
deviceName: 'Gateway',
|
deviceName: 'Gateway',
|
||||||
deviceUuid: gatewayObj.uuid!,
|
deviceUuid: gatewayObj.uuid!,),
|
||||||
),
|
|
||||||
body: Container(
|
body: Container(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
height: MediaQuery.sizeOf(context).height,
|
height: MediaQuery.sizeOf(context).height,
|
||||||
@ -55,6 +54,15 @@ class GateWayView extends StatelessWidget {
|
|||||||
opacity: 0.4,
|
opacity: 0.4,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: RefreshIndicator(
|
||||||
|
onRefresh:()async {
|
||||||
|
BlocProvider.of<GatewayBloc>(context).add(GatewayInitial(gatewayId: gatewayObj.uuid ?? ''));
|
||||||
|
},
|
||||||
|
child: ListView(
|
||||||
|
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -129,7 +137,12 @@ class GateWayView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)));
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,14 @@ class DoorInterface extends StatelessWidget {
|
|||||||
? const Center(
|
? const Center(
|
||||||
child: RefreshProgressIndicator(),
|
child: RefreshProgressIndicator(),
|
||||||
)
|
)
|
||||||
: Column(
|
:
|
||||||
|
|
||||||
|
RefreshIndicator(
|
||||||
|
onRefresh: () async {
|
||||||
|
BlocProvider.of<SmartDoorBloc>(context).add(InitialEvent());
|
||||||
|
},
|
||||||
|
child:
|
||||||
|
ListView(
|
||||||
children: [
|
children: [
|
||||||
DoorLockStatusBar(
|
DoorLockStatusBar(
|
||||||
smartDoorModel: smartDoorModel,
|
smartDoorModel: smartDoorModel,
|
||||||
@ -120,7 +127,7 @@ class DoorInterface extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
));
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -55,12 +55,21 @@ class ThreeGangScreen extends StatelessWidget {
|
|||||||
threeGangList: groupThreeGangModel,
|
threeGangList: groupThreeGangModel,
|
||||||
allSwitches: allSwitchesOn,
|
allSwitches: allSwitchesOn,
|
||||||
)
|
)
|
||||||
: Column(
|
: RefreshIndicator(
|
||||||
|
onRefresh:()async {
|
||||||
|
BlocProvider.of<ThreeGangBloc>(context).add(InitialEvent(groupScreen: device != null ? false : true));
|
||||||
|
},
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
const Expanded(child: SizedBox.shrink()),
|
const Expanded(child: SizedBox.shrink()),
|
||||||
Row(
|
Expanded(
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -147,6 +156,7 @@ class ThreeGangScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -373,7 +383,12 @@ class ThreeGangScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Expanded(child: SizedBox())
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -79,7 +79,17 @@ class WallMountedInterface extends StatelessWidget {
|
|||||||
child: RefreshProgressIndicator(),
|
child: RefreshProgressIndicator(),
|
||||||
)
|
)
|
||||||
: SafeArea(
|
: SafeArea(
|
||||||
|
child: RefreshIndicator(
|
||||||
|
onRefresh: () async {
|
||||||
|
BlocProvider.of<WallSensorBloc>(context).add(InitialEvent());
|
||||||
|
},
|
||||||
|
child:
|
||||||
|
ListView(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
PresenceIndicator(
|
PresenceIndicator(
|
||||||
state: wallSensorModel.presenceState,
|
state: wallSensorModel.presenceState,
|
||||||
@ -91,9 +101,12 @@ class WallMountedInterface extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user