-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-1941: Update quick actions (#1944)
* TW-1941: Update quicks actions * TW-1941: Separate chat list slidable actions * TW-1941: Write test for `getSlidables`
- Loading branch information
Showing
7 changed files
with
497 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:fluffychat/pages/chat_list/chat_list_view_style.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_slidable/flutter_slidable.dart'; | ||
|
||
class ChatCustomSlidableAction extends StatelessWidget { | ||
const ChatCustomSlidableAction({ | ||
super.key, | ||
required this.icon, | ||
required this.label, | ||
required this.onPressed, | ||
required this.backgroundColor, | ||
required this.foregroundColor, | ||
}); | ||
|
||
final Widget icon; | ||
final String label; | ||
final SlidableActionCallback? onPressed; | ||
final Color backgroundColor; | ||
final Color foregroundColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return CustomSlidableAction( | ||
autoClose: true, | ||
padding: ChatListViewStyle.slidablePadding, | ||
onPressed: onPressed, | ||
backgroundColor: backgroundColor, | ||
foregroundColor: foregroundColor, | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
icon, | ||
const SizedBox(height: ChatListViewStyle.slidableIconTextGap), | ||
Text( | ||
label, | ||
style: Theme.of(context).textTheme.labelMedium?.copyWith( | ||
color: foregroundColor, | ||
), | ||
overflow: TextOverflow.ellipsis, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.