mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-30 17:05:49 +08:00
feat(selection): update clear method and improve selection action bar visibility
This commit is contained in:
@@ -272,7 +272,7 @@ class HistoryTask extends ListenerListEvent<HttpRequest> {
|
||||
void onBatchRemove(List<HttpRequest> items) => resetList();
|
||||
|
||||
@override
|
||||
clear() => resetList();
|
||||
void clear(List<HttpRequest> items) => resetList();
|
||||
|
||||
Future<void> resetList() async {
|
||||
locked = true;
|
||||
|
||||
@@ -132,47 +132,45 @@ class DesktopRequestListState extends State<DesktopRequestListWidget> with Autom
|
||||
bottomNavigationBar: Search(key: searchKey, onSearch: search),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(right: 5),
|
||||
child: Obx(() {
|
||||
return Column(children: [
|
||||
if (isSelectionMode)
|
||||
SelectionActionBar(
|
||||
child: Column(children: [
|
||||
Obx(() => selectionController.selectionMode.value
|
||||
? SelectionActionBar(
|
||||
selectionController: selectionController,
|
||||
onRepeat: repeatSelected,
|
||||
onExport: exportSelected,
|
||||
onDelete: deleteSelected),
|
||||
Expanded(
|
||||
child: TabBarView(physics: const NeverScrollableScrollPhysics(), children: [
|
||||
DomainList(
|
||||
key: domainListKey,
|
||||
list: container,
|
||||
panel: widget.panel,
|
||||
proxyServer: widget.proxyServer,
|
||||
selectionController: selectionController,
|
||||
selectionHandlers: RequestSelectionHandlers(
|
||||
onRangeSelection: rangeSelectRequest,
|
||||
onDeleteSelected: deleteSelected,
|
||||
onRepeatSelected: repeatSelected,
|
||||
onExportSelected: exportSelected,
|
||||
),
|
||||
onRemove: domainListRemove,
|
||||
onDelete: deleteSelected)
|
||||
: SizedBox()),
|
||||
Expanded(
|
||||
child: TabBarView(physics: const NeverScrollableScrollPhysics(), children: [
|
||||
DomainList(
|
||||
key: domainListKey,
|
||||
list: container,
|
||||
panel: widget.panel,
|
||||
proxyServer: widget.proxyServer,
|
||||
selectionController: selectionController,
|
||||
selectionHandlers: RequestSelectionHandlers(
|
||||
onRangeSelection: rangeSelectRequest,
|
||||
onDeleteSelected: deleteSelected,
|
||||
onRepeatSelected: repeatSelected,
|
||||
onExportSelected: exportSelected,
|
||||
),
|
||||
RequestSequence(
|
||||
key: requestSequenceKey,
|
||||
container: container,
|
||||
proxyServer: widget.proxyServer,
|
||||
selectionController: selectionController,
|
||||
// onSelectionChanged: syncDomainSelectionVisuals,
|
||||
selectionHandlers: RequestSelectionHandlers(
|
||||
onRangeSelection: rangeSelectRequest,
|
||||
onDeleteSelected: deleteSelected,
|
||||
onRepeatSelected: repeatSelected,
|
||||
onExportSelected: exportSelected,
|
||||
),
|
||||
onRemove: sequenceRemove,
|
||||
onRemove: domainListRemove,
|
||||
),
|
||||
RequestSequence(
|
||||
key: requestSequenceKey,
|
||||
container: container,
|
||||
proxyServer: widget.proxyServer,
|
||||
selectionController: selectionController,
|
||||
selectionHandlers: RequestSelectionHandlers(
|
||||
onRangeSelection: rangeSelectRequest,
|
||||
onDeleteSelected: deleteSelected,
|
||||
onRepeatSelected: repeatSelected,
|
||||
onExportSelected: exportSelected,
|
||||
),
|
||||
])),
|
||||
]);
|
||||
})));
|
||||
onRemove: sequenceRemove,
|
||||
),
|
||||
])),
|
||||
])));
|
||||
})));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ name: proxypin
|
||||
description: ProxyPin
|
||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
version: 1.2.7+30
|
||||
version: 1.2.8+30
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.2 <4.0.0'
|
||||
|
||||
@@ -24,9 +24,11 @@ void main() {
|
||||
expect(controller.selectedIds, {'b', 'c', 'd'});
|
||||
});
|
||||
|
||||
test('selectAll and prune keep only visible ids', () {
|
||||
test('prune keeps only visible ids', () {
|
||||
final controller = MultiSelectController();
|
||||
|
||||
controller.selectOnly('b');
|
||||
controller.selectRange(['a', 'b', 'c', 'd'], 'c');
|
||||
controller.prune(['b', 'c', 'd']);
|
||||
|
||||
expect(controller.isSelectionMode, isTrue);
|
||||
|
||||
Reference in New Issue
Block a user