mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
增加剪切板控制
This commit is contained in:
@@ -4,9 +4,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:qinglong_app/base/http/api.dart';
|
||||
import 'package:qinglong_app/base/http/http.dart';
|
||||
import 'package:qinglong_app/base/ql_app_bar.dart';
|
||||
import 'package:qinglong_app/base/userinfo_viewmodel.dart';
|
||||
import 'package:qinglong_app/module/others/dependencies/dependency_viewmodel.dart';
|
||||
import 'package:qinglong_app/utils/extension.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
|
||||
class AddDependencyPage extends ConsumerStatefulWidget {
|
||||
const AddDependencyPage({
|
||||
Key? key,
|
||||
@@ -132,6 +135,7 @@ class _AddDependencyPageState extends ConsumerState<AddDependencyPage> {
|
||||
height: 10,
|
||||
),
|
||||
TextField(
|
||||
enableInteractiveSelection: !getIt<UserInfoViewModel>().forbidReadClipBoarded,
|
||||
controller: _nameController,
|
||||
decoration: const InputDecoration(
|
||||
contentPadding: EdgeInsets.fromLTRB(0, 5, 0, 5),
|
||||
|
||||
@@ -278,6 +278,53 @@ class _OtherPageState extends ConsumerState<OtherPage> {
|
||||
const Divider(
|
||||
indent: 15,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 15,
|
||||
right: 15,
|
||||
top: 5,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"禁止读取剪切板",
|
||||
style: TextStyle(
|
||||
color: ref.watch(themeProvider).themeColor.titleColor(),
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"开启后输入框无法使用系统自带的复制粘贴功能,输入法的复制粘贴功能不受影响",
|
||||
style: TextStyle(
|
||||
color: ref.watch(themeProvider).themeColor.descColor(),
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
CupertinoSwitch(
|
||||
value: getIt<UserInfoViewModel>().forbidReadClipBoarded,
|
||||
onChanged: (forbid) {
|
||||
getIt<UserInfoViewModel>().forbidReadClipBoard(forbid);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
indent: 15,
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
|
||||
@@ -4,9 +4,12 @@ import 'package:qinglong_app/base/http/api.dart';
|
||||
import 'package:qinglong_app/base/http/http.dart';
|
||||
import 'package:qinglong_app/base/ql_app_bar.dart';
|
||||
import 'package:qinglong_app/base/theme.dart';
|
||||
import 'package:qinglong_app/base/userinfo_viewmodel.dart';
|
||||
import 'package:qinglong_app/module/config/config_viewmodel.dart';
|
||||
import 'package:qinglong_app/utils/extension.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
|
||||
class ScriptEditPage extends ConsumerStatefulWidget {
|
||||
final String content;
|
||||
final String title;
|
||||
@@ -77,6 +80,7 @@ class _ScriptEditPageState extends ConsumerState<ScriptEditPage> {
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: TextField(
|
||||
enableInteractiveSelection: !getIt<UserInfoViewModel>().forbidReadClipBoarded,
|
||||
focusNode: node,
|
||||
style: TextStyle(
|
||||
color: ref.read(themeProvider).themeColor.descColor(),
|
||||
|
||||
@@ -92,6 +92,7 @@ class _UpdatePasswordPageState extends ConsumerState<UpdatePasswordPage> {
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
enableInteractiveSelection: !getIt<UserInfoViewModel>().forbidReadClipBoarded,
|
||||
focusNode: focusNode,
|
||||
controller: _nameController,
|
||||
decoration: const InputDecoration(
|
||||
@@ -122,6 +123,7 @@ class _UpdatePasswordPageState extends ConsumerState<UpdatePasswordPage> {
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
enableInteractiveSelection: !getIt<UserInfoViewModel>().forbidReadClipBoarded,
|
||||
obscureText: true,
|
||||
controller: _passwordController,
|
||||
maxLines: 1,
|
||||
@@ -153,6 +155,7 @@ class _UpdatePasswordPageState extends ConsumerState<UpdatePasswordPage> {
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
enableInteractiveSelection: false,
|
||||
obscureText: true,
|
||||
maxLines: 1,
|
||||
controller: _passwordAgainController,
|
||||
|
||||
Reference in New Issue
Block a user