...
 
Commits (2)
{"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-24 15:47:03.988120","version":"1.20.0-3.0.pre.126"}
\ 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-27 12:45:17.444374","version":"1.19.0-2.0.pre.49"}
......@@ -116,6 +116,8 @@ class DatabaseHandler {
return List.generate(data.length, (i) => Tuple2(data[i]['id'], DataPacket.fromMappedData(data[i])));
}
// TODO Document
// TODO Fix not being set correctly
Future<void> setExported(List<int> ids) async {
final Database database = await _database;
int count = await database.update(
......
......@@ -62,7 +62,7 @@ class NetworkHandler {
body: json.encode(postData)
)
/// On error, the error should be ignored and not break the thread.
.catchError((e) => print('COULDN\'T CONNECT'));
.catchError((e) => print("COULDN'T CONNECT"));
/// If the response is defined as an instance of [http.Response], check it's status code and remove all of the packets from the log.
if (response != null && response.statusCode == 200) {
......@@ -99,4 +99,6 @@ class NetworkHandler {
await Future.delayed(Duration(seconds: 2));
}
}
//TODO Generate a stream from a place for Place display
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import 'package:geolocator/geolocator.dart';
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/data_tile.dart';
import 'package:logair_application/ui/components/graph/graph.dart';
......@@ -13,53 +12,6 @@ import 'package:logair_application/ui/components/graph/graph.dart';
class DataWidget extends StatelessWidget {
DataWidget();
// TODO Remove
Text _buildText(String text, {FontWeight weight = FontWeight.normal, double size: 12}) {
return Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: size,
fontWeight: weight,
decorationStyle: TextDecorationStyle.solid
),
);
}
// TODO Remove
TableRow _buildRow(List<Widget> children) {
return TableRow(
children: children.map((x) => Container(decoration: BoxDecoration(border: Border.all(color: Colors.black)), padding: EdgeInsets.symmetric(vertical: 4), child: x)).toList()
);
}
// TODO Remove
/// Displays packets ungracefully.
Widget _buildPacketDisplay(DataPacket packet) {
FontWeight b = FontWeight.bold;
return Column(
children: [
Table(
children: [
_buildRow([_buildText('Temperature', weight: b), _buildText('Pressure', weight: b), _buildText('Relative Humidity', weight: b)]),
(packet != null) ?
_buildRow([_buildText('${packet.temperature()}'), _buildText('${packet.pressure()}'), _buildText('${packet.relativeHumidity()}')]) :
_buildRow([_buildText('N/A'), _buildText('N/A'), _buildText('N/A')]),
]
),
Divider(color: Colors.white, height: 4,),
Table(
children: [
_buildRow([_buildText('PM1', weight: b), _buildText('PM2_5', weight: b), _buildText('PM_4', weight: b), _buildText('PM_10', weight: b)]),
(packet != null) ?
_buildRow([_buildText('${packet.pm1()}'), _buildText('${packet.pm2_5()}'), _buildText('${packet.pm4()}'), _buildText('${packet.pm10()}')]) :
_buildRow([_buildText('N/A'), _buildText('N/A'), _buildText('N/A'), _buildText('N/A')]),
],
),
]
);
}
@override
Widget build(BuildContext context) {
Widget widget = Center(
......@@ -69,8 +21,31 @@ class DataWidget extends StatelessWidget {
// Local data (Chart + Data points)
Graph(),
DataTile(DataHandler().getDataStream()),
// Local Data
// Bar (Locations + Add new -> Pop to new route)
Container(
color: Colors.grey,
child: Row(
children: [
Expanded(
child: Text(
'Other Locations',
textAlign: TextAlign.center,
),
),
IconButton(
onPressed: () => {},
icon: Icon(Icons.add),
)
],
),
),
SingleChildScrollView(
child: Column(
children: [
],
),
),
// Locations
Container(
padding: EdgeInsets.symmetric(horizontal: 3),
......
......@@ -2,20 +2,20 @@ import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
class PMSymbol {
/// String that represents one of this from another.
final String _key;
final double _first;
final double _second;
final double _third;
final double _fourth;
final double _fifth;
final double _sixth;
final double _seventh;
/// Values that mark the color stops relatively to the AQI values.
final double _first, _second, _third, _fourth, _fifth, _sixth, _seventh;
/// Internal constructor of this.
const PMSymbol._internal(this._key, this._first, this._second, this._third, this._fourth, this._fifth, this._sixth, this._seventh);
/// Returns a [String] representation of this.
toString() => 'Enum.$_key ~> [$_first, $_second, $_third, $_fourth, $_fifth, $_sixth, $_seventh]';
operator [](int i) {
/// Returns the [i]-th stop out of the 7 possible,
double operator [](int i) {
switch (i) {
case 0: return this._first;
case 1: return this._second;
......@@ -24,17 +24,26 @@ class PMSymbol {
case 4: return this._fifth;
case 5: return this._sixth;
case 6: return this._seventh;
default: return null;
}
}
/// Returns [_key]
String get key => _key;
/// Returns a list of all different [PMSymbol] objects.
static List<PMSymbol> get list => [PM1, PM2_5, PM4, PM10];
/// [List] of stops for the lerping to occur.
/// @see [_colorizeValue]
/// [List] of stops (PM1) for the lerping to occur.
static const PM1 = const PMSymbol._internal('PM 1', 0, 0, 0, 0, 0, 0, 0);
/// [List] of stops (PM2.5) for the lerping to occur.
static const PM2_5 = const PMSymbol._internal('PM 2.5', 0, 12, 35.4, 55.4, 150.4, 250.4, 500.4);
/// [List] of stops (PM4) for the lerping to occur.
static const PM4 = const PMSymbol._internal('PM 4', 0, 0, 0, 0, 0, 0, 0);
/// [List] of stops (PM10) for the lerping to occur.
static const PM10 = const PMSymbol._internal('PM 10', 0, 54, 154, 254, 354, 424, 604);
/// [List] of [Color]s to be smudged as a gradient and cherry picked based on a value (lerped).
......