debug: codecs
This commit is contained in:
parent
5591e1d0e3
commit
0674a42fe5
1 changed files with 17 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
||||||
import 'package:aves/services/android_debug_service.dart';
|
import 'package:aves/services/android_debug_service.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/common/identity/highlight_title.dart';
|
import 'package:aves/widgets/common/identity/highlight_title.dart';
|
||||||
import 'package:aves/widgets/viewer/info/common.dart';
|
import 'package:aves/widgets/viewer/info/common.dart';
|
||||||
|
@ -14,6 +15,7 @@ class DebugAndroidCodecSection extends StatefulWidget {
|
||||||
|
|
||||||
class _DebugAndroidCodecSectionState extends State<DebugAndroidCodecSection> with AutomaticKeepAliveClientMixin {
|
class _DebugAndroidCodecSectionState extends State<DebugAndroidCodecSection> with AutomaticKeepAliveClientMixin {
|
||||||
late Future<List<Map>> _loader;
|
late Future<List<Map>> _loader;
|
||||||
|
final ValueNotifier<String> _queryNotifier = ValueNotifier('');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -42,18 +44,25 @@ class _DebugAndroidCodecSectionState extends State<DebugAndroidCodecSection> wit
|
||||||
final byEncoder = groupBy<Map<String, String>, bool>(codecs, (v) => v['isEncoder'] == 'true');
|
final byEncoder = groupBy<Map<String, String>, bool>(codecs, (v) => v['isEncoder'] == 'true');
|
||||||
final decoders = byEncoder[false] ?? [];
|
final decoders = byEncoder[false] ?? [];
|
||||||
final encoders = byEncoder[true] ?? [];
|
final encoders = byEncoder[true] ?? [];
|
||||||
Widget _toCodecColumn(List<Map<String, String>> codecs) => Column(
|
Widget _toCodecColumn(List<Map<String, String>> codecs) => ValueListenableBuilder<String>(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
valueListenable: _queryNotifier,
|
||||||
children: codecs
|
builder: (context, query, child) => Column(
|
||||||
.expand((v) => [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
InfoRowGroup(info: Map.fromEntries(v.entries.where((kv) => kv.key != 'isEncoder'))),
|
children: codecs.expand((v) {
|
||||||
const Divider(),
|
final types = v['supportedTypes'];
|
||||||
])
|
return (query.isEmpty || types == null || types.contains(query))
|
||||||
.toList(),
|
? [
|
||||||
|
InfoRowGroup(info: Map.fromEntries(v.entries.where((kv) => kv.key != 'isEncoder'))),
|
||||||
|
const Divider(),
|
||||||
|
]
|
||||||
|
: <Widget>[];
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
QueryBar(queryNotifier: _queryNotifier),
|
||||||
const HighlightTitle(title: 'Decoders'),
|
const HighlightTitle(title: 'Decoders'),
|
||||||
_toCodecColumn(decoders),
|
_toCodecColumn(decoders),
|
||||||
const HighlightTitle(title: 'Encoders'),
|
const HighlightTitle(title: 'Encoders'),
|
||||||
|
|
Loading…
Reference in a new issue