wip: upgrade dependencies
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter/cupertino.dart';
|
||||
/// [UOS设计指南](https://docs.uniontech.com/zh/content/t_dbG3kBK9iDf9B963ok)
|
||||
const double localManagerPanelWidth = 260;
|
||||
|
||||
const double marketOrMePanelWidth = 300;
|
||||
const double marketOrMePanelWidth = 450;
|
||||
|
||||
const shortDuration = const Duration(milliseconds: 100);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:dde_gesture_manager/models/configs.provider.dart';
|
||||
import 'package:dde_gesture_manager/models/content_layout.provider.dart';
|
||||
import 'package:dde_gesture_manager/widgets/dde_button.dart';
|
||||
import 'package:dde_gesture_manager/widgets/login.dart';
|
||||
import 'package:dde_gesture_manager/widgets/market.dart';
|
||||
import 'package:dde_gesture_manager/widgets/me.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -18,15 +19,14 @@ class MarketOrMe extends StatelessWidget {
|
||||
var layoutProvider = context.watch<ContentLayoutProvider>();
|
||||
bool isOpen = layoutProvider.marketOrMeOpened == true;
|
||||
bool isMarket = layoutProvider.isMarket;
|
||||
bool showLogin = context.watch<ConfigsProvider>().accessToken.isNull && !isMarket;
|
||||
return AnimatedContainer(
|
||||
duration: mediumDuration,
|
||||
curve: Curves.easeInOut,
|
||||
width: isOpen ? marketOrMePanelWidth * (showLogin ? 1.5 : 1) : 0,
|
||||
width: isOpen ? marketOrMePanelWidth * 1 : 0,
|
||||
child: OverflowBox(
|
||||
alignment: Alignment.centerLeft,
|
||||
maxWidth: marketOrMePanelWidth * (showLogin ? 1.5 : 1),
|
||||
minWidth: marketOrMePanelWidth * (showLogin ? 1.5 : 1),
|
||||
maxWidth: marketOrMePanelWidth,
|
||||
minWidth: marketOrMePanelWidth,
|
||||
child: Material(
|
||||
color: context.t.backgroundColor,
|
||||
elevation: isOpen ? 10 : 0,
|
||||
@@ -85,7 +85,5 @@ class MarketOrMe extends StatelessWidget {
|
||||
return Expanded(child: MeWidget());
|
||||
}
|
||||
|
||||
Widget buildMarketContent(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
Widget buildMarketContent(BuildContext context) => Expanded(child: MarketWidget());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
import 'package:dde_gesture_manager/constants/constants.dart';
|
||||
import 'package:dde_gesture_manager/widgets/dde_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:dde_gesture_manager/extensions.dart';
|
||||
|
||||
enum MarketSortType {
|
||||
recommend,
|
||||
updated,
|
||||
likes,
|
||||
downloads,
|
||||
}
|
||||
|
||||
class MarketWidget extends StatefulWidget {
|
||||
const MarketWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MarketWidgetState createState() => _MarketWidgetState();
|
||||
}
|
||||
|
||||
class _MarketWidgetState extends State<MarketWidget> {
|
||||
MarketSortType _type = MarketSortType.recommend;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 2),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
MarketSortType.recommend,
|
||||
MarketSortType.updated,
|
||||
MarketSortType.likes,
|
||||
MarketSortType.downloads,
|
||||
]
|
||||
.map(
|
||||
(e) => Flexible(
|
||||
flex: 1,
|
||||
fit: FlexFit.tight,
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_type = e;
|
||||
});
|
||||
},
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${LocaleKeys.market_sort_types}.${e.name}'.tr(),
|
||||
style: _type == e ? TextStyle(fontWeight: FontWeight.bold, fontSize: 15) : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: .3,
|
||||
color: context.t.dividerColor,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(defaultBorderRadius),
|
||||
),
|
||||
child: Column(
|
||||
children: [Text('asd')],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
DButton.like(
|
||||
enabled: true,
|
||||
onTap: () {},
|
||||
),
|
||||
DButton.download(
|
||||
enabled: true,
|
||||
onTap: () {},
|
||||
),
|
||||
]
|
||||
.map((e) => Padding(
|
||||
padding: const EdgeInsets.only(right: 4),
|
||||
child: e,
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
+92
-47
@@ -1,4 +1,5 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:dde_gesture_manager/constants/constants.dart';
|
||||
import 'package:dde_gesture_manager/extensions.dart';
|
||||
@@ -9,6 +10,8 @@ import 'package:dde_gesture_manager/utils/notificator.dart';
|
||||
import 'package:dde_gesture_manager_api/models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_platform_alert/flutter_platform_alert.dart';
|
||||
import 'package:markdown_editor_ot/markdown_editor.dart';
|
||||
import 'package:numeral/fun.dart';
|
||||
|
||||
import 'dde_button.dart';
|
||||
|
||||
@@ -137,60 +140,102 @@ class _MeWidgetState extends State<MeWidget> {
|
||||
),
|
||||
borderRadius: BorderRadius.circular(defaultBorderRadius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 1, vertical: 2),
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) => GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_selected = _schemes[index].uuid;
|
||||
});
|
||||
},
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
onEnter: (_) {
|
||||
setState(() {
|
||||
_hovering = _schemes[index].uuid;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
color: _getItemBackgroundColor(index, _schemes[index].uuid),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 6, right: 12.0),
|
||||
child: DefaultTextStyle(
|
||||
style: context.t.textTheme.bodyText2!.copyWith(
|
||||
color: _selected == _schemes[index].uuid ? Colors.white : null,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(_schemes[index].name ?? ''),
|
||||
Row(
|
||||
children: [
|
||||
Text('${_schemes[index].downloads ?? 0}'.padLeft(4)),
|
||||
Icon(
|
||||
Icons.file_download,
|
||||
size: 18,
|
||||
),
|
||||
Text('${_schemes[index].likes ?? 0}'.padLeft(4)),
|
||||
Icon(_schemes[index].liked == true ? Icons.thumb_up : Icons.thumb_up_off_alt,
|
||||
size: 17),
|
||||
]
|
||||
.map((e) => Padding(
|
||||
padding: const EdgeInsets.only(right: 3),
|
||||
child: e,
|
||||
))
|
||||
.toList(),
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 1, vertical: 2),
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) => GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_selected = _schemes[index].uuid;
|
||||
});
|
||||
},
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
onEnter: (_) {
|
||||
setState(() {
|
||||
_hovering = _schemes[index].uuid;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
color: _getItemBackgroundColor(index, _schemes[index].uuid),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 6, right: 12.0),
|
||||
child: DefaultTextStyle(
|
||||
style: context.t.textTheme.bodyText2!.copyWith(
|
||||
color: _selected == _schemes[index].uuid ? Colors.white : null,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(_schemes[index].name ?? ''),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 50,
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: AutoSizeText(
|
||||
'${numeral(_schemes[index].downloads ?? 0, fractionDigits: 1)}'
|
||||
.padLeft(5),
|
||||
),
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.file_download,
|
||||
size: 18,
|
||||
),
|
||||
SizedBox(
|
||||
width: 50,
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: AutoSizeText(
|
||||
'${numeral(_schemes[index].likes ?? 0, fractionDigits: 1)}'.padLeft(5),
|
||||
),
|
||||
),
|
||||
),
|
||||
Icon(_schemes[index].liked == true ? Icons.thumb_up : Icons.thumb_up_off_alt,
|
||||
size: 17),
|
||||
]
|
||||
.map((e) => Padding(
|
||||
padding: const EdgeInsets.only(right: 3),
|
||||
child: e,
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
itemCount: _schemes.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
itemCount: _schemes.length,
|
||||
),
|
||||
Divider(thickness: .5),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: MdPreview(
|
||||
text: _schemes.firstWhereOrNull((e) => e.uuid == _selected)?.description ?? '',
|
||||
widgetImage: (imageUrl) => CachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
placeholder: (context, url) => const SizedBox(
|
||||
width: double.infinity,
|
||||
height: 300,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
errorWidget: (context, url, error) => const Icon(Icons.error),
|
||||
),
|
||||
onCodeCopied: () {},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
+12
-11
@@ -23,25 +23,26 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
cupertino_icons: ^1.0.2
|
||||
window_manager: ^0.0.5
|
||||
cupertino_icons: ^1.0.4
|
||||
window_manager: ^0.1.3
|
||||
localstorage: ^4.0.0+1
|
||||
shared_preferences: ^2.0.7
|
||||
xdg_directories: 0.2.0
|
||||
gsettings: 0.2.0
|
||||
provider: ^6.0.0
|
||||
package_info_plus: ^1.0.6
|
||||
shared_preferences: ^2.0.12
|
||||
xdg_directories: ^0.2.0
|
||||
gsettings: 0.2.3
|
||||
provider: ^6.0.2
|
||||
package_info_plus: ^1.3.0
|
||||
easy_localization: ^3.0.0
|
||||
glass_kit: ^2.0.1
|
||||
rect_getter: ^1.0.0
|
||||
path_provider: ^2.0.5
|
||||
path_provider: ^2.0.8
|
||||
uuid: ^3.0.5
|
||||
adaptive_scrollbar: ^2.1.0
|
||||
flutter_platform_alert: ^0.2.1
|
||||
cached_network_image: ^3.2.0
|
||||
url_launcher: ^6.0.17
|
||||
url_launcher: ^6.0.18
|
||||
flutter_login: ^3.1.0
|
||||
auto_size_text: ^3.0.0
|
||||
numeral: ^1.2.5
|
||||
markdown_editor_ot:
|
||||
path: 3rd_party/markdown_editor_ot
|
||||
cherry_toast:
|
||||
@@ -54,8 +55,8 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
build_runner: 2.1.2
|
||||
source_gen: 1.1.0
|
||||
build_runner: 2.1.7
|
||||
source_gen: 1.2.1
|
||||
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
|
||||
@@ -20,7 +20,13 @@
|
||||
"tip": "Display help documentation"
|
||||
},
|
||||
"market": {
|
||||
"title": "Scheme market"
|
||||
"title": "Scheme market",
|
||||
"sort_types": {
|
||||
"recommend": "Recommend",
|
||||
"updated": "updated",
|
||||
"likes": "likes",
|
||||
"downloads": "downloads"
|
||||
}
|
||||
},
|
||||
"local_manager": {
|
||||
"title": "Local scheme management",
|
||||
|
||||
@@ -20,7 +20,13 @@
|
||||
"tip": "显示帮助文档"
|
||||
},
|
||||
"market": {
|
||||
"title": "方案市场"
|
||||
"title": "方案市场",
|
||||
"sort_types": {
|
||||
"recommend": "推荐",
|
||||
"updated": "最近更新",
|
||||
"likes": "点赞数",
|
||||
"downloads": "下载量"
|
||||
}
|
||||
},
|
||||
"local_manager": {
|
||||
"title": "本地方案管理",
|
||||
|
||||
Reference in New Issue
Block a user