36 lines
826 B
Dart
36 lines
826 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
|
|
class PasswordValidationResult extends StatelessWidget {
|
|
final String ruleName;
|
|
final bool result;
|
|
|
|
const PasswordValidationResult({
|
|
super.key,
|
|
required this.ruleName,
|
|
required this.result
|
|
});
|
|
|
|
Color _selectColor(BuildContext context, bool res) {
|
|
final scheme = Theme.of(context).colorScheme;
|
|
return res ? scheme.secondary : scheme.error;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(
|
|
result ? Icons.check : Icons.close,
|
|
color: _selectColor(context, result),
|
|
),
|
|
const SizedBox(width: 8),
|
|
Text(
|
|
ruleName,
|
|
style: TextStyle(color: _selectColor(context, result)),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |