bookedit bugfix and hide quik action

This commit is contained in:
DASHU
2024-12-09 14:51:32 +08:00
parent 3c7aecd83c
commit 788f993069
3 changed files with 38 additions and 31 deletions

View File

@@ -118,25 +118,27 @@ class _BookmarkEditDialog extends State<BookmarkEditDialog> {
),
));
list.add(Container(
child: Row(
children: [
Text("Add to quick action"),
Expanded(
child: Checkbox(
value: addedToQa,
onChanged: (v) {
if (v != null) {
setState(() {
addedToQa = v;
});
}
},
),
)
],
),
));
if (!PlatformUtil.isPC()) {
list.add(Container(
child: Row(
children: [
Text("Add to quick action"),
Expanded(
child: Checkbox(
value: addedToQa,
onChanged: (v) {
if (v != null) {
setState(() {
addedToQa = v;
});
}
},
),
)
],
),
));
}
list.add(Container(
margin: EdgeInsets.only(
@@ -195,20 +197,22 @@ class _BookmarkEditDialog extends State<BookmarkEditDialog> {
await BookmarkDB.update(bookmark);
}
try {
var allQas = await BookmarkDB.allQas();
List<ShortcutItem> qas = [];
for (var bk in allQas) {
if (StringUtil.isBlank(bk.title) || StringUtil.isBlank(bk.url)) {
continue;
}
if (!PlatformUtil.isPC()) {
try {
var allQas = await BookmarkDB.allQas();
List<ShortcutItem> qas = [];
for (var bk in allQas) {
if (StringUtil.isBlank(bk.title) || StringUtil.isBlank(bk.url)) {
continue;
}
qas.add(ShortcutItem(
type: bk.url!, localizedTitle: bk.title!, icon: 'ic_launcher'));
quickActions.setShortcutItems(qas);
qas.add(ShortcutItem(
type: bk.url!, localizedTitle: bk.title!, icon: 'ic_launcher'));
quickActions.setShortcutItems(qas);
}
} catch (e) {
print(e);
}
} catch (e) {
print(e);
}
await bookmarkProvider.reload();

View File

@@ -97,6 +97,7 @@ Future<void> main() async {
await doInit();
mediaDataCache = MediaDataCache();
await bookmarkProvider.init();
runApp(MyApp());

View File

@@ -67,6 +67,8 @@ class _IndexRouter extends CustState<IndexRouter>
@override
Widget doBuild(BuildContext context) {
var themeData = Theme.of(context);
mediaDataCache.update(context);
// if (PlatformUtil.isAndroid()) {
// WidgetsBinding.instance.addPostFrameCallback((_) async {
// var intent = await getInitialIntent();