Merge pull request #9 from oob-provisioning-for-iot/justin

fixed error and added some functions for devices list
This commit is contained in:
Konjiki No Yami 2023-01-04 14:45:04 +01:00 committed by GitHub
commit a705ec52a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 5 deletions

View File

@ -18,10 +18,10 @@ Future<Map<String, dynamic>> readJson() async {
class CloudServiceAPI { class CloudServiceAPI {
static late final Map<String, dynamic> credentials; static late final Map<String, dynamic> credentials;
static late String _basicAuth; static String _basicAuth = "";
static late String _address; static String _address = "";
static late String _username; static String _username = "";
static late String _password; static String _password = "";
static late Map<String, String> _headers; static late Map<String, String> _headers;
static bool _initState = false; static bool _initState = false;

View File

@ -33,6 +33,7 @@ class _RegisteredDevicesScreen extends State<RegisteredDevicesScreen> {
final CloudServiceAPI _cloudServiceAPI = CloudServiceAPI(); final CloudServiceAPI _cloudServiceAPI = CloudServiceAPI();
// static SharedPreferences? preferencesInstance; // static SharedPreferences? preferencesInstance;
String _searchText = "";
bool _isFetching = false; bool _isFetching = false;
Future<void> _fetchRegisteredDevices() async { Future<void> _fetchRegisteredDevices() async {
@ -89,6 +90,35 @@ class _RegisteredDevicesScreen extends State<RegisteredDevicesScreen> {
physics: const ScrollPhysics(), physics: const ScrollPhysics(),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SingleSection(
title: "Allgemeines",
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: TextFormField(
obscureText: false,
decoration: InputDecoration(
border: const OutlineInputBorder(),
hintText: 'Enter the server password',
labelText: "Search",
suffixIcon: IconButton(
icon: const Icon(Icons.search),
onPressed: () {
setState(() {
// TODO Suchfunktion
});
},
),
filled: true,
),
keyboardType: TextInputType.text,
onChanged: (String newValue) {
_searchText = newValue;
},
),
),
]
),
SingleSection( SingleSection(
title: "Registered Bluetooth Devices", title: "Registered Bluetooth Devices",
children: [ children: [
@ -100,7 +130,7 @@ class _RegisteredDevicesScreen extends State<RegisteredDevicesScreen> {
DeviceInfoModel entry = _registeredInfoDevices![index]; DeviceInfoModel entry = _registeredInfoDevices![index];
//DeviceInfoModel entryInfo = await _cloudServiceAPI.getDeviceInfo(entry.id); //DeviceInfoModel entryInfo = await _cloudServiceAPI.getDeviceInfo(entry.id);
return CustomListTile( return CustomListTile(
title: entry.id, title: "${entry.id} \nentrypoint: ${entry.endpoint} \nstatus: ${entry.status} \nconnection: ${entry.connectionState} \nlast activity: ${entry.lastActivityTime}",
icon: Icons.devices, icon: Icons.devices,
); );
}, },