cm add multi clients scroll controller arrow actions
This commit is contained in:
parent
94c8b117ef
commit
6e6a359809
@ -125,6 +125,7 @@ class ConnectionManagerState extends State<ConnectionManager> {
|
|||||||
showClose: true,
|
showClose: true,
|
||||||
controller: serverModel.tabController,
|
controller: serverModel.tabController,
|
||||||
maxLabelWidth: 100,
|
maxLabelWidth: 100,
|
||||||
|
tail: buildScrollJumper(),
|
||||||
pageViewBuilder: (pageView) => Row(children: [
|
pageViewBuilder: (pageView) => Row(children: [
|
||||||
Expanded(child: pageView),
|
Expanded(child: pageView),
|
||||||
Consumer<ChatModel>(
|
Consumer<ChatModel>(
|
||||||
@ -159,6 +160,21 @@ class ConnectionManagerState extends State<ConnectionManager> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildScrollJumper() {
|
||||||
|
final offstage = gFFI.serverModel.clients.length < 2;
|
||||||
|
final sc = gFFI.serverModel.tabController.state.value.scrollController;
|
||||||
|
return Offstage(
|
||||||
|
offstage: offstage,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
ActionIcon(
|
||||||
|
icon: Icons.arrow_left, iconSize: 22, onTap: sc.backward),
|
||||||
|
ActionIcon(
|
||||||
|
icon: Icons.arrow_right, iconSize: 22, onTap: sc.forward),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildConnectionCard(Client client) {
|
Widget buildConnectionCard(Client client) {
|
||||||
|
@ -844,7 +844,7 @@ class _CloseButton extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ActionIcon extends StatelessWidget {
|
class ActionIcon extends StatelessWidget {
|
||||||
final String message;
|
final String? message;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
final Function() onTap;
|
final Function() onTap;
|
||||||
final bool isClose;
|
final bool isClose;
|
||||||
@ -852,7 +852,7 @@ class ActionIcon extends StatelessWidget {
|
|||||||
final double boxSize;
|
final double boxSize;
|
||||||
const ActionIcon(
|
const ActionIcon(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
required this.message,
|
this.message,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
this.isClose = false,
|
this.isClose = false,
|
||||||
@ -864,7 +864,7 @@ class ActionIcon extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
RxBool hover = false.obs;
|
RxBool hover = false.obs;
|
||||||
return Obx(() => Tooltip(
|
return Obx(() => Tooltip(
|
||||||
message: translate(message),
|
message: message != null ? translate(message!) : "",
|
||||||
waitDuration: const Duration(seconds: 1),
|
waitDuration: const Duration(seconds: 1),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
hoverColor: isClose
|
hoverColor: isClose
|
||||||
|
Loading…
x
Reference in New Issue
Block a user