Commit 3da72318 authored by Nicolas Richard Walter Boeckh's avatar Nicolas Richard Walter Boeckh 💬

Minor Changes

parent 50202d15
......@@ -3,20 +3,20 @@ import 'package:flutter/material.dart';
class SlideUpRoute extends PageRouteBuilder {
final Widget page;
SlideUpRoute({this.page}) : super(
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, ) =>
page,
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: Offset.zero,
).animate(animation),
child: child,
),
);
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, ) =>
page,
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(0, -1),
end: Offset.zero,
).animate(animation),
child: child,
),
);
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ class BTLEHandler {
Future<void> connect() => this._device?.let((it) => it.connect());
Future<void> disconnect() => this._device?.let((it) {
Future<dynamic> disconnect() => this._device?.let((it) {
_device = null;
return it.disconnect();
});
......
......@@ -15,7 +15,7 @@ class HomeView extends StatefulWidget {
_HomeViewState createState() => _HomeViewState();
}
class _HomeViewState extends State<HomeView> {
class _HomeViewState extends State<HomeView> { // TODO Remove statefulness here.s
bool shouldChange = false;
bool canChange = false;
double deltaSum = 0.0;
......@@ -71,7 +71,7 @@ class _HomeViewState extends State<HomeView> {
),
Expanded(
flex: 1,
child: Center(child: Container(color: Colors.blue.shade200, child: Text("BATTERY INDIC 2"),),),
child: Center(child: Container(color: Colors.blue.shade200, child: Text("BATTERY INDIC 2"),),), // TODO STATEFUL INDIC.
),
],
),
......
......@@ -4,14 +4,12 @@ import 'package:flutter/material.dart';
class SlimListTile extends StatelessWidget {
final String title;
final String subtitle;
final Color color;
SlimListTile({@required this.title, @required this.subtitle, this.color});
SlimListTile({@required this.title, @required this.subtitle});
@override
Widget build(BuildContext context) {
return Container(
color: this.color ?? Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
......
......@@ -22,6 +22,8 @@ class Device {
String toString() => 'DEVICE $name@$address';
}
// TODO on BT button press: Either isConnected so dialog disconnect, or isNotConnected so dialog connect use app state otherwise
showBluetoothSelectionDialog(BuildContext context) async {
// TODO Catch BT disabled
......@@ -62,7 +64,6 @@ showBluetoothSelectionDialog(BuildContext context) async {
title: SlimListTile(
title: device.name,
subtitle: device.id.toString(),
color: BTLEHandler().address == device.id.toString() ? Colors.green.shade100.withAlpha(50) : Colors.white
),
onTap: () {
if (BTLEHandler().address == device.id.toString())
......
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