refact: remove flutter_improved_scrolling (#10120)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
743b0ce8ce
commit
082a66b282
@ -2730,30 +2730,6 @@ Future<bool> osxRequestAudio() async {
|
|||||||
return await kMacOSPermChannel.invokeMethod("requestRecordAudio");
|
return await kMacOSPermChannel.invokeMethod("requestRecordAudio");
|
||||||
}
|
}
|
||||||
|
|
||||||
class DraggableNeverScrollableScrollPhysics extends ScrollPhysics {
|
|
||||||
/// Creates scroll physics that does not let the user scroll.
|
|
||||||
const DraggableNeverScrollableScrollPhysics({super.parent});
|
|
||||||
|
|
||||||
@override
|
|
||||||
DraggableNeverScrollableScrollPhysics applyTo(ScrollPhysics? ancestor) {
|
|
||||||
return DraggableNeverScrollableScrollPhysics(parent: buildParent(ancestor));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldAcceptUserOffset(ScrollMetrics position) {
|
|
||||||
// TODO: find a better solution to check if the offset change is caused by the scrollbar.
|
|
||||||
// Workaround: when dragging with the scrollbar, it always triggers an [IdleScrollActivity].
|
|
||||||
if (position is ScrollPositionWithSingleContext) {
|
|
||||||
// ignore: invalid_use_of_protected_member, invalid_use_of_visible_for_testing_member
|
|
||||||
return position.activity is IdleScrollActivity;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool get allowImplicitScrolling => false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget futureBuilder(
|
Widget futureBuilder(
|
||||||
{required Future? future, required Widget Function(dynamic data) hasData}) {
|
{required Future? future, required Widget Function(dynamic data) hasData}) {
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
|
@ -5,7 +5,6 @@ import 'package:dynamic_layouts/dynamic_layouts.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hbb/consts.dart';
|
import 'package:flutter_hbb/consts.dart';
|
||||||
import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
|
|
||||||
import 'package:flutter_hbb/models/ab_model.dart';
|
import 'package:flutter_hbb/models/ab_model.dart';
|
||||||
import 'package:flutter_hbb/models/peer_tab_model.dart';
|
import 'package:flutter_hbb/models/peer_tab_model.dart';
|
||||||
import 'package:flutter_hbb/models/state_model.dart';
|
import 'package:flutter_hbb/models/state_model.dart';
|
||||||
@ -271,33 +270,24 @@ class _PeersViewState extends State<_PeersView>
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: peerCardUiType.value == PeerUiType.list
|
: peerCardUiType.value == PeerUiType.list
|
||||||
? DesktopScrollWrapper(
|
? ListView.builder(
|
||||||
scrollController: _scrollController,
|
controller: _scrollController,
|
||||||
child: ListView.builder(
|
itemCount: peers.length,
|
||||||
controller: _scrollController,
|
itemBuilder: (BuildContext context, int index) {
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
return buildOnePeer(peers[index], false).marginOnly(
|
||||||
itemCount: peers.length,
|
right: space,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
top: index == 0 ? 0 : space / 2,
|
||||||
return buildOnePeer(peers[index], false)
|
bottom: space / 2);
|
||||||
.marginOnly(
|
},
|
||||||
right: space,
|
|
||||||
top: index == 0 ? 0 : space / 2,
|
|
||||||
bottom: space / 2);
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
: DesktopScrollWrapper(
|
: DynamicGridView.builder(
|
||||||
scrollController: _scrollController,
|
gridDelegate: SliverGridDelegateWithWrapping(
|
||||||
child: DynamicGridView.builder(
|
mainAxisSpacing: space / 2,
|
||||||
controller: _scrollController,
|
crossAxisSpacing: space),
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
itemCount: peers.length,
|
||||||
gridDelegate: SliverGridDelegateWithWrapping(
|
itemBuilder: (BuildContext context, int index) {
|
||||||
mainAxisSpacing: space / 2,
|
return buildOnePeer(peers[index], false);
|
||||||
crossAxisSpacing: space),
|
}));
|
||||||
itemCount: peers.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return buildOnePeer(peers[index], false);
|
|
||||||
}),
|
|
||||||
));
|
|
||||||
|
|
||||||
if (updateEvent == UpdateEvent.load) {
|
if (updateEvent == UpdateEvent.load) {
|
||||||
_curPeers.clear();
|
_curPeers.clear();
|
||||||
|
@ -244,10 +244,6 @@ const double kDesktopIconButtonSplashRadius = 20;
|
|||||||
/// [kMinCursorSize] indicates min cursor (w, h)
|
/// [kMinCursorSize] indicates min cursor (w, h)
|
||||||
const int kMinCursorSize = 12;
|
const int kMinCursorSize = 12;
|
||||||
|
|
||||||
/// [kDefaultScrollAmountMultiplier] indicates how many rows can be scrolled after a minimum scroll action of mouse
|
|
||||||
const kDefaultScrollAmountMultiplier = 5.0;
|
|
||||||
const kDefaultScrollDuration = Duration(milliseconds: 50);
|
|
||||||
const kDefaultMouseWheelThrottleDuration = Duration(milliseconds: 50);
|
|
||||||
const kFullScreenEdgeSize = 0.0;
|
const kFullScreenEdgeSize = 0.0;
|
||||||
const kMaximizeEdgeSize = 0.0;
|
const kMaximizeEdgeSize = 0.0;
|
||||||
// Do not use kWindowResizeEdgeSize directly. Use `windowResizeEdgeSize` in `common.dart` instead.
|
// Do not use kWindowResizeEdgeSize directly. Use `windowResizeEdgeSize` in `common.dart` instead.
|
||||||
|
@ -12,7 +12,6 @@ import 'package:flutter_hbb/consts.dart';
|
|||||||
import 'package:flutter_hbb/desktop/pages/connection_page.dart';
|
import 'package:flutter_hbb/desktop/pages/connection_page.dart';
|
||||||
import 'package:flutter_hbb/desktop/pages/desktop_setting_page.dart';
|
import 'package:flutter_hbb/desktop/pages/desktop_setting_page.dart';
|
||||||
import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart';
|
import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart';
|
||||||
import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
|
|
||||||
import 'package:flutter_hbb/models/platform_model.dart';
|
import 'package:flutter_hbb/models/platform_model.dart';
|
||||||
import 'package:flutter_hbb/models/server_model.dart';
|
import 'package:flutter_hbb/models/server_model.dart';
|
||||||
import 'package:flutter_hbb/plugin/ui_manager.dart';
|
import 'package:flutter_hbb/plugin/ui_manager.dart';
|
||||||
@ -125,47 +124,43 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: isIncomingOnly ? 280.0 : 200.0,
|
width: isIncomingOnly ? 280.0 : 200.0,
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
child: DesktopScrollWrapper(
|
child: Stack(
|
||||||
scrollController: _leftPaneScrollController,
|
children: [
|
||||||
child: Stack(
|
SingleChildScrollView(
|
||||||
children: [
|
controller: _leftPaneScrollController,
|
||||||
SingleChildScrollView(
|
child: Column(
|
||||||
controller: _leftPaneScrollController,
|
key: _childKey,
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
children: children,
|
||||||
child: Column(
|
|
||||||
key: _childKey,
|
|
||||||
children: children,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (isOutgoingOnly)
|
),
|
||||||
Positioned(
|
if (isOutgoingOnly)
|
||||||
bottom: 6,
|
Positioned(
|
||||||
left: 12,
|
bottom: 6,
|
||||||
child: Align(
|
left: 12,
|
||||||
alignment: Alignment.centerLeft,
|
child: Align(
|
||||||
child: InkWell(
|
alignment: Alignment.centerLeft,
|
||||||
child: Obx(
|
child: InkWell(
|
||||||
() => Icon(
|
child: Obx(
|
||||||
Icons.settings,
|
() => Icon(
|
||||||
color: _editHover.value
|
Icons.settings,
|
||||||
? textColor
|
color: _editHover.value
|
||||||
: Colors.grey.withOpacity(0.5),
|
? textColor
|
||||||
size: 22,
|
: Colors.grey.withOpacity(0.5),
|
||||||
),
|
size: 22,
|
||||||
),
|
),
|
||||||
onTap: () => {
|
|
||||||
if (DesktopSettingPage.tabKeys.isNotEmpty)
|
|
||||||
{
|
|
||||||
DesktopSettingPage.switch2page(
|
|
||||||
DesktopSettingPage.tabKeys[0])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onHover: (value) => _editHover.value = value,
|
|
||||||
),
|
),
|
||||||
|
onTap: () => {
|
||||||
|
if (DesktopSettingPage.tabKeys.isNotEmpty)
|
||||||
|
{
|
||||||
|
DesktopSettingPage.switch2page(
|
||||||
|
DesktopSettingPage.tabKeys[0])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onHover: (value) => _editHover.value = value,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -19,7 +19,6 @@ import 'package:get/get.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
|
|
||||||
|
|
||||||
import '../../common/widgets/dialog.dart';
|
import '../../common/widgets/dialog.dart';
|
||||||
import '../../common/widgets/login.dart';
|
import '../../common/widgets/login.dart';
|
||||||
@ -226,13 +225,11 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Theme.of(context).scaffoldBackgroundColor,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
child: DesktopScrollWrapper(
|
child: PageView(
|
||||||
scrollController: controller,
|
controller: controller,
|
||||||
child: PageView(
|
physics: NeverScrollableScrollPhysics(),
|
||||||
controller: controller,
|
children: _children(),
|
||||||
physics: NeverScrollableScrollPhysics(),
|
),
|
||||||
children: _children(),
|
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -281,13 +278,10 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
|
|||||||
|
|
||||||
Widget _listView({required List<_TabInfo> tabs}) {
|
Widget _listView({required List<_TabInfo> tabs}) {
|
||||||
final scrollController = ScrollController();
|
final scrollController = ScrollController();
|
||||||
return DesktopScrollWrapper(
|
return ListView(
|
||||||
scrollController: scrollController,
|
controller: scrollController,
|
||||||
child: ListView(
|
children: tabs.map((tab) => _listItem(tab: tab)).toList(),
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
);
|
||||||
controller: scrollController,
|
|
||||||
children: tabs.map((tab) => _listItem(tab: tab)).toList(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _listItem({required _TabInfo tab}) {
|
Widget _listItem({required _TabInfo tab}) {
|
||||||
@ -349,22 +343,19 @@ class _GeneralState extends State<_General> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scrollController = ScrollController();
|
final scrollController = ScrollController();
|
||||||
return DesktopScrollWrapper(
|
return ListView(
|
||||||
scrollController: scrollController,
|
controller: scrollController,
|
||||||
child: ListView(
|
children: [
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
if (!isWeb) service(),
|
||||||
controller: scrollController,
|
theme(),
|
||||||
children: [
|
_Card(title: 'Language', children: [language()]),
|
||||||
if (!isWeb) service(),
|
if (!isWeb) hwcodec(),
|
||||||
theme(),
|
if (!isWeb) audio(context),
|
||||||
_Card(title: 'Language', children: [language()]),
|
if (!isWeb) record(context),
|
||||||
if (!isWeb) hwcodec(),
|
if (!isWeb) WaylandCard(),
|
||||||
if (!isWeb) audio(context),
|
other()
|
||||||
if (!isWeb) record(context),
|
],
|
||||||
if (!isWeb) WaylandCard(),
|
).marginOnly(bottom: _kListViewBottomMargin);
|
||||||
other()
|
|
||||||
],
|
|
||||||
).marginOnly(bottom: _kListViewBottomMargin));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget theme() {
|
Widget theme() {
|
||||||
@ -705,29 +696,26 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return DesktopScrollWrapper(
|
return SingleChildScrollView(
|
||||||
scrollController: scrollController,
|
controller: scrollController,
|
||||||
child: SingleChildScrollView(
|
child: Column(
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
children: [
|
||||||
controller: scrollController,
|
_lock(locked, 'Unlock Security Settings', () {
|
||||||
child: Column(
|
locked = false;
|
||||||
children: [
|
setState(() => {});
|
||||||
_lock(locked, 'Unlock Security Settings', () {
|
}),
|
||||||
locked = false;
|
AbsorbPointer(
|
||||||
setState(() => {});
|
absorbing: locked,
|
||||||
}),
|
child: Column(children: [
|
||||||
AbsorbPointer(
|
permissions(context),
|
||||||
absorbing: locked,
|
password(context),
|
||||||
child: Column(children: [
|
_Card(title: '2FA', children: [tfa()]),
|
||||||
permissions(context),
|
_Card(title: 'ID', children: [changeId()]),
|
||||||
password(context),
|
more(context),
|
||||||
_Card(title: '2FA', children: [tfa()]),
|
]),
|
||||||
_Card(title: 'ID', children: [changeId()]),
|
),
|
||||||
more(context),
|
],
|
||||||
]),
|
)).marginOnly(bottom: _kListViewBottomMargin);
|
||||||
),
|
|
||||||
],
|
|
||||||
)).marginOnly(bottom: _kListViewBottomMargin));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget tfa() {
|
Widget tfa() {
|
||||||
@ -1384,28 +1372,23 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
|
|||||||
// TODO: support web proxy
|
// TODO: support web proxy
|
||||||
final hideProxy =
|
final hideProxy =
|
||||||
isWeb || bind.mainGetBuildinOption(key: kOptionHideProxySetting) == 'Y';
|
isWeb || bind.mainGetBuildinOption(key: kOptionHideProxySetting) == 'Y';
|
||||||
return DesktopScrollWrapper(
|
return ListView(controller: scrollController, children: [
|
||||||
scrollController: scrollController,
|
_lock(locked, 'Unlock Network Settings', () {
|
||||||
child: ListView(
|
locked = false;
|
||||||
controller: scrollController,
|
setState(() => {});
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
}),
|
||||||
children: [
|
AbsorbPointer(
|
||||||
_lock(locked, 'Unlock Network Settings', () {
|
absorbing: locked,
|
||||||
locked = false;
|
child: Column(children: [
|
||||||
setState(() => {});
|
if (!hideServer) server(enabled),
|
||||||
}),
|
if (!hideProxy)
|
||||||
AbsorbPointer(
|
_Card(title: 'Proxy', children: [
|
||||||
absorbing: locked,
|
_Button('Socks5/Http(s) Proxy', changeSocks5Proxy,
|
||||||
child: Column(children: [
|
enabled: enabled),
|
||||||
if (!hideServer) server(enabled),
|
]),
|
||||||
if (!hideProxy)
|
]),
|
||||||
_Card(title: 'Proxy', children: [
|
),
|
||||||
_Button('Socks5/Http(s) Proxy', changeSocks5Proxy,
|
]).marginOnly(bottom: _kListViewBottomMargin);
|
||||||
enabled: enabled),
|
|
||||||
]),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
]).marginOnly(bottom: _kListViewBottomMargin));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server(bool enabled) {
|
server(bool enabled) {
|
||||||
@ -1494,19 +1477,14 @@ class _DisplayState extends State<_Display> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scrollController = ScrollController();
|
final scrollController = ScrollController();
|
||||||
return DesktopScrollWrapper(
|
return ListView(controller: scrollController, children: [
|
||||||
scrollController: scrollController,
|
viewStyle(context),
|
||||||
child: ListView(
|
scrollStyle(context),
|
||||||
controller: scrollController,
|
imageQuality(context),
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
codec(context),
|
||||||
children: [
|
if (!isWeb) privacyModeImpl(context),
|
||||||
viewStyle(context),
|
other(context),
|
||||||
scrollStyle(context),
|
]).marginOnly(bottom: _kListViewBottomMargin);
|
||||||
imageQuality(context),
|
|
||||||
codec(context),
|
|
||||||
if (!isWeb) privacyModeImpl(context),
|
|
||||||
other(context),
|
|
||||||
]).marginOnly(bottom: _kListViewBottomMargin));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget viewStyle(BuildContext context) {
|
Widget viewStyle(BuildContext context) {
|
||||||
@ -1729,15 +1707,12 @@ class _AccountState extends State<_Account> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scrollController = ScrollController();
|
final scrollController = ScrollController();
|
||||||
return DesktopScrollWrapper(
|
return ListView(
|
||||||
scrollController: scrollController,
|
controller: scrollController,
|
||||||
child: ListView(
|
children: [
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
_Card(title: 'Account', children: [accountAction(), useInfo()]),
|
||||||
controller: scrollController,
|
],
|
||||||
children: [
|
).marginOnly(bottom: _kListViewBottomMargin);
|
||||||
_Card(title: 'Account', children: [accountAction(), useInfo()]),
|
|
||||||
],
|
|
||||||
).marginOnly(bottom: _kListViewBottomMargin));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget accountAction() {
|
Widget accountAction() {
|
||||||
@ -1834,18 +1809,14 @@ class _PluginState extends State<_Plugin> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
bind.pluginListReload();
|
bind.pluginListReload();
|
||||||
final scrollController = ScrollController();
|
final scrollController = ScrollController();
|
||||||
return DesktopScrollWrapper(
|
return ChangeNotifierProvider.value(
|
||||||
scrollController: scrollController,
|
value: pluginManager,
|
||||||
child: ChangeNotifierProvider.value(
|
child: Consumer<PluginManager>(builder: (context, model, child) {
|
||||||
value: pluginManager,
|
return ListView(
|
||||||
child: Consumer<PluginManager>(builder: (context, model, child) {
|
controller: scrollController,
|
||||||
return ListView(
|
children: model.plugins.map((entry) => pluginCard(entry)).toList(),
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
).marginOnly(bottom: _kListViewBottomMargin);
|
||||||
controller: scrollController,
|
}),
|
||||||
children: model.plugins.map((entry) => pluginCard(entry)).toList(),
|
|
||||||
).marginOnly(bottom: _kListViewBottomMargin);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1897,75 +1868,72 @@ class _AboutState extends State<_About> {
|
|||||||
final fingerprint = data['fingerprint'].toString();
|
final fingerprint = data['fingerprint'].toString();
|
||||||
const linkStyle = TextStyle(decoration: TextDecoration.underline);
|
const linkStyle = TextStyle(decoration: TextDecoration.underline);
|
||||||
final scrollController = ScrollController();
|
final scrollController = ScrollController();
|
||||||
return DesktopScrollWrapper(
|
return SingleChildScrollView(
|
||||||
scrollController: scrollController,
|
controller: scrollController,
|
||||||
child: SingleChildScrollView(
|
child: _Card(title: translate('About RustDesk'), children: [
|
||||||
controller: scrollController,
|
Column(
|
||||||
physics: DraggableNeverScrollableScrollPhysics(),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: _Card(title: translate('About RustDesk'), children: [
|
children: [
|
||||||
Column(
|
const SizedBox(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
height: 8.0,
|
||||||
children: [
|
),
|
||||||
const SizedBox(
|
SelectionArea(
|
||||||
height: 8.0,
|
child: Text('${translate('Version')}: $version')
|
||||||
),
|
.marginSymmetric(vertical: 4.0)),
|
||||||
SelectionArea(
|
SelectionArea(
|
||||||
child: Text('${translate('Version')}: $version')
|
child: Text('${translate('Build Date')}: $buildDate')
|
||||||
.marginSymmetric(vertical: 4.0)),
|
.marginSymmetric(vertical: 4.0)),
|
||||||
SelectionArea(
|
if (!isWeb)
|
||||||
child: Text('${translate('Build Date')}: $buildDate')
|
SelectionArea(
|
||||||
.marginSymmetric(vertical: 4.0)),
|
child: Text('${translate('Fingerprint')}: $fingerprint')
|
||||||
if (!isWeb)
|
.marginSymmetric(vertical: 4.0)),
|
||||||
SelectionArea(
|
InkWell(
|
||||||
child: Text('${translate('Fingerprint')}: $fingerprint')
|
onTap: () {
|
||||||
.marginSymmetric(vertical: 4.0)),
|
launchUrlString('https://rustdesk.com/privacy.html');
|
||||||
InkWell(
|
},
|
||||||
onTap: () {
|
child: Text(
|
||||||
launchUrlString('https://rustdesk.com/privacy.html');
|
translate('Privacy Statement'),
|
||||||
},
|
style: linkStyle,
|
||||||
child: Text(
|
).marginSymmetric(vertical: 4.0)),
|
||||||
translate('Privacy Statement'),
|
InkWell(
|
||||||
style: linkStyle,
|
onTap: () {
|
||||||
).marginSymmetric(vertical: 4.0)),
|
launchUrlString('https://rustdesk.com');
|
||||||
InkWell(
|
},
|
||||||
onTap: () {
|
child: Text(
|
||||||
launchUrlString('https://rustdesk.com');
|
translate('Website'),
|
||||||
},
|
style: linkStyle,
|
||||||
child: Text(
|
).marginSymmetric(vertical: 4.0)),
|
||||||
translate('Website'),
|
Container(
|
||||||
style: linkStyle,
|
decoration: const BoxDecoration(color: Color(0xFF2c8cff)),
|
||||||
).marginSymmetric(vertical: 4.0)),
|
padding:
|
||||||
Container(
|
const EdgeInsets.symmetric(vertical: 24, horizontal: 8),
|
||||||
decoration: const BoxDecoration(color: Color(0xFF2c8cff)),
|
child: SelectionArea(
|
||||||
padding:
|
child: Row(
|
||||||
const EdgeInsets.symmetric(vertical: 24, horizontal: 8),
|
children: [
|
||||||
child: SelectionArea(
|
Expanded(
|
||||||
child: Row(
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Expanded(
|
children: [
|
||||||
child: Column(
|
Text(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
'Copyright © ${DateTime.now().toString().substring(0, 4)} Purslane Ltd.\n$license',
|
||||||
children: [
|
style: const TextStyle(color: Colors.white),
|
||||||
Text(
|
|
||||||
'Copyright © ${DateTime.now().toString().substring(0, 4)} Purslane Ltd.\n$license',
|
|
||||||
style: const TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
translate('Slogan_tip'),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
color: Colors.white),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
],
|
translate('Slogan_tip'),
|
||||||
)),
|
style: TextStyle(
|
||||||
).marginSymmetric(vertical: 4.0)
|
fontWeight: FontWeight.w800,
|
||||||
],
|
color: Colors.white),
|
||||||
).marginOnly(left: _kContentHMargin)
|
)
|
||||||
]),
|
],
|
||||||
));
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
).marginSymmetric(vertical: 4.0)
|
||||||
|
],
|
||||||
|
).marginOnly(left: _kContentHMargin)
|
||||||
|
]),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||||
import 'package:flutter_improved_scrolling/flutter_improved_scrolling.dart';
|
|
||||||
import 'package:flutter_hbb/models/state_model.dart';
|
import 'package:flutter_hbb/models/state_model.dart';
|
||||||
|
|
||||||
import '../../consts.dart';
|
import '../../consts.dart';
|
||||||
@ -742,12 +741,6 @@ class _ImagePaintState extends State<ImagePaint> {
|
|||||||
ScrollController horizontal,
|
ScrollController horizontal,
|
||||||
ScrollController vertical,
|
ScrollController vertical,
|
||||||
) {
|
) {
|
||||||
final scrollConfig = CustomMouseWheelScrollConfig(
|
|
||||||
scrollDuration: kDefaultScrollDuration,
|
|
||||||
scrollCurve: Curves.linearToEaseOut,
|
|
||||||
mouseWheelTurnsThrottleTimeMs:
|
|
||||||
kDefaultMouseWheelThrottleDuration.inMilliseconds,
|
|
||||||
scrollAmountMultiplier: kDefaultScrollAmountMultiplier);
|
|
||||||
var widget = child;
|
var widget = child;
|
||||||
if (layoutSize.width < size.width) {
|
if (layoutSize.width < size.width) {
|
||||||
widget = ScrollConfiguration(
|
widget = ScrollConfiguration(
|
||||||
@ -793,36 +786,26 @@ class _ImagePaintState extends State<ImagePaint> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (layoutSize.width < size.width) {
|
if (layoutSize.width < size.width) {
|
||||||
widget = ImprovedScrolling(
|
widget = RawScrollbar(
|
||||||
scrollController: horizontal,
|
thickness: kScrollbarThickness,
|
||||||
enableCustomMouseWheelScrolling: cursorOverImage.isFalse,
|
thumbColor: Colors.grey,
|
||||||
customMouseWheelScrollConfig: scrollConfig,
|
controller: horizontal,
|
||||||
child: RawScrollbar(
|
thumbVisibility: false,
|
||||||
thickness: kScrollbarThickness,
|
trackVisibility: false,
|
||||||
thumbColor: Colors.grey,
|
notificationPredicate: layoutSize.height < size.height
|
||||||
controller: horizontal,
|
? (notification) => notification.depth == 1
|
||||||
thumbVisibility: false,
|
: defaultScrollNotificationPredicate,
|
||||||
trackVisibility: false,
|
child: widget,
|
||||||
notificationPredicate: layoutSize.height < size.height
|
|
||||||
? (notification) => notification.depth == 1
|
|
||||||
: defaultScrollNotificationPredicate,
|
|
||||||
child: widget,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (layoutSize.height < size.height) {
|
if (layoutSize.height < size.height) {
|
||||||
widget = ImprovedScrolling(
|
widget = RawScrollbar(
|
||||||
scrollController: vertical,
|
thickness: kScrollbarThickness,
|
||||||
enableCustomMouseWheelScrolling: cursorOverImage.isFalse,
|
thumbColor: Colors.grey,
|
||||||
customMouseWheelScrollConfig: scrollConfig,
|
controller: vertical,
|
||||||
child: RawScrollbar(
|
thumbVisibility: false,
|
||||||
thickness: kScrollbarThickness,
|
trackVisibility: false,
|
||||||
thumbColor: Colors.grey,
|
child: widget,
|
||||||
controller: vertical,
|
|
||||||
thumbVisibility: false,
|
|
||||||
trackVisibility: false,
|
|
||||||
child: widget,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_hbb/consts.dart';
|
|
||||||
import 'package:flutter_improved_scrolling/flutter_improved_scrolling.dart';
|
|
||||||
|
|
||||||
class DesktopScrollWrapper extends StatelessWidget {
|
|
||||||
final ScrollController scrollController;
|
|
||||||
final Widget child;
|
|
||||||
const DesktopScrollWrapper(
|
|
||||||
{Key? key, required this.scrollController, required this.child})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ImprovedScrolling(
|
|
||||||
scrollController: scrollController,
|
|
||||||
enableCustomMouseWheelScrolling: true,
|
|
||||||
// enableKeyboardScrolling: true, // strange behavior on mac
|
|
||||||
customMouseWheelScrollConfig: CustomMouseWheelScrollConfig(
|
|
||||||
scrollDuration: kDefaultScrollDuration,
|
|
||||||
scrollCurve: Curves.linearToEaseOut,
|
|
||||||
mouseWheelTurnsThrottleTimeMs:
|
|
||||||
kDefaultMouseWheelThrottleDuration.inMilliseconds,
|
|
||||||
scrollAmountMultiplier: kDefaultScrollAmountMultiplier),
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -530,15 +530,6 @@ packages:
|
|||||||
url: "https://github.com/rustdesk-org/flutter_gpu_texture_renderer"
|
url: "https://github.com/rustdesk-org/flutter_gpu_texture_renderer"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
flutter_improved_scrolling:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
path: "."
|
|
||||||
ref: HEAD
|
|
||||||
resolved-ref: "62f09545149f320616467c306c8c5f71714a18e6"
|
|
||||||
url: "https://github.com/rustdesk-org/flutter_improved_scrolling"
|
|
||||||
source: git
|
|
||||||
version: "0.0.3"
|
|
||||||
flutter_keyboard_visibility:
|
flutter_keyboard_visibility:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -71,13 +71,6 @@ dependencies:
|
|||||||
debounce_throttle: ^2.0.0
|
debounce_throttle: ^2.0.0
|
||||||
file_picker: ^5.1.0
|
file_picker: ^5.1.0
|
||||||
flutter_svg: ^2.0.5
|
flutter_svg: ^2.0.5
|
||||||
flutter_improved_scrolling:
|
|
||||||
# currently, we use flutter 3.10.0+.
|
|
||||||
#
|
|
||||||
# for flutter 3.0.5, please use official version(just comment code below).
|
|
||||||
# if build rustdesk by flutter >=3.3, please use our custom pub below (uncomment code below).
|
|
||||||
git:
|
|
||||||
url: https://github.com/rustdesk-org/flutter_improved_scrolling
|
|
||||||
uni_links:
|
uni_links:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/rustdesk-org/uni_links
|
url: https://github.com/rustdesk-org/uni_links
|
||||||
|
Loading…
x
Reference in New Issue
Block a user