mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
10.0.8
This commit is contained in:
24
common/lib/src/util/extensions.dart
Normal file
24
common/lib/src/util/extensions.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
extension ProcessExtension on Process {
|
||||
Stream<String> get stdOutput => this.stdout.expand((event) => utf8.decode(event, allowMalformed: true).split("\n"));
|
||||
|
||||
Stream<String> get stdError => this.stderr.expand((event) => utf8.decode(event, allowMalformed: true).split("\n"));
|
||||
}
|
||||
|
||||
extension StringExtension on String {
|
||||
bool get isBlankOrEmpty {
|
||||
if(isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for(var char in this.split("")) {
|
||||
if(char != " ") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user