debug: app query
This commit is contained in:
parent
711b6bcbc8
commit
8aacd5064f
1 changed files with 59 additions and 46 deletions
|
@ -1,6 +1,7 @@
|
||||||
import 'package:aves/image_providers/app_icon_image_provider.dart';
|
import 'package:aves/image_providers/app_icon_image_provider.dart';
|
||||||
import 'package:aves/services/common/services.dart';
|
import 'package:aves/services/common/services.dart';
|
||||||
import 'package:aves/utils/android_file_utils.dart';
|
import 'package:aves/utils/android_file_utils.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/query_bar.dart';
|
||||||
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
||||||
import 'package:aves/widgets/viewer/info/common.dart';
|
import 'package:aves/widgets/viewer/info/common.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
@ -15,6 +16,7 @@ class DebugAndroidAppSection extends StatefulWidget {
|
||||||
|
|
||||||
class _DebugAndroidAppSectionState extends State<DebugAndroidAppSection> with AutomaticKeepAliveClientMixin {
|
class _DebugAndroidAppSectionState extends State<DebugAndroidAppSection> with AutomaticKeepAliveClientMixin {
|
||||||
late Future<Set<Package>> _loader;
|
late Future<Set<Package>> _loader;
|
||||||
|
final ValueNotifier<String> _queryNotifier = ValueNotifier('');
|
||||||
|
|
||||||
static const iconSize = 20.0;
|
static const iconSize = 20.0;
|
||||||
|
|
||||||
|
@ -43,53 +45,64 @@ class _DebugAndroidAppSectionState extends State<DebugAndroidAppSection> with Au
|
||||||
final disabledTheme = enabledTheme.merge(const IconThemeData(opacity: .2));
|
final disabledTheme = enabledTheme.merge(const IconThemeData(opacity: .2));
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: packages.map((package) {
|
children: [
|
||||||
return Text.rich(
|
QueryBar(queryNotifier: _queryNotifier),
|
||||||
TextSpan(
|
...packages.map((package) {
|
||||||
children: [
|
return ValueListenableBuilder<String>(
|
||||||
WidgetSpan(
|
valueListenable: _queryNotifier,
|
||||||
alignment: PlaceholderAlignment.middle,
|
builder: (context, query, child) {
|
||||||
child: Image(
|
if ({package.packageName, ...package.potentialDirs}.none((v) => v.contains(query))) {
|
||||||
image: AppIconImage(
|
return const SizedBox();
|
||||||
packageName: package.packageName,
|
}
|
||||||
size: iconSize,
|
return Text.rich(
|
||||||
),
|
TextSpan(
|
||||||
width: iconSize,
|
children: [
|
||||||
height: iconSize,
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: Image(
|
||||||
|
image: AppIconImage(
|
||||||
|
packageName: package.packageName,
|
||||||
|
size: iconSize,
|
||||||
|
),
|
||||||
|
width: iconSize,
|
||||||
|
height: iconSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: ' ${package.packageName}\n',
|
||||||
|
style: InfoRowGroup.keyStyle,
|
||||||
|
),
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: IconTheme(
|
||||||
|
data: package.categoryLauncher ? enabledTheme : disabledTheme,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.launch_outlined,
|
||||||
|
size: iconSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: IconTheme(
|
||||||
|
data: package.isSystem ? enabledTheme : disabledTheme,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.android,
|
||||||
|
size: iconSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: ' ${package.potentialDirs.join(', ')}\n',
|
||||||
|
style: InfoRowGroup.baseStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
TextSpan(
|
},
|
||||||
text: ' ${package.packageName}\n',
|
);
|
||||||
style: InfoRowGroup.keyStyle,
|
})
|
||||||
),
|
],
|
||||||
WidgetSpan(
|
|
||||||
alignment: PlaceholderAlignment.middle,
|
|
||||||
child: IconTheme(
|
|
||||||
data: package.categoryLauncher ? enabledTheme : disabledTheme,
|
|
||||||
child: const Icon(
|
|
||||||
Icons.launch_outlined,
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
WidgetSpan(
|
|
||||||
alignment: PlaceholderAlignment.middle,
|
|
||||||
child: IconTheme(
|
|
||||||
data: package.isSystem ? enabledTheme : disabledTheme,
|
|
||||||
child: const Icon(
|
|
||||||
Icons.android,
|
|
||||||
size: iconSize,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: ' ${package.potentialDirs.join(', ')}\n',
|
|
||||||
style: InfoRowGroup.baseStyle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue