@@ -328,95 +328,6 @@ class _DeviceBrowserPageState extends State<DeviceBrowserPage> {
328
328
);
329
329
}
330
330
331
- Wrap _navigationActions () {
332
- return Wrap (
333
- children: [
334
- IconButton (
335
- splashRadius: 20 ,
336
- icon: const Icon (
337
- FluentIcons .arrow_left_20_regular,
338
- ),
339
- onPressed: () {
340
- _fileBrowser.back ();
341
- },
342
- ),
343
- IconButton (
344
- splashRadius: 20 ,
345
- icon: const Icon (
346
- FluentIcons .arrow_right_20_regular,
347
- ),
348
- onPressed: () {
349
- _fileBrowser.forward ();
350
- },
351
- ),
352
- IconButton (
353
- splashRadius: 20 ,
354
- icon: const Icon (
355
- FluentIcons .folder_arrow_up_20_regular,
356
- ),
357
- onPressed: () {
358
- _fileBrowser.navigateToDirectory (
359
- Adb .adbPathContext.dirname (_fileBrowser.currentPath));
360
- },
361
- ),
362
- IconButton (
363
- splashRadius: 20 ,
364
- icon: const Icon (FluentIcons .arrow_clockwise_20_regular),
365
- onPressed: () {
366
- _refresh ();
367
- },
368
- ),
369
- ],
370
- );
371
- }
372
-
373
- void _onNavigate (String newPath) {
374
- if (! context.mounted) return ;
375
-
376
- Trace .verbose ("Loading $newPath " );
377
- // final token = ServicesBinding.rootIsolateToken;
378
- // var future = compute((message) {
379
- // // why is this necessary?
380
- // BackgroundIsolateBinaryMessenger.ensureInitialized(message.item3!);
381
-
382
- // return Adb.getFilesInDirectory(message.item1, message.item2);
383
- // }, Tuple3(widget.serial, newPath, token));
384
- var future = Adb .getFilesInDirectory (widget.serial, newPath);
385
-
386
- var filesFuture = future.then ((list) => list.map ((e) {
387
- return FileBrowserMetadata (
388
- browser: _fileBrowser,
389
- modifiedTime: e.date,
390
- fileSize: e.size,
391
- fullFilePath: e.path,
392
- isDirectory: e.path.endsWith ("/" ),
393
- onWatch: _watchFile,
394
- serial: widget.serial,
395
- );
396
- }).toList (growable: false ));
397
-
398
- setState (() {
399
- _fileListingFuture = filesFuture;
400
- });
401
- }
402
-
403
- void _refresh () {
404
- _onNavigate (_fileBrowser.currentPath);
405
- }
406
-
407
- Future <void > _showNewFileDialog () async {
408
- final TextEditingController fileNameController = TextEditingController ();
409
- final ValueNotifier <FileCreation > fileCreation =
410
- ValueNotifier (FileCreation .File );
411
-
412
- await showDialog <void >(
413
- context: context,
414
- barrierDismissible: true , // user must tap button!
415
- builder: (BuildContext context) =>
416
- NewFileDialog (fileBrowser: _fileBrowser, serial: widget.serial),
417
- );
418
- }
419
-
420
331
void _uploadFiles (Iterable <String > paths) async {
421
332
Trace .verbose ("Uploading $paths " );
422
333
var tasks = paths.map ((path) {
@@ -465,6 +376,36 @@ class _DeviceBrowserPageState extends State<DeviceBrowserPage> {
465
376
snackBar.close ();
466
377
}
467
378
379
+ void _onNavigate (String newPath) {
380
+ if (! context.mounted) return ;
381
+
382
+ Trace .verbose ("Loading $newPath " );
383
+ // final token = ServicesBinding.rootIsolateToken;
384
+ // var future = compute((message) {
385
+ // // why is this necessary?
386
+ // BackgroundIsolateBinaryMessenger.ensureInitialized(message.item3!);
387
+
388
+ // return Adb.getFilesInDirectory(message.item1, message.item2);
389
+ // }, Tuple3(widget.serial, newPath, token));
390
+ var future = Adb .getFilesInDirectory (widget.serial, newPath);
391
+
392
+ var filesFuture = future.then ((list) => list.map ((e) {
393
+ return FileBrowserMetadata (
394
+ browser: _fileBrowser,
395
+ modifiedTime: e.date,
396
+ fileSize: e.size,
397
+ fullFilePath: e.path,
398
+ isDirectory: e.path.endsWith ("/" ),
399
+ onWatch: _watchFile,
400
+ serial: widget.serial,
401
+ );
402
+ }).toList (growable: false ));
403
+
404
+ setState (() {
405
+ _fileListingFuture = filesFuture;
406
+ });
407
+ }
408
+
468
409
Future <void > _watchFile (String source, String savePath) async {
469
410
onWatchAdd.invoke (Tuple2 (savePath, source));
470
411
}
0 commit comments