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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (widget.ip != previousIp) { if (widget.ip != previousIp) {
setState(() => loadStatus = 0); setState(() => loadStatus = 0);
if (scrollController.hasClients) scrollController.animateTo(0, duration: const Duration(milliseconds: 1), curve: Curves.ease); 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, index: index,
length: logsData!.data.length, length: logsData!.data.length,
useAlwaysNormalTile: true, useAlwaysNormalTile: true,
onLogTap: (log) => showDialog( onLogTap: (log) => {
if (width > 700) {
showDialog(
context: context, context: context,
builder: (context) => LogDetailsScreen( builder: (context) => LogDetailsScreen(
log: log, log: log,
dialog: true dialog: true
) )
) )
}
else {
Navigator.push(context, MaterialPageRoute(
builder: (context) => LogDetailsScreen(
log: log,
dialog: false
)
))
}
}
); );
} }
} }