Fixed log details screen client mobile

This commit is contained in:
Juan Gilsanz Polo 2023-05-04 20:35:54 +02:00
parent c8d395396a
commit d628e56248

View file

@ -111,6 +111,8 @@ class _LogsListClientState extends State<LogsListClient> {
@override
Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (widget.ip != previousIp) {
setState(() => loadStatus = 0);
if (scrollController.hasClients) scrollController.animateTo(0, duration: const Duration(milliseconds: 1), curve: Curves.ease);
@ -165,13 +167,25 @@ class _LogsListClientState extends State<LogsListClient> {
index: index,
length: logsData!.data.length,
useAlwaysNormalTile: true,
onLogTap: (log) => showDialog(
context: context,
builder: (context) => LogDetailsScreen(
log: log,
dialog: true
)
)
onLogTap: (log) => {
if (width > 700) {
showDialog(
context: context,
builder: (context) => LogDetailsScreen(
log: log,
dialog: true
)
)
}
else {
Navigator.push(context, MaterialPageRoute(
builder: (context) => LogDetailsScreen(
log: log,
dialog: false
)
))
}
}
);
}
}