This commit is contained in:
lollipopkit
2023-05-26 17:01:52 +08:00
parent c1c009863d
commit 20ef9d4575
28 changed files with 126 additions and 149 deletions

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
const Set<MaterialState> interactiveStates = <MaterialState>{
const _interactiveStates = <MaterialState>{
MaterialState.pressed,
MaterialState.hovered,
MaterialState.focused,
@@ -18,7 +18,7 @@ extension ColorX on Color {
MaterialStateProperty<Color?> get materialStateColor {
return MaterialStateProperty.resolveWith((states) {
if (states.any(interactiveStates.contains)) {
if (states.any(_interactiveStates.contains)) {
return this;
}
return null;

View File

@@ -11,8 +11,12 @@ typedef PwdRequestFunc = Future<String> Function();
final pwdRequestWithUserReg = RegExp(r'\[sudo\] password for (.+):');
extension SSHClientX on SSHClient {
Future<int?> exec(String cmd,
{OnStd? onStderr, OnStd? onStdout, OnStdin? stdin}) async {
Future<int?> exec(
String cmd, {
OnStd? onStderr,
OnStd? onStdout,
OnStdin? stdin,
}) async {
final session = await execute(cmd);
final stdoutDone = Completer<void>();

View File

@@ -10,8 +10,11 @@ extension StringX on String {
return Uri.parse(this);
}
Widget omitStartStr(
{TextStyle? style, TextOverflow? overflow, int? maxLines}) {
Widget omitStartStr({
TextStyle? style,
TextOverflow? overflow,
int? maxLines,
}) {
return LayoutBuilder(builder: (context, size) {
bool exceeded = false;
int len = 0;