1. save file as json

2. modify html to show all data
3. set black as the background color of appbar
This commit is contained in:
2024-12-18 10:28:29 +08:00
parent 2a4e21fa25
commit 747180e94f
29 changed files with 278 additions and 145 deletions

View File

@@ -79,7 +79,8 @@ class _MyHomePageState extends State<MyHomePage> {
// TRY THIS: Try changing the color here to a specific color (to
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
// change color while the other colors stay the same.
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
backgroundColor:
Colors.black, //Theme.of(context).colorScheme.inversePrimary,
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
@@ -163,7 +164,7 @@ class _MyHomePageState extends State<MyHomePage> {
await methodChannel.invokeMethod('getExternalDownloadsPath');
DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd_HH-mm-ss').format(now);
File file = File('$downloadsPath/$formattedDate.txt');
File file = File('$downloadsPath/$formattedDate.json');
var sink = file.openWrite();
sink.write(jsonEncode(mLightSensorEvents));
await sink.flush();