-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from flow-mn/sadespresso/polishes-0-12-20250216
Sadespresso/polishes 0 12 20250216
- Loading branch information
Showing
31 changed files
with
489 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import "dart:io"; | ||
|
||
import "package:flow/main.dart" show mainLogAppender; | ||
import "package:flow/utils/extensions/custom_popups.dart"; | ||
import "package:flow/utils/extensions/num.dart"; | ||
import "package:flutter/material.dart"; | ||
import "package:material_symbols_icons/symbols.dart"; | ||
import "package:moment_dart/moment_dart.dart"; | ||
import "package:path/path.dart" as path; | ||
|
||
class DebugLogsPage extends StatefulWidget { | ||
const DebugLogsPage({super.key}); | ||
|
||
@override | ||
State<DebugLogsPage> createState() => _DebugLogsPageState(); | ||
} | ||
|
||
class _DebugLogsPageState extends State<DebugLogsPage> { | ||
bool appenderAvailable = false; | ||
|
||
List<File>? files; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
appenderAvailable = mainLogAppender != null; | ||
files = mainLogAppender?.getAllLogFiles(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(title: Text("Debug logs")), | ||
body: SingleChildScrollView( | ||
child: | ||
files?.isNotEmpty == true | ||
? Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: | ||
files! | ||
.map( | ||
(file) => ListTile( | ||
title: Text(path.basename(file.path)), | ||
subtitle: Text( | ||
[ | ||
file | ||
.lastModifiedSync() | ||
.toLocal() | ||
.toMoment() | ||
.llll, | ||
file.statSync().size.humanReadableBinarySize, | ||
].join(" • "), | ||
), | ||
trailing: Builder( | ||
builder: (context) { | ||
return IconButton( | ||
onPressed: | ||
() => showShareSheet( | ||
file.path, | ||
context.findRenderObject(), | ||
), | ||
icon: Icon(Symbols.share_rounded), | ||
); | ||
}, | ||
), | ||
), | ||
) | ||
.toList(), | ||
) | ||
: Center(child: Text("No log files found")), | ||
), | ||
); | ||
} | ||
|
||
Future<void> showShareSheet(String path, RenderObject? renderObject) async { | ||
final RenderBox? renderBox = | ||
renderObject is RenderBox ? renderObject : null; | ||
|
||
await context.showShareSheet( | ||
subject: "Share log files", | ||
filePath: path, | ||
renderBox: renderBox, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.