diff --git a/README.md b/README.md index 9031f5b..bc92f83 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# light_sesnor_capture +# light_sensor_capture A new Flutter project. diff --git a/android/app/build.gradle b/android/app/build.gradle index 9601de7..f6929d0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,7 +6,7 @@ plugins { } android { - namespace = "tw.moonjuice.light_sesnor_capture" + namespace = "tw.moonjuice.light_sensor_capture" compileSdk = flutter.compileSdkVersion ndkVersion "25.1.8937393" @@ -20,7 +20,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "tw.moonjuice.light_sesnor_capture" + applicationId = "tw.moonjuice.light_sensor_capture" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2014f24..0b434ed 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - light_sesnor_capture + light_sensor_capture CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/main.dart b/lib/main.dart index 84859b7..8c3142a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:light_sesnor_capture/light_sensor_event.dart'; +import 'package:light_sensor_capture/light_sensor_event.dart'; import 'package:intl/intl.dart'; void main() { @@ -111,9 +111,21 @@ class _MyHomePageState extends State { if (mState == 1) { mLightSensorEvents.add(snapshot.data); } - return Text( - 'Sensor Data: ${jsonEncode(snapshot.data)}', - style: Theme.of(context).textTheme.headlineLarge, + return Column( + children: [ + Text( + 'Sensor Data:', + style: Theme.of(context).textTheme.headlineLarge, + ), + Text( + snapshot.data!.lux.toString(), + style: Theme.of(context).textTheme.headlineLarge, + ), + Text( + snapshot.data!.timestamp.toString(), + style: Theme.of(context).textTheme.headlineLarge, + ) + ], ); } else { return const CircularProgressIndicator(); diff --git a/pubspec.yaml b/pubspec.yaml index 87cdcfd..f339b95 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: light_sesnor_capture +name: light_sensor_capture description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. diff --git a/test/widget_test.dart b/test/widget_test.dart index 922a073..089a31f 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:light_sesnor_capture/main.dart'; +import 'package:light_sensor_capture/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async {