auto paste in private key page

This commit is contained in:
lollipopkit
2023-01-09 13:46:02 +08:00
parent b2e2d4c603
commit 9c8f9c3b9f
5 changed files with 39 additions and 31 deletions

View File

@@ -1,5 +1,12 @@
import 'package:flutter/material.dart';
const Set<MaterialState> interactiveStates = <MaterialState>{
MaterialState.pressed,
MaterialState.hovered,
MaterialState.focused,
MaterialState.selected
};
extension ColorX on Color {
bool get isBrightColor {
return getBrightnessFromColor == Brightness.light;
@@ -8,4 +15,13 @@ extension ColorX on Color {
Brightness get getBrightnessFromColor {
return ThemeData.estimateBrightnessForColor(this);
}
MaterialStateProperty<Color?> get materialStateColor {
return MaterialStateProperty.resolveWith((states) {
if (states.any(interactiveStates.contains)) {
return this;
}
return null;
});
}
}