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
class AwesomeWidget extends StatelessWidget { | |
const AwesomeWidget({ | |
super.key, | |
}); | |
@override | |
Widget build(BuildContext, context) { | |
void showUserScreen() { | |
// show user screen | |
} | |
Future<void> follow() async { | |
// follow user | |
} | |
Future<void> unfollow() { | |
// unfollow user | |
} | |
void copyUserId() { | |
// copy user id | |
} | |
return ListTile( | |
onLongPress: copyUserId, | |
// こんなウィジェットはないけどイメージで | |
leading: Thumbnail( | |
userId: user.id, | |
onPressed: showUserScreen, | |
), | |
title: GestureDetector( | |
onTap: showUserScreen, | |
Text(user.name), | |
), | |
trailing: ElevatedButton( | |
onPressed: user.isFollowing ? unfollow : follow, | |
child: Text(user.isFollowing ? 'フォローを外す' : 'フォロー'), | |
), | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment