mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
opt.: android only arm64 & ssh tab page
This commit is contained in:
9
lib/core/extension/listx.dart
Normal file
9
lib/core/extension/listx.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
extension ListX<T> on List<T> {
|
||||
List<T> joinWith(T item, [bool self = true]) {
|
||||
final list = self ? this : List<T>.from(this);
|
||||
for (var i = length - 1; i > 0; i--) {
|
||||
list.insert(i, item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,14 @@ import 'package:dartssh2/dartssh2.dart';
|
||||
|
||||
extension SftpFile on SftpFileMode {
|
||||
String get str {
|
||||
final user = getRoleMode(userRead, userWrite, userExecute);
|
||||
final group = getRoleMode(groupRead, groupWrite, groupExecute);
|
||||
final other = getRoleMode(otherRead, otherWrite, otherExecute);
|
||||
final user = _getRoleMode(userRead, userWrite, userExecute);
|
||||
final group = _getRoleMode(groupRead, groupWrite, groupExecute);
|
||||
final other = _getRoleMode(otherRead, otherWrite, otherExecute);
|
||||
|
||||
return '$user$group$other';
|
||||
}
|
||||
}
|
||||
|
||||
String getRoleMode(bool r, bool w, bool x) {
|
||||
String _getRoleMode(bool r, bool w, bool x) {
|
||||
return '${r ? 'r' : '-'}${w ? 'w' : '-'}${x ? 'x' : '-'}';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user