Commit 9a688169 authored by Nicolas Richard Walter Boeckh's avatar Nicolas Richard Walter Boeckh 💬

Graph relocation, DB start

parent 97210f76
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_blue","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_blue-0.7.2\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.2.1\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.2\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.4+1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.0\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.2.0+hotfix.3\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.7+2\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"android":[{"name":"flutter_blue","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_blue-0.7.2\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.2.1\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.2\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.4+1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.0\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.2.0+hotfix.3\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.7+2\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-0.0.1+8\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-0.1.2+5\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_blue","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2020-07-09 14:40:40.685116","version":"1.19.0-2.0.pre.49"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_blue","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_blue-0.7.2\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.2.1\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.2\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.4+1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.0\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.2.0+hotfix.3\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.7+2\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"android":[{"name":"flutter_blue","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_blue-0.7.2\\\\","dependencies":[]},{"name":"geolocator","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\geolocator-5.2.1\\\\","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_api_availability-2.0.2\\\\","dependencies":[]},{"name":"location_permissions","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location_permissions-2.0.4+1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.0\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.2.0+hotfix.3\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences-0.5.7+2\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-0.0.1+8\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.2.0\\\\","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-0.1.2+5\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_blue","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2020-07-10 11:57:41.663176","version":"1.20.0-3.0.pre.126"}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import 'package:logair_application/utils/utils.dart';
/// and contains methods for:
/// quick lookup,
/// conversion to POST format,
/// TODO Extra data
class DataPacket {
List<int> _data;
int _timestamp;
......@@ -70,8 +71,9 @@ class DataPacket {
this._speed = position.speed;
}
}
}
DataPacket.fromData(this._timestamp, this._latitude, this._longitude, this._altitude, this._heading, this._speed, this._temperature, this._pressure, this._relativeHumidity, this._pm1, this._pm2_5, this._pm4, this._pm10);
String stringify() => '${this._latitude}, ${this._longitude}, ${this._temperature}, ${this._pressure}, ${this._relativeHumidity}, ${this._pm2_5}, ${this._pm10}';
......@@ -90,4 +92,28 @@ class DataPacket {
this._pm4,
this._pm10
];
Map<String, dynamic> toMap() {
return {
'timestamp_nix': this._timestamp,
'latitude': this._latitude,
'longitude': this._longitude,
'altitude': this._altitude,
'speed': this._speed,
'heading': this._heading,
'temperature': this._temperature,
'relative_humidity': this._temperature,
'pressure': this._pressure,
'pm_1': this._pm1,
'pm_2_5': this._pm2_5,
'pm_4': this._pm4,
'pm_10': this._pm10,
};
}
@override
String toString() {
// TODO: implement toString
return 'DataPacket{time: $_timestamp, lat: $_latitude, long: $_longitude, pm1: $_pm1, pm2.5: $_pm2_5, pm4: $_pm4, pm10: $_pm10';
}
}
\ No newline at end of file
import 'package:logair_application/logic/data_packet.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
class DatabaseHandler {
factory DatabaseHandler() => _singleton;
Future<Database> _database;
void _init() async {
this._database = openDatabase(
join((await getDatabasesPath()), 'logair_data.db'),
version: 1,
onCreate: (db, version) => db.execute('''CREATE TABLE data(
id INTEGER PRIMARY KEY AUTOINCREMENT,
device_id TEXT,
timestamp_nix INTEGER,
latitude REAL,
longitude REAL,
altitude INTEGER,
speed REAL,
heading INTEGER,
temperature FLOAT,
relative_humidity FLOAT,
pressure FLOAT,
pm_1 FLOAT,
pm_2_5 FLOAT,
pm_4 FLOAT,
pm_10 FLOAT,
extra TEXT
)''')
);
}
DatabaseHandler._internal() { this._init(); }
static final DatabaseHandler _singleton = new DatabaseHandler._internal();
Future<void> insertData(DataPacket packet) async {
final Database database = await _database;
await database.insert(
'data',
packet.toMap(),
conflictAlgorithm: ConflictAlgorithm.replace
);
}
}
\ No newline at end of file
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:device_preview/device_preview.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:logair_application/logic/controllers/home_controller.dart';
import 'package:logair_application/logic/controllers/map_display_controller.dart';
import 'package:logair_application/logic/handlers/data_handler.dart';
import 'package:logair_application/logic/handlers/network_handler.dart';
import 'package:logair_application/logic/handlers/position_handler.dart';
import 'package:logair_application/logic/handlers/preference_handler.dart';
import 'package:logair_application/logic/handlers/bluetooth_le_handler.dart';
import 'package:logair_application/ui/routes/home.dart';
import 'package:logair_application/localization/localization_delegate.dart';
......@@ -26,16 +17,6 @@ void main() {
runApp(displayMode ? DevicePreview(child: LogAirApplication()) : LogAirApplication());
}
Future<void> _startHandlers() async {
HomeController();
BTLEHandler();
NetworkHandler();
DataHandler();
PreferencesHandler();
PositionHandler();
MapDisplayController();
}
class LogAirApplication extends StatelessWidget {
static const String _title = 'LogAir Connector';
......
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:logair_application/ui/components/graph/graph_colors.dart';
import 'package:logair_application/ui/components/graph/indicator.dart';
class Graph extends StatefulWidget {
Graph({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() => _GraphState();
}
class _GraphState extends State<Graph> {
_GraphState({Key key});
int touchedIndex;
List<LineChartBarData> linesBarData1() {
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: [
FlSpot(1, 1),
FlSpot(3, 1.5),
FlSpot(5, 1.4),
FlSpot(7, 3.4),
FlSpot(10, 2),
FlSpot(12, 2.2),
FlSpot(13, 1.8),
],
isCurved: false,
colors: [
GraphColors.PM1.color,
],
barWidth: 4,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
);
final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: [
FlSpot(1, 1),
FlSpot(3, 2.8),
FlSpot(7, 1.2),
FlSpot(10, 2.8),
FlSpot(12, 2.6),
FlSpot(13, 3.9),
],
colors: [
GraphColors.PM2_5.color,
],
barWidth: 4,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
);
final LineChartBarData lineChartBarData3 = LineChartBarData(
spots: [
FlSpot(1, 2.8),
FlSpot(3, 1.9),
FlSpot(6, 3),
FlSpot(10, 1.3),
FlSpot(13, 2.5),
],
colors: [
GraphColors.PM4.color,
],
barWidth: 4,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
);
final LineChartBarData lineChartBarData4 = LineChartBarData(
spots: [
FlSpot(1, 1.8),
FlSpot(3, 4.9),
FlSpot(6, 4),
FlSpot(10, 12),
FlSpot(13, 12.5),
],
colors: [
GraphColors.PM10.color,
],
barWidth: 4,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
);
return [
lineChartBarData1,
lineChartBarData2,
lineChartBarData3,
lineChartBarData4,
];
}
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
flex: 2,
child: AspectRatio(
aspectRatio: 1.5,
child: Padding(
padding: EdgeInsets.only(top: 10, bottom: 4, right: 4),
child: LineChart(
LineChartData(
lineTouchData: LineTouchData(
touchCallback: (lineTouchResponse) => {
print(lineTouchResponse.lineBarSpots.map((e) => e.props))
},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true,
),
// Build from DataPacket would enable getting every 10 seconds add HH:mm:ss
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
reservedSize: 22,
textStyle: const TextStyle(
color: Color(0xff72719b),
fontSize: 12,
),
margin: 10,
getTitles: (value) {
if (value % 10 == 0)
return 'v';
return '';
},
),
// TODO Set values for PM
leftTitles: SideTitles(
showTitles: true,
textStyle: const TextStyle(
color: Color(0xff75729e),
fontSize: 12,
),
getTitles: (value) {
switch (value.toInt()) {
case 1:
return 'WIP';
}
return '';
},
margin: 8,
reservedSize: 30,
),
),
borderData: FlBorderData(
border: const Border(
bottom: BorderSide(
color: Color(0xff4e4965),
width: 4,
),
),
),
minX: 0,
minY: 0,
lineBarsData: linesBarData1(),
)
),
),
),
),
Expanded(
flex: 1,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Indicator(
color: GraphColors.PM1.color,
text: 'PM 1',
isSquare: true,
),
SizedBox(
height: 4,
),
Indicator(
color: GraphColors.PM2_5.color,
text: 'PM 2.5',
isSquare: true,
),
SizedBox(
height: 4,
),
Indicator(
color: GraphColors.PM4.color,
text: 'PM 4',
isSquare: true,
),
SizedBox(
height: 4,
),
Indicator(
color: GraphColors.PM10.color,
text: 'PM 10',
isSquare: true,
),
SizedBox(
height: 18,
),
],
)
)
]
);
}
}
import 'package:flutter/material.dart';
class GraphColors {
final String _key;
final Color _value;
const GraphColors._internal(this._key, this._value);
toString() => 'Enum.$_key ~> $_value';
Color get color => _value;
static const PM1 = const GraphColors._internal('PM1', Color(0xff0293ee));
static const PM2_5 = const GraphColors._internal('PM2.5', Color(0xfff8b250));
static const PM4 = const GraphColors._internal('PM4', Color(0xff845bef));
static const PM10 = const GraphColors._internal('PM10', Color(0xff13d38e));
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import 'package:logair_application/logic/handlers/data_handler.dart';
import 'package:logair_application/logic/handlers/position_handler.dart';
import 'package:logair_application/logic/data_packet.dart';
import 'package:logair_application/ui/carousel_card.dart';
import 'package:logair_application/ui/components/graph/graph.dart';
import 'package:logair_application/ui/components/graph/indicator.dart';
class DataWidget extends StatelessWidget {
......@@ -72,7 +73,7 @@ class DataWidget extends StatelessWidget {
child: Column(
children: [
// Local data (Chart + Data points)
Chart(),
Graph(),
Container(
padding: EdgeInsets.symmetric(horizontal: 3),
height: 300,
......@@ -96,15 +97,7 @@ class DataWidget extends StatelessWidget {
),
],
),
),
Container(
height: 220,
),
Container(
height: 50,
child: Text('WIP Chart')
),
)
],
)
)
......@@ -112,192 +105,3 @@ class DataWidget extends StatelessWidget {
return CarouselCard(child: widget);
}
}
class Chart extends StatefulWidget {
Chart({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() => _ChartState();
}
class _ChartState extends State<Chart> {
_ChartState({Key key});
int touchedIndex;
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
flex: 2,
child: LineChart(
LineChartData(
lineTouchData: LineTouchData(
touchCallback: (lineTouchResponse) => {
},
handleBuiltInTouches: false,
),
gridData: FlGridData(
show: true,
),
// Build from DataPacket would enable getting every 10 seconds add HH:mm:ss
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
reservedSize: 22,
textStyle: const TextStyle(
color: Color(0xff72719b),
fontSize: 12,
),
margin: 10,
getTitles: (value) {
switch (value.toInt()) {
case 1:
return 'WIP';
}
return '';
},
),
// TODO Set values for PM
leftTitles: SideTitles(
showTitles: true,
textStyle: const TextStyle(
color: Color(0xff75729e),
fontSize: 12,
),
getTitles: (value) {
switch (value.toInt()) {
case 1:
return 'WIP';
}
return '';
},
margin: 8,
reservedSize: 30,
),
),
borderData: FlBorderData(
border: const Border(
bottom: BorderSide(
color: Color(0xff4e4965),
width: 4,
),
),
),
minX: 0,
maxX: 14,
maxY: 4,
minY: 0,
lineBarsData: linesBarData1(),
)
)
),
Expanded(
flex: 1,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Indicator(
color: Color(0xff0293ee),
text: 'PM 1',
isSquare: true,
),
SizedBox(
height: 4,
),
Indicator(
color: Color(0xfff8b250),
text: 'PM 2.5',
isSquare: true,
),
SizedBox(
height: 4,
),
Indicator(
color: Color(0xff845bef),
text: 'PM 4',
isSquare: true,
),
SizedBox(
height: 4,
),
Indicator(
color: Color(0xff13d38e),
text: 'PM 10',
isSquare: true,
),
SizedBox(
height: 18,
),
],
)
)
]
);
}
}
List<LineChartBarData> linesBarData1() {
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: [
FlSpot(1, 1),
FlSpot(3, 1.5),
FlSpot(5, 1.4),
FlSpot(7, 3.4),
FlSpot(10, 2),
FlSpot(12, 2.2),
FlSpot(13, 1.8),
],
isCurved: false,
colors: [
const Color(0xff4af699),
],
barWidth: 6,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
);
final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: [
FlSpot(1, 1),
FlSpot(3, 2.8),
FlSpot(7, 1.2),
FlSpot(10, 2.8),
FlSpot(12, 2.6),
FlSpot(13, 3.9),
],
colors: [
const Color(0xffaa4cfc),
],
barWidth: 6,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
belowBarData: BarAreaData(show: false, colors: [
const Color(0x00aa4cfc),
]),
);
final LineChartBarData lineChartBarData3 = LineChartBarData(
spots: [
FlSpot(1, 2.8),
FlSpot(3, 1.9),
FlSpot(6, 3),
FlSpot(10, 1.3),
FlSpot(13, 2.5),
],
colors: const [
Color(0xff27b6fc),
],
barWidth: 6,
isStrokeCapRound: true,
dotData: FlDotData(show: false),
);
return [
lineChartBarData1,
lineChartBarData2,
lineChartBarData3,
];
}
\ No newline at end of file
......@@ -9,10 +9,10 @@ import 'package:logair_application/ui/base_widget.dart';
import 'package:logair_application/ui/map_widget.dart';
import 'package:logair_application/ui/data_widget.dart';
import 'package:logair_application/ui/social_widget.dart';
import 'package:logair_application/ui/base/battery_visualizer.dart';
class HomeView extends StatelessWidget {
HomeView({Key key}) : super(key: key);
HomeView({Key key}) : super(key: key) {
}
@override
Widget build(BuildContext context) {
......
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:logair_application/logic/data_packet.dart';
import 'package:logair_application/logic/handlers/database_handler.dart';
import 'package:logair_application/ui/animation/forward_animation.dart';
import 'package:logair_application/ui/base/header.dart';
import 'package:logair_application/utils/enums/bluetooth_connection_status.dart';
......@@ -31,6 +33,21 @@ class StatsView extends StatelessWidget {
height: double.infinity,
child: Column(
children: [
RaisedButton(
onPressed: () => {
// TODO from {"transaction_id":73510,"timestamp_nix":1594212101606,"device_id":"logair1234","latitude":46.1665322,"longitude":5.9047703,"altitude":562,"speed":0.0170595515519381,"heading":208,"temperature":24.7,"relative_humidity":40.6,"pressure":95948.8,"pm_1":null,"pm_2_5":12,"pm_4":null,"pm_10":14,"extra_data":[]
//DatabaseHandler().insertData(DataPacket.fromData(_timestamp, _latitude, _longitude, _altitude, _heading, _speed, _temperature, _pressure, _relativeHumidity, _pm1, _pm2_5, _pm4, _pm10))
},
child: Text('Add to DB'),
),
RaisedButton(
onPressed: () => {},
child: Text('Print DB'),
),
RaisedButton(
onPressed: () => {},
child: Text('Delete last in DB'),
),
RaisedButton(
onPressed: () => BTWakeHandler().switchState(),
child: Text('Toggle BTLE Service'),
......
......@@ -386,7 +386,7 @@ packages:
source: hosted
version: "1.0.10"
path:
dependency: transitive
dependency: "direct main"
description:
name: path
url: "https://pub.dartlang.org"
......@@ -573,7 +573,7 @@ packages:
source: hosted
version: "1.7.0"
sqflite:
dependency: transitive
dependency: "direct main"
description:
name: sqflite
url: "https://pub.dartlang.org"
......
......@@ -22,7 +22,7 @@ dependencies:
flutter_blue: 0.7.2
permission_handler: ^4.2.0+hotfix.3
get_it: ^3.1.0
shared_preferences: '>=0.5.7+2'
shared_preferences: ^0.5.7+2
kotlin_flavor: ^0.1.0
uuid: ^2.0.4
latlong: any
......@@ -30,6 +30,8 @@ dependencies:
http: ^0.12.1
rxdart: ^0.24.0
fl_chart: ^0.9.4
sqflite:
path:
intl: ^0.16.1
intl_translation: ^0.17.9
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment