opt mobile unread and autoSizeTextField

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-07-10 21:03:35 +08:00
parent 193426a3c1
commit 745f33a8c1
44 changed files with 160 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:async';
import 'package:auto_size_text_field/auto_size_text_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common/formatter/id_formatter.dart';
import 'package:get/get.dart';
@@ -131,7 +132,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
Expanded(
child: Container(
padding: const EdgeInsets.only(left: 16, right: 16),
child: TextField(
child: AutoSizeTextField(
minFontSize: 18,
autocorrect: false,
enableSuggestions: false,
keyboardType: TextInputType.visiblePassword,

View File

@@ -1,13 +1,14 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/mobile/pages/server_page.dart';
import 'package:flutter_hbb/mobile/pages/settings_page.dart';
import 'package:get/get.dart';
import '../../common.dart';
import '../../common/widgets/chat_page.dart';
import 'connection_page.dart';
abstract class PageShape extends Widget {
final String title = "";
final Icon icon = Icon(null);
final Widget icon = Icon(null);
final List<Widget> appBarActions = [];
}
@@ -63,7 +64,7 @@ class _HomePageState extends State<HomePage> {
// backgroundColor: MyTheme.grayBg,
appBar: AppBar(
centerTitle: true,
title: Text("RustDesk"),
title: appTitle(),
actions: _pages.elementAt(_selectedIndex).appBarActions,
),
bottomNavigationBar: BottomNavigationBar(
@@ -81,15 +82,62 @@ class _HomePageState extends State<HomePage> {
if (index == 1 && _selectedIndex != index) {
gFFI.chatModel.hideChatIconOverlay();
gFFI.chatModel.hideChatWindowOverlay();
gFFI.chatModel
.mobileClearClientUnread(gFFI.chatModel.currentKey.connId);
}
_selectedIndex = index;
gFFI.chatModel
.mobileClearClientUnread(gFFI.chatModel.currentKey.connId);
}),
),
body: _pages.elementAt(_selectedIndex),
));
}
Widget appTitle() {
final currentUser = gFFI.chatModel.currentUser;
final currentKey = gFFI.chatModel.currentKey;
if (_selectedIndex == 1 &&
currentUser != null &&
currentKey.peerId.isNotEmpty) {
final connected =
gFFI.serverModel.clients.any((e) => e.id == currentKey.connId);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Tooltip(
message: currentKey.isOut
? translate('outgoing connection')
: translate('incomming connection'),
child: Icon(
currentKey.isOut
? Icons.call_made_rounded
: Icons.call_received_rounded,
),
),
Expanded(
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"${currentUser.firstName} ${currentUser.id}",
),
if (connected)
Container(
width: 10,
height: 10,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color.fromARGB(255, 133, 246, 199)),
).marginSymmetric(horizontal: 2),
],
),
),
),
],
);
}
return Text("RustDesk");
}
}
class WebHomePage extends StatelessWidget {

View File

@@ -428,7 +428,8 @@ class ConnectionManager extends StatelessWidget {
bar.onTap!(1);
}
},
icon: const Icon(Icons.chat)))
icon: unreadTopRightBuilder(
client.unreadChatMessageCount)))
],
),
client.authorized