Skip to content

Commit d7eef5b

Browse files
committed
FindGatewayGoListPage
git tag v1.0.5+75
1 parent 68b00ea commit d7eef5b

File tree

7 files changed

+67
-22
lines changed

7 files changed

+67
-22
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.0.5+75]
2+
3+
* FindGatewayGoListPage
4+
15
## [1.0.5+74]
26

37
* Add gateway by mdns TXT

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
33
import 'package:flutter/material.dart';
44
import 'package:flutter_localizations/flutter_localizations.dart';
55
import 'package:oktoast/oktoast.dart';
6-
import 'package:openiothub_common_pages/commPages/findmDNSClientList.dart';
6+
import 'package:openiothub_common_pages/commPages/findGatewayGoList.dart';
77
import 'package:openiothub_common_pages/l10n/generated/openiothub_common_localizations.dart';
88
import 'package:openiothub_common_pages/wifiConfig/airkiss.dart';
99

@@ -52,7 +52,7 @@ class MyApp extends StatelessWidget {
5252
useMaterial3: true,
5353
),
5454
// home: const MyHomePage(title: 'Flutter Demo Home Page'),
55-
home: FindmDNSClientListPage(),
55+
home: FindGatewayGoListPage(),
5656
));
5757
}
5858
}

lib/commPages/deviceDetails.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:flutter/cupertino.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:openiothub_constants/constants/Constants.dart';
4+
import 'package:openiothub_grpc_api/proto/mobile/mobile.pb.dart';
5+
6+
class DeviceDetails extends StatefulWidget {
7+
final PortConfig portConfig;
8+
const DeviceDetails({required this.portConfig});
9+
10+
@override
11+
State<DeviceDetails> createState() => _DeviceDetailsState();
12+
}
13+
14+
class _DeviceDetailsState extends State<DeviceDetails> {
15+
@override
16+
Widget build(BuildContext context) {
17+
return Placeholder();
18+
}
19+
}
Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
2020

2121
const utf8encoder = Utf8Encoder();
2222

23-
class FindmDNSClientListPage extends StatefulWidget {
24-
const FindmDNSClientListPage({Key? key}) : super(key: key);
23+
class FindGatewayGoListPage extends StatefulWidget {
24+
const FindGatewayGoListPage({Key? key}) : super(key: key);
2525

2626
@override
27-
State createState() => _FindmDNSClientListPageState();
27+
State createState() => _FindGatewayGoListPageState();
2828
}
2929

30-
class _FindmDNSClientListPageState extends State<FindmDNSClientListPage> {
30+
class _FindGatewayGoListPageState extends State<FindGatewayGoListPage> {
3131
BonsoirDiscovery? action;
3232
final Map<String, PortService> _ServiceMap = {};
3333
// final flutterNsd = FlutterNsd();
3434
bool initialStart = true;
3535
bool _scanning = false;
3636

37-
_FindmDNSClientListPageState();
37+
_FindGatewayGoListPageState();
3838

3939
@override
4040
void initState() {
@@ -121,22 +121,25 @@ class _FindmDNSClientListPageState extends State<FindmDNSClientListPage> {
121121
Widget build(BuildContext context) {
122122
final tiles = _ServiceMap.values.map(
123123
(pair) {
124-
var listItemContent = Padding(
125-
padding: const EdgeInsets.fromLTRB(10.0, 15.0, 10.0, 15.0),
126-
child: Row(
124+
var listItemContent = ListTile(
125+
leading: Icon(Icons.devices,
126+
color: Colors.green),
127+
title: Row(
128+
mainAxisAlignment: MainAxisAlignment.start,
127129
children: <Widget>[
128-
Padding(
129-
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 0.0),
130-
child: Icon(Icons.devices, color: Colors.green,),
131-
),
132-
Expanded(
133-
child: Text(
134-
'${pair.ip}:${pair.port}',
135-
style: Constants.titleTextStyle,
136-
)),
137-
Constants.rightArrowIcon
130+
Text(
131+
'${pair.ip}:${pair.port}',
132+
style: Constants.titleTextStyle),
138133
],
139134
),
135+
subtitle: TDTag(
136+
"${pair.info["version"]!=null?pair.info["version"]:pair.info["firmware-version"]}",
137+
theme: TDTagTheme.success,
138+
// isOutline: true,
139+
isLight: true,
140+
fixedWidth: 100,
141+
),
142+
trailing: Constants.rightArrowIcon,
140143
);
141144
return InkWell(
142145
onTap: () {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:flutter/cupertino.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:openiothub_constants/constants/Constants.dart';
4+
import 'package:openiothub_grpc_api/proto/mobile/mobile.pb.dart';
5+
6+
class PortConfigDetails extends StatefulWidget {
7+
final PortConfig portConfig;
8+
const PortConfigDetails({required this.portConfig});
9+
10+
@override
11+
State<PortConfigDetails> createState() => _PortConfigDetailsState();
12+
}
13+
14+
class _PortConfigDetailsState extends State<PortConfigDetails> {
15+
@override
16+
Widget build(BuildContext context) {
17+
return Placeholder();
18+
}
19+
}

lib/openiothub_common_pages.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library openiothub_common_pages;
22

33
export 'commPages/appInfo.dart';
44
export 'commPages/feedback.dart';
5-
export 'commPages/findmDNSClientList.dart';
5+
export 'commPages/findGatewayGoList.dart';
66
export 'commPages/gatewayGuide.dart';
77
export 'commPages/privacyPolicy.dart';
88
export 'commPages/servers.dart';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: openiothub_common_pages
22
description: openiothub_common_pages
3-
version: 1.0.5+74
3+
version: 1.0.5+75
44
homepage: https://github.com/OpenIoTHub
55

66
environment:

0 commit comments

Comments
 (0)