forked from
grain.social/native
this repo has no description
1import 'package:flutter/material.dart';
2import 'package:grain/app_icons.dart';
3import 'package:grain/app_logger.dart';
4
5class LogPage extends StatelessWidget {
6 const LogPage({super.key});
7
8 @override
9 Widget build(BuildContext context) {
10 final theme = Theme.of(context);
11 final logs = InMemoryLogOutput.logs.reversed.toList();
12
13 return Scaffold(
14 appBar: AppBar(
15 title: Text('Logs'),
16 backgroundColor: theme.appBarTheme.backgroundColor,
17 actions: [
18 IconButton(
19 icon: Icon(AppIcons.delete, color: theme.iconTheme.color),
20 onPressed: () {
21 InMemoryLogOutput.clear();
22 (context as Element).markNeedsBuild();
23 },
24 ),
25 ],
26 ),
27 backgroundColor: theme.scaffoldBackgroundColor,
28 body: ListView.builder(
29 itemCount: logs.length,
30 itemBuilder: (_, index) => Padding(
31 padding: const EdgeInsets.all(4.0),
32 child: Text(logs[index], style: theme.textTheme.bodyMedium),
33 ),
34 ),
35 );
36 }
37}