mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-16 00:51:26 +03:00
demo: use mobile_ffi to get id for desktop version
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/common.dart';
|
||||
import 'package:flutter_hbb/models/model.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DesktopHomePage extends StatefulWidget {
|
||||
DesktopHomePage({Key? key}) : super(key: key);
|
||||
@@ -10,6 +13,75 @@ class DesktopHomePage extends StatefulWidget {
|
||||
class _DesktopHomePageState extends State<DesktopHomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text("Hello Desktop");
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: buildServerInfo(context),
|
||||
flex: 1,
|
||||
),
|
||||
Flexible(
|
||||
child: buildServerBoard(context),
|
||||
flex: 4,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
buildServerInfo(BuildContext context) {
|
||||
return ChangeNotifierProvider.value(
|
||||
value: FFI.serverModel,
|
||||
child: Column(
|
||||
children: [buildIDBoard(context)],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
buildServerBoard(BuildContext context) {
|
||||
return Center(
|
||||
child: Text("waiting implementation"),
|
||||
);
|
||||
}
|
||||
|
||||
buildIDBoard(BuildContext context) {
|
||||
final model = FFI.serverModel;
|
||||
return Card(
|
||||
elevation: 0.5,
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Container(
|
||||
width: 4,
|
||||
height: 70,
|
||||
decoration: BoxDecoration(color: MyTheme.accent),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
translate("ID"),
|
||||
style:
|
||||
TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||
),
|
||||
TextFormField(
|
||||
controller: model.serverId,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user