cm add multi clients scroll controller arrow actions

This commit is contained in:
csf
2022-10-20 23:22:02 +09:00
parent 94c8b117ef
commit 6e6a359809
2 changed files with 19 additions and 3 deletions

View File

@@ -125,6 +125,7 @@ class ConnectionManagerState extends State<ConnectionManager> {
showClose: true,
controller: serverModel.tabController,
maxLabelWidth: 100,
tail: buildScrollJumper(),
pageViewBuilder: (pageView) => Row(children: [
Expanded(child: pageView),
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) {