Refactor button overlay color handling in document viewer, file explorer, and home page for improved state management
This commit is contained in:
@@ -238,7 +238,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
final highlightColor = const Color.fromARGB(255, 100, 200, 255);
|
||||
final defaultColor = AppTheme.secondaryText;
|
||||
return TextButton(
|
||||
style: ButtonStyle(splashFactory: NoSplash.splashFactory),
|
||||
style: ButtonStyle(
|
||||
splashFactory: NoSplash.splashFactory,
|
||||
overlayColor: WidgetStateProperty.resolveWith<Color?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.contains(WidgetState.pressed)) {
|
||||
return Colors.transparent;
|
||||
}
|
||||
return null; // Use default for other states (like hover)
|
||||
}),
|
||||
),
|
||||
onPressed: onTap,
|
||||
child: Text(
|
||||
org.name,
|
||||
@@ -254,7 +264,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
final highlightColor = const Color.fromARGB(255, 100, 200, 255);
|
||||
final defaultColor = AppTheme.secondaryText;
|
||||
return TextButton(
|
||||
style: ButtonStyle(splashFactory: NoSplash.splashFactory),
|
||||
style: ButtonStyle(
|
||||
splashFactory: NoSplash.splashFactory,
|
||||
overlayColor: WidgetStateProperty.resolveWith<Color?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.contains(WidgetState.pressed)) {
|
||||
return Colors.transparent;
|
||||
}
|
||||
return null; // Use default for other states (like hover)
|
||||
}),
|
||||
),
|
||||
onPressed: onTap,
|
||||
child: Text(
|
||||
'Personal',
|
||||
@@ -269,7 +289,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
Widget _buildAddButton(VoidCallback onTap) {
|
||||
final defaultColor = AppTheme.secondaryText;
|
||||
return TextButton(
|
||||
style: ButtonStyle(splashFactory: NoSplash.splashFactory),
|
||||
style: ButtonStyle(
|
||||
splashFactory: NoSplash.splashFactory,
|
||||
overlayColor: WidgetStateProperty.resolveWith<Color?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.contains(WidgetState.pressed)) {
|
||||
return Colors.transparent;
|
||||
}
|
||||
return null; // Use default for other states (like hover)
|
||||
}),
|
||||
),
|
||||
onPressed: onTap,
|
||||
child: Text('+ Add Organization', style: TextStyle(color: defaultColor)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user