docker #6
@@ -1,6 +1,7 @@
|
||||
import 'package:adaptive_scrollbar/adaptive_scrollbar.dart';
|
||||
import 'package:dde_gesture_manager/constants/constants.dart';
|
||||
import 'package:dde_gesture_manager/extensions.dart';
|
||||
import 'package:dde_gesture_manager/models/configs.provider.dart';
|
||||
import 'package:dde_gesture_manager/models/content_layout.provider.dart';
|
||||
import 'package:dde_gesture_manager/models/local_schemes_provider.dart';
|
||||
import 'package:dde_gesture_manager/models/scheme.dart';
|
||||
@@ -18,6 +19,7 @@ import 'package:dde_gesture_manager/widgets/table_cell_shortcut_listener.dart';
|
||||
import 'package:dde_gesture_manager/widgets/table_cell_text_field.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_platform_alert/flutter_platform_alert.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
const double _headingRowHeight = 56;
|
||||
@@ -292,6 +294,33 @@ class GestureEditor extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: DButton.upload(
|
||||
enabled: schemeProvider.uploaded == false,
|
||||
onTap: () async {
|
||||
if (context.read<ConfigsProvider>().accessToken.isNull) {
|
||||
return Notificator.showAlert(
|
||||
title: LocaleKeys.info_login_for_upload_title.tr(),
|
||||
description: LocaleKeys.info_login_for_upload_description.tr(),
|
||||
).then((value) {
|
||||
value.sout();
|
||||
if (value == CustomButton.positiveButton) {
|
||||
context
|
||||
.read<ContentLayoutProvider>()
|
||||
.setProps(marketOrMeOpened: true, currentIsMarket: false);
|
||||
}
|
||||
});
|
||||
}
|
||||
Notificator.showConfirm(
|
||||
title: LocaleKeys.info_upload_and_share_title.tr(),
|
||||
description: LocaleKeys.info_upload_and_share_description.tr(),
|
||||
positiveButtonTitle: LocaleKeys.str_share.tr(),
|
||||
negativeButtonTitle: LocaleKeys.str_cancel.tr(),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
|
||||
@@ -15,7 +15,7 @@ class Notificator {
|
||||
return AlertImpl().showAlert(
|
||||
windowTitle: title,
|
||||
text: description,
|
||||
positiveButtonTitle: positiveButtonTitle,
|
||||
positiveButtonTitle: positiveButtonTitle ?? LocaleKeys.str_ok.tr(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,23 @@ class DButton extends StatefulWidget {
|
||||
message: LocaleKeys.operation_logout.tr(),
|
||||
));
|
||||
|
||||
factory DButton.upload({
|
||||
Key? key,
|
||||
required enabled,
|
||||
GestureTapCallback? onTap,
|
||||
height = defaultButtonHeight,
|
||||
width = defaultButtonHeight,
|
||||
}) =>
|
||||
DButton(
|
||||
key: key,
|
||||
width: width,
|
||||
height: height,
|
||||
onTap: enabled ? onTap : null,
|
||||
child: Tooltip(
|
||||
child: Opacity(opacity: enabled ? 1 : 0.4, child: const Icon(Icons.cloud_upload, size: 20)),
|
||||
message: LocaleKeys.operation_upload.tr(),
|
||||
));
|
||||
|
||||
factory DButton.dropdown({
|
||||
Key? key,
|
||||
width = 60.0,
|
||||
|
||||
@@ -66,19 +66,23 @@
|
||||
}
|
||||
},
|
||||
"operation": {
|
||||
"add": "Add",
|
||||
"add": "add",
|
||||
"delete": "delete",
|
||||
"duplicate": "duplicate",
|
||||
"apply": "apply",
|
||||
"paste": "paste",
|
||||
"logout": "sign out"
|
||||
"logout": "sign out",
|
||||
"upload": "upload"
|
||||
},
|
||||
"str": {
|
||||
"null": "Null",
|
||||
"new_scheme": "New gesture scheme",
|
||||
"copy": "copy",
|
||||
"yes": "Yes",
|
||||
"no": "No"
|
||||
"no": "No",
|
||||
"ok": "OK",
|
||||
"share": "Share",
|
||||
"cancel": "Cancel"
|
||||
},
|
||||
"built_in_commands": {
|
||||
"ShowWorkspace": "ShowWorkspace",
|
||||
@@ -126,6 +130,14 @@
|
||||
"description_for_startup": "Click [{YES}] to view, click [{NO}] ignore this update",
|
||||
"title_already_latest": "Already the latest version ~",
|
||||
"description_for_manual": "Visit the official website to see more?"
|
||||
},
|
||||
"login_for_upload": {
|
||||
"title": "please login",
|
||||
"description": "You need to login first to perform upload operations"
|
||||
},
|
||||
"upload_and_share": {
|
||||
"title": "Share the scheme at the same time?",
|
||||
"description": "If you select [Share], other users can see this scheme and download it;\nIf you select [Cancel], you can still find this scheme in the [My Upload] list and share."
|
||||
}
|
||||
},
|
||||
"me": {
|
||||
|
||||
@@ -71,14 +71,18 @@
|
||||
"duplicate": "复制",
|
||||
"apply": "应用",
|
||||
"paste": "粘贴",
|
||||
"logout": "退出登录"
|
||||
"logout": "退出登录",
|
||||
"upload": "上传"
|
||||
},
|
||||
"str": {
|
||||
"null": "无",
|
||||
"new_scheme": "新建手势方案",
|
||||
"copy": "副本",
|
||||
"yes": "是",
|
||||
"no": "否"
|
||||
"no": "否",
|
||||
"ok": "好的",
|
||||
"share": "分享",
|
||||
"cancel": "放弃"
|
||||
},
|
||||
"built_in_commands": {
|
||||
"ShowWorkspace": "显示工作区",
|
||||
@@ -126,6 +130,14 @@
|
||||
"description_for_startup": "点击[{yes}]查看,点击[{no}]忽略本次更新",
|
||||
"title_already_latest": "已经是最新版本~",
|
||||
"description_for_manual": "是否前去官网查看?"
|
||||
},
|
||||
"login_for_upload": {
|
||||
"title": "请登录",
|
||||
"description": "您需要先登录才能进行上传操作"
|
||||
},
|
||||
"upload_and_share": {
|
||||
"title": "是否同时分享到方案市场?",
|
||||
"description": "如果选择[分享],其他用户可以看到本方案并下载使用;\n如果选择[放弃],您仍可以稍后在[我的上传]列表中找到本方案进行操作。"
|
||||
}
|
||||
},
|
||||
"me": {
|
||||
|
||||
Reference in New Issue
Block a user