refactors, ui implementation, new settings
This commit is contained in:
parent
234582339d
commit
a762734c5a
|
@ -9,7 +9,7 @@
|
||||||
<!-- Needed to communicate with already-paired Bluetooth devices. (Android 12 upwards)-->
|
<!-- Needed to communicate with already-paired Bluetooth devices. (Android 12 upwards)-->
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||||
<application
|
<application
|
||||||
android:label="flutter_provisioning_for_iot"
|
android:label="cloud provisioning"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 15 KiB |
|
@ -1,49 +0,0 @@
|
||||||
import 'package:flutter_blue/flutter_blue.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'sidebar.dart';
|
|
||||||
|
|
||||||
class BluetoothTest extends StatefulWidget {
|
|
||||||
const BluetoothTest({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<BluetoothTest> createState() => _BluetoothTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _BluetoothTest extends State<BluetoothTest> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: const Text("Bluetooth Test"),
|
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
|
|
||||||
FlutterBlue flutterBlue = FlutterBlue.instance;
|
|
||||||
flutterBlue.startScan(timeout: const Duration(seconds: 4));
|
|
||||||
|
|
||||||
flutterBlue.scanResults.listen((results) async {
|
|
||||||
// do something with scan results
|
|
||||||
for (ScanResult r in results) {
|
|
||||||
String scan = '"scan: ${r.device.name} found! rssi: ${r
|
|
||||||
.rssi}"';
|
|
||||||
debugPrint(scan);
|
|
||||||
if(r.device.name == "Crusher ANC") {
|
|
||||||
await r.device.connect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Stop scanning
|
|
||||||
flutterBlue.stopScan();
|
|
||||||
|
|
||||||
}, child: const Text("Scan Devices"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
drawer: const Sidebar(),// This trailing comma makes auto-formatting nicer for build methods.
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_provisioning_for_iot/main_page.dart';
|
import 'package:flutter_provisioning_for_iot/screens/main_page.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MainPage());
|
runApp(const MainPage());
|
||||||
|
|
|
@ -18,11 +18,9 @@ class CloudServiceAPI{
|
||||||
late String address;
|
late String address;
|
||||||
late Map<String, String> headers;
|
late Map<String, String> headers;
|
||||||
|
|
||||||
CloudServiceAPI() {
|
CloudServiceAPI();
|
||||||
loadJson = loadConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future loadConfig() async{
|
Future<void> loadConfig() async{
|
||||||
credentials = await readJson();
|
credentials = await readJson();
|
||||||
String username = credentials['username'];
|
String username = credentials['username'];
|
||||||
String password = credentials['password'];
|
String password = credentials['password'];
|
|
@ -0,0 +1,28 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// https://medium.com/@nickysong/creating-a-custom-color-swatch-in-flutter-554bcdcb27f3
|
||||||
|
///
|
||||||
|
/// usage: CustomColor.createMaterialColor(const Color(0xff263f8c))
|
||||||
|
|
||||||
|
class CustomColor {
|
||||||
|
static MaterialColor createMaterialColor(Color color) {
|
||||||
|
List strengths = <double>[.05];
|
||||||
|
Map<int, Color> swatch = {};
|
||||||
|
final int r = color.red, g = color.green, b = color.blue;
|
||||||
|
|
||||||
|
for (int i = 1; i < 10; i++) {
|
||||||
|
strengths.add(0.1 * i);
|
||||||
|
}
|
||||||
|
for (var strength in strengths) {
|
||||||
|
final double ds = 0.5 - strength;
|
||||||
|
swatch[(strength * 1000).round()] = Color.fromRGBO(
|
||||||
|
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
|
||||||
|
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
|
||||||
|
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
|
||||||
|
1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return MaterialColor(color.value, swatch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
import 'package:flutter_bluetooth_serial/flutter_bluetooth_serial.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class BluetoothDeviceSettings extends StatefulWidget {
|
||||||
|
final BluetoothDevice device;
|
||||||
|
|
||||||
|
const BluetoothDeviceSettings({super.key, required this.device});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<BluetoothDeviceSettings> createState() => _BluetoothDeviceSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BluetoothDeviceSettings extends State<BluetoothDeviceSettings> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
debugPrint(widget.device.address);
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text("Bluetooth Devices"),
|
||||||
|
),
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Table(
|
||||||
|
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
|
||||||
|
children: <TableRow>[
|
||||||
|
TableRow(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom:
|
||||||
|
BorderSide(width: 1.5, color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
const TableCell(child: Text("Address")),
|
||||||
|
TableCell(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
height: 50,
|
||||||
|
child: Text(
|
||||||
|
widget.device.address
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
TableRow(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom:
|
||||||
|
BorderSide(width: 1.5, color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
TableCell(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
height: 50,
|
||||||
|
child: const Text(
|
||||||
|
"Name"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
TableCell(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
height: 50,
|
||||||
|
child: Text(
|
||||||
|
widget.device.name.toString()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
TableRow(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom:
|
||||||
|
BorderSide(width: 1.5, color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
TableCell(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
height: 50,
|
||||||
|
child: const Text(
|
||||||
|
"Connected"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
TableCell(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
height: 50,
|
||||||
|
child: Text(
|
||||||
|
widget.device.isConnected.toString()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
])));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter_bluetooth_serial/flutter_bluetooth_serial.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_provisioning_for_iot/widgets/bluetooth_discovery.dart';
|
||||||
|
import 'package:flutter_provisioning_for_iot/objects/cloud_service_api.dart';
|
||||||
|
import 'package:flutter_provisioning_for_iot/widgets/switch_widget.dart';
|
||||||
|
|
||||||
|
class BluetoothScreen extends StatefulWidget {
|
||||||
|
const BluetoothScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<BluetoothScreen> createState() => _BluetoothScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BluetoothScreen extends State<BluetoothScreen> {
|
||||||
|
|
||||||
|
final textFieldValueHolder = TextEditingController();
|
||||||
|
late CloudServiceAPI cloudServiceAPI = CloudServiceAPI();
|
||||||
|
late List<BluetoothDiscoveryResult> results =
|
||||||
|
List<BluetoothDiscoveryResult>.empty(growable: true);
|
||||||
|
late ButtonStyle buttonStyle = ElevatedButton.styleFrom(
|
||||||
|
foregroundColor: Colors.black,
|
||||||
|
backgroundColor: const Color(0xFFFDE100), // Text Color (Foreground color)
|
||||||
|
);
|
||||||
|
late String inputName = "";
|
||||||
|
late bool initScan = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text("Bluetooth Devices"),
|
||||||
|
),
|
||||||
|
body: RefreshIndicator(
|
||||||
|
onRefresh: () {
|
||||||
|
debugPrint("refreshed");
|
||||||
|
return Future(() => null);
|
||||||
|
},
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
//child: Padding(
|
||||||
|
//padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(width: 1.5, color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TextField(
|
||||||
|
controller: textFieldValueHolder,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
hintText: 'Enter the name of your new device',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
var textFieldValue =
|
||||||
|
textFieldValueHolder.value.toString();
|
||||||
|
checkNameAvailability(textFieldValue);
|
||||||
|
setState(() {
|
||||||
|
inputName = textFieldValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
style: buttonStyle,
|
||||||
|
child: const Text("check name"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(width: 1.5, color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(children: const [
|
||||||
|
Text(
|
||||||
|
"Toggle Scan",
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Expanded(child: Text("")),
|
||||||
|
SwitchWidget(),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
BluetoothDiscovery(start: initScan, deviceID: inputName),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
//),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> checkNameAvailability(String input) async {
|
||||||
|
await cloudServiceAPI.loadConfig();
|
||||||
|
List<dynamic> devices = await cloudServiceAPI.getDevices();
|
||||||
|
for (Map<String, dynamic> selected in devices) {
|
||||||
|
if (selected["id"] == input) {
|
||||||
|
await showNameAvailabilityStatus(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await showNameAvailabilityStatus(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> showNameAvailabilityStatus(bool status) async {
|
||||||
|
String statusText = status
|
||||||
|
? "die eingegebene ID ist verfügbar"
|
||||||
|
: "die eingegebene ID ist nicht verfügbar";
|
||||||
|
Fluttertoast.showToast(
|
||||||
|
msg: statusText,
|
||||||
|
toastLength: Toast.LENGTH_SHORT,
|
||||||
|
gravity: ToastGravity.BOTTOM,
|
||||||
|
timeInSecForIosWeb: 2,
|
||||||
|
backgroundColor: Colors.grey[200],
|
||||||
|
textColor: Colors.black,
|
||||||
|
fontSize: 16.0);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
import 'package:http/http.dart';
|
import 'package:flutter_provisioning_for_iot/objects/cloud_service_api.dart';
|
||||||
import 'cloud_service_api.dart';
|
import 'package:flutter_provisioning_for_iot/widgets/sidebar.dart';
|
||||||
import 'sidebar.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class CloudService extends StatefulWidget {
|
class CloudService extends StatefulWidget {
|
||||||
|
@ -22,10 +22,10 @@ Future<Map<String, dynamic>> readJson() async {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CloudService extends State<CloudService>{
|
class _CloudService extends State<CloudService>{
|
||||||
|
|
||||||
late final Map<String, dynamic> credentials;
|
late final Map<String, dynamic> credentials;
|
||||||
final CloudServiceAPI cloudServiceAPI = CloudServiceAPI();
|
final CloudServiceAPI cloudServiceAPI = CloudServiceAPI();
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_provisioning_for_iot/sidebar.dart';
|
import 'package:flutter_provisioning_for_iot/widgets/sidebar.dart';
|
||||||
|
|
||||||
|
import '../objects/create_material_color.dart';
|
||||||
|
|
||||||
class MainPage extends StatelessWidget {
|
class MainPage extends StatelessWidget {
|
||||||
const MainPage({super.key});
|
const MainPage({super.key});
|
||||||
|
@ -19,7 +21,7 @@ class MainPage extends StatelessWidget {
|
||||||
// or simply save your changes to "hot reload" in a Flutter IDE).
|
// or simply save your changes to "hot reload" in a Flutter IDE).
|
||||||
// Notice that the counter didn't reset back to zero; the application
|
// Notice that the counter didn't reset back to zero; the application
|
||||||
// is not restarted.
|
// is not restarted.
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: CustomColor.createMaterialColor(const Color(0xff263f8c)),
|
||||||
),
|
),
|
||||||
home: const MyHomePage(title: 'Provisioning for IOT'),
|
home: const MyHomePage(title: 'Provisioning for IOT'),
|
||||||
);
|
);
|
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import 'sidebar.dart';
|
import '../widgets/sidebar.dart';
|
||||||
|
|
||||||
class Settings extends StatefulWidget {
|
class Settings extends StatefulWidget {
|
||||||
const Settings({Key? key}) : super(key: key);
|
const Settings({Key? key}) : super(key: key);
|
|
@ -0,0 +1,158 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bluetooth_serial/flutter_bluetooth_serial.dart';
|
||||||
|
import 'package:flutter_provisioning_for_iot/screens/bluetooth_device_settings.dart';
|
||||||
|
|
||||||
|
class BluetoothDiscovery extends StatefulWidget {
|
||||||
|
final bool start;
|
||||||
|
final String deviceID;
|
||||||
|
|
||||||
|
const BluetoothDiscovery({
|
||||||
|
super.key,
|
||||||
|
required this.start,
|
||||||
|
required this.deviceID
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<BluetoothDiscovery> createState() => _BluetoothDiscovery();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BluetoothDiscovery extends State<BluetoothDiscovery> {
|
||||||
|
|
||||||
|
StreamSubscription<BluetoothDiscoveryResult>? _streamSubscription;
|
||||||
|
List<BluetoothDiscoveryResult> results = List<BluetoothDiscoveryResult>.empty(growable: true);
|
||||||
|
bool isDiscovering = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
debugPrint("test: ${widget.deviceID}");
|
||||||
|
debugPrint("bool: ${widget.start}");
|
||||||
|
if(widget.start) {
|
||||||
|
_startDiscovery();
|
||||||
|
}
|
||||||
|
return RefreshIndicator(
|
||||||
|
onRefresh: () {
|
||||||
|
debugPrint("refreshed");
|
||||||
|
return Future(() => null);
|
||||||
|
},
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: results.length,
|
||||||
|
itemExtent: 50.0,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
var device = results.elementAt(index).device;
|
||||||
|
var deviceAddress = device.address;
|
||||||
|
var deviceName = device.name;
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
const Icon(Icons.bluetooth_disabled_rounded),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
debugPrint(deviceAddress);
|
||||||
|
},
|
||||||
|
onLongPress: () {
|
||||||
|
debugPrint("no need to press for this long...");
|
||||||
|
},
|
||||||
|
child: Text("$deviceAddress"
|
||||||
|
"${(deviceName != "" ? "" : " | $deviceName")}")),
|
||||||
|
const Expanded(child: Text("")),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.settings),
|
||||||
|
onPressed: () {
|
||||||
|
debugPrint("this is a warning!");
|
||||||
|
debugPrint(device.address);
|
||||||
|
Navigator.push(context, MaterialPageRoute(builder: (context) => BluetoothDeviceSettings(device: device)));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
isDiscovering = widget.start;
|
||||||
|
if (isDiscovering) {
|
||||||
|
_startDiscovery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _restartDiscovery() {
|
||||||
|
setState(() {
|
||||||
|
results.clear();
|
||||||
|
isDiscovering = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
_startDiscovery();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _startDiscovery() {
|
||||||
|
_streamSubscription =
|
||||||
|
FlutterBluetoothSerial.instance.startDiscovery().listen((r) {
|
||||||
|
setState(() {
|
||||||
|
final existingIndex = results.indexWhere(
|
||||||
|
(element) => element.device.address == r.device.address);
|
||||||
|
if (existingIndex >= 0) {
|
||||||
|
results[existingIndex] = r;
|
||||||
|
} else {
|
||||||
|
results.add(r);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
debugPrint("results: $results");
|
||||||
|
|
||||||
|
_streamSubscription!.onDone(() {
|
||||||
|
setState(() {
|
||||||
|
isDiscovering = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// Avoid memory leak (`setState` after dispose) and cancel discovery
|
||||||
|
_streamSubscription?.cancel();
|
||||||
|
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void initScan() {
|
||||||
|
_streamSubscription =
|
||||||
|
FlutterBluetoothSerial.instance.startDiscovery().listen((r) {
|
||||||
|
debugPrint("r: ${r.device.name} ${r.device.address}");
|
||||||
|
setState(() {
|
||||||
|
final existingIndex = results.indexWhere(
|
||||||
|
(element) => element.device.address == r.device.address);
|
||||||
|
if (existingIndex >= 0) {
|
||||||
|
results[existingIndex] = r;
|
||||||
|
} else {
|
||||||
|
results.add(r);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (r.device.address == "38:F3:2E:41:82:74") {
|
||||||
|
BluetoothConnection.toAddress(r.device.address).then((connection) {
|
||||||
|
debugPrint('Connected to the device');
|
||||||
|
//connection = _connection;
|
||||||
|
//setState(() {
|
||||||
|
//isConnecting = false;
|
||||||
|
//isDisconnecting = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
_streamSubscription!.onDone(() {
|
||||||
|
setState(() {
|
||||||
|
isDiscovering = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,20 +1,27 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_provisioning_for_iot/bluetooth_test.dart';
|
import 'package:flutter_provisioning_for_iot/screens/bluetooth_screen.dart';
|
||||||
import 'package:flutter_provisioning_for_iot/cloud_service_ui.dart';
|
import 'package:flutter_provisioning_for_iot/screens/cloud_service_ui.dart';
|
||||||
import 'main_page.dart';
|
import '../screens/main_page.dart';
|
||||||
import 'settings.dart';
|
import '../screens/settings.dart';
|
||||||
|
|
||||||
class Sidebar extends StatelessWidget {
|
class Sidebar extends StatelessWidget {
|
||||||
const Sidebar({Key? key}) : super(key: key);
|
const Sidebar({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const DrawerHeader(
|
const DrawerHeader(
|
||||||
decoration: BoxDecoration(color: Color(0xFF00844D)),
|
decoration: BoxDecoration(
|
||||||
child: Text("Navigation"),
|
color: Colors.white
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage('assets/logo/m&m_logo.png')
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text("Main Page"),
|
title: const Text("Main Page"),
|
||||||
|
@ -32,7 +39,7 @@ class Sidebar extends StatelessWidget {
|
||||||
ListTile(
|
ListTile(
|
||||||
title: const Text("Bluetooth Test"),
|
title: const Text("Bluetooth Test"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(context, MaterialPageRoute(builder: (context) => const BluetoothTest()));
|
Navigator.push(context, MaterialPageRoute(builder: (context) => const BluetoothScreen()));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
|
@ -0,0 +1,44 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SwitchWidget extends StatefulWidget {
|
||||||
|
|
||||||
|
const SwitchWidget({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SwitchWidget> createState() => _SwitchWidget();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SwitchWidget extends State<SwitchWidget> {
|
||||||
|
|
||||||
|
bool switchControl = false;
|
||||||
|
var textHolder = 'Switch is OFF';
|
||||||
|
|
||||||
|
void toggleSwitch(bool value) {
|
||||||
|
if (switchControl == false) {
|
||||||
|
setState(() {
|
||||||
|
switchControl = true;
|
||||||
|
textHolder = 'Switch is ON';
|
||||||
|
});
|
||||||
|
debugPrint('Switch is ON');
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
switchControl = false;
|
||||||
|
textHolder = 'Switch is OFF';
|
||||||
|
});
|
||||||
|
debugPrint('Switch is OFF');
|
||||||
|
// Put your code here which you want to execute on Switch OFF event.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Switch(
|
||||||
|
onChanged: toggleSwitch,
|
||||||
|
value: switchControl,
|
||||||
|
activeColor: Colors.white,
|
||||||
|
activeTrackColor: Colors.green,
|
||||||
|
inactiveThumbColor: Colors.white,
|
||||||
|
inactiveTrackColor: Colors.grey,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
322
pubspec.lock
322
pubspec.lock
|
@ -5,61 +5,117 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.9.0"
|
version: "2.10.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.2.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.dartlang.org"
|
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.17.0"
|
||||||
|
convert:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: convert
|
||||||
|
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.1"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
url: "https://pub.dartlang.org"
|
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.4"
|
||||||
|
fixnum:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fixnum
|
||||||
|
sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_blue:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_blue
|
||||||
|
sha256: f7f76b9b80455b0375693ec96c276fadb01e94d8441fa1740a64980cd1aeda5c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.8.0"
|
||||||
|
flutter_bluetooth_serial:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_bluetooth_serial
|
||||||
|
sha256: "85ae82c4099b2b1facdc54e75e1bcfa88dc7f719e55dc886bb0b648cb16636b1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.4.0"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
url: "https://pub.dartlang.org"
|
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -67,41 +123,211 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
fluttertoast:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: fluttertoast
|
||||||
|
sha256: "7a738eddad04c7b27a1ecfecd12e8ecd4b188cdd2d91c252a02a4aba65838c9d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "8.1.1"
|
||||||
|
http:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.13.5"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.2"
|
||||||
|
js:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: js
|
||||||
|
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.6.5"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.1"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.12"
|
version: "0.12.13"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
url: "https://pub.dartlang.org"
|
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.5"
|
version: "0.2.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.2"
|
version: "1.8.2"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.7"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
process:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: process
|
||||||
|
sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.4"
|
||||||
|
protobuf:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: protobuf
|
||||||
|
sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
rxdart:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: rxdart
|
||||||
|
sha256: "2ef8b4e91cb3b55d155e0e34eeae0ac7107974e451495c955ac04ddee8cc21fd"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.26.0"
|
||||||
|
shared_preferences:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: shared_preferences
|
||||||
|
sha256: "76917b7d4b9526b2ba416808a7eb9fb2863c1a09cf63ec85f1453da240fa818a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.15"
|
||||||
|
shared_preferences_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_android
|
||||||
|
sha256: "8e251f3c986002b65fed6396bce81f379fb63c27317d49743cf289fd0fd1ab97"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.14"
|
||||||
|
shared_preferences_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_ios
|
||||||
|
sha256: "585a14cefec7da8c9c2fb8cd283a3bb726b4155c0952afe6a0caaa7b2272de34"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
|
shared_preferences_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_linux
|
||||||
|
sha256: "28aefc1261746e7bad3d09799496054beb84e8c4ffcdfed7734e17b4ada459a5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
|
shared_preferences_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_macos
|
||||||
|
sha256: fbb94bf296576f49be37a1496d5951796211a8db0aa22cc0d68c46440dad808c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
|
shared_preferences_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_platform_interface
|
||||||
|
sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.0"
|
||||||
|
shared_preferences_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_web
|
||||||
|
sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
|
shared_preferences_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_windows
|
||||||
|
sha256: "97f7ab9a7da96d9cf19581f5de520ceb529548498bd6b5e0ccd02d68a0d15eba"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.1"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -111,50 +337,82 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.1"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.11.0"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "862015c5db1f3f3c4ea3b94dc2490363a84262994b88902315ed74be1155612f"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
url: "https://pub.dartlang.org"
|
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.2.1"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
sha256: c9aba3b3dbfe8878845dfab5fa096eb8de7b62231baeeb1cea8e3ee81ca8c6d8
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.12"
|
version: "0.4.15"
|
||||||
|
typed_data:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: typed_data
|
||||||
|
sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.1"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||||
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.4"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
sha256: d13ac5deea7327f027b3b97ee19ee210f68256ecf3f1a304bcfb992ee947637c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.1"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
sha256: "11541eedefbcaec9de35aa82650b695297ce668662bbd6e3911a7fabdbde589f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0+2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.18.2 <3.0.0"
|
dart: ">=2.18.2 <4.0.0"
|
||||||
|
flutter: ">=3.0.0"
|
||||||
|
|
|
@ -37,8 +37,10 @@ dependencies:
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
flutter_blue: ^0.8.0
|
flutter_blue: ^0.8.0
|
||||||
|
flutter_bluetooth_serial: ^0.4.0
|
||||||
shared_preferences: ^2.0.13
|
shared_preferences: ^2.0.13
|
||||||
http: ^0.13.5
|
http: ^0.13.5
|
||||||
|
fluttertoast: ^8.1.1
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
@ -69,6 +71,7 @@ flutter:
|
||||||
# - images/a_dot_ham.jpeg
|
# - images/a_dot_ham.jpeg
|
||||||
assets:
|
assets:
|
||||||
- config/credentials.json
|
- config/credentials.json
|
||||||
|
- assets/logo/m&m_logo.png
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// tree, read text, and verify that the values of widget properties are correct.
|
// tree, read text, and verify that the values of widget properties are correct.
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_provisioning_for_iot/main_page.dart';
|
import 'package:flutter_provisioning_for_iot/screens/main_page.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'package:flutter_provisioning_for_iot/main.dart';
|
import 'package:flutter_provisioning_for_iot/main.dart';
|
||||||
|
|
Loading…
Reference in New Issue