mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 06:19:35 +00:00
1.增加托盘图标
2.关闭修改为最小化到托盘 3.优化播放页播放速率选项
This commit is contained in:
parent
779c132a11
commit
13767656b5
14 changed files with 354 additions and 15 deletions
40
lib/shared/utils/utils.dart
Normal file
40
lib/shared/utils/utils.dart
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class Utils {
|
||||
static isAndroid() {
|
||||
return !kIsWeb && Platform.isAndroid;
|
||||
}
|
||||
|
||||
static isIOS() {
|
||||
return !kIsWeb && Platform.isIOS;
|
||||
}
|
||||
|
||||
static isMobile() {
|
||||
return !kIsWeb && (Platform.isAndroid || Platform.isIOS);
|
||||
}
|
||||
|
||||
static isDesktop() {
|
||||
if (kIsWeb) {
|
||||
return false;
|
||||
}
|
||||
return Platform.isWindows || Platform.isLinux || Platform.isMacOS;
|
||||
}
|
||||
|
||||
static isWindows() {
|
||||
return !kIsWeb && Platform.isWindows;
|
||||
}
|
||||
|
||||
static isMacos() {
|
||||
return !kIsWeb && Platform.isMacOS;
|
||||
}
|
||||
|
||||
static isLinux() {
|
||||
return !kIsWeb && Platform.isLinux;
|
||||
}
|
||||
|
||||
static isWeb() {
|
||||
return kIsWeb;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
|
||||
class ExpandableDescription extends HookWidget {
|
||||
const ExpandableDescription({
|
||||
|
|
@ -78,18 +79,28 @@ class ExpandableDescription extends HookWidget {
|
|||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: AnimatedSwitcher(
|
||||
duration: duration * 3,
|
||||
child: isDescExpanded.value
|
||||
? Text(
|
||||
style: textTheme.bodyMedium,
|
||||
content,
|
||||
maxLines: null,
|
||||
)
|
||||
: Text(
|
||||
style: textTheme.bodyMedium,
|
||||
content,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
// child: isDescExpanded.value
|
||||
// ? Text(
|
||||
// style: textTheme.bodyMedium,
|
||||
// content,
|
||||
// maxLines: null,
|
||||
// )
|
||||
// : Text(
|
||||
// style: textTheme.bodyMedium,
|
||||
// content,
|
||||
// maxLines: 3,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
// ),
|
||||
child: Html(
|
||||
data: '<div class="vaani-ellipsis">$content</div>',
|
||||
style: {
|
||||
"div": Style(
|
||||
maxLines: isDescExpanded.value ? null : 3,
|
||||
textOverflow: TextOverflow.ellipsis,
|
||||
fontStyle: textTheme.bodyMedium?.fontStyle,
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class SimpleHomeShelf extends HookConsumerWidget {
|
|||
),
|
||||
// fix the height of the shelf as a percentage of the screen height
|
||||
SizedBox(
|
||||
height: height ?? getDefaultShelfHeight(context, perCent: 0.5),
|
||||
height: height ?? getDefaultShelfHeight(context, perCent: 0.45),
|
||||
child: ListView.separated(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (context, index) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue