Card class

class _FriendsListsState extends State<FriendsLists> {
  List<Friend> friends = [
    Friend(name: 'sso', age: 22),
    Friend(name: 'tam2burin', age: 522),
    Friend(name: 'yoosona', age: 6),
  ];

  Widget friendTemplate(friend){
    return Card(
      margin: EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0),
      child: Padding(
        padding: const EdgeInsets.all(12.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Text(
              friend.name,
              style: TextStyle(
                fontSize: 18.0,
                color: Colors.grey[600],
              ),
            ),
            SizedBox(height: 5.0,),
            Text(
              friend.age,
              style: TextStyle(
                fontSize: 14.0,
                color: Colors.grey[800],
              ),
            ),
          ],
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.grey[200],
      appBar: AppBar(
        title: Text("My friends"),
        centerTitle: true,
        backgroundColor: Colors.redAccent,
      ),
      body: Column(
        children: friends.map((friend) => friendTemplate(friend)).toList(), // if you want to output var which requre property, must cover w/ curly braces
      ),
    );
  }
}

Flutter Outline -> right click on widget -> Extract widget

This automatically makes stless widget

// main.dart

  Widget friendTemplate(friend){
    return FriendCard(friend);
  }


class FriendCard extends StatelessWidget {
  // const FriendCard({
  //   Key key,
  // }) : super(key: key);

  // Make a constructor
  final Friend friend; // `Final` set this var as final and declare that it's not gonna be changed over time, Thus, allow us to use in stless widget
  FriendCard({ this.friend});

  @override
  Widget build(BuildContext context) {
    ...

// main.dart
class _FriendsListsState extends State<FriendsLists> {
  List<Friend> friends = [
    Friend(name: 'sso', age: 22),
    Friend(name: 'tam2burin', age: 522),
    Friend(name: 'yoosona', age: 6),
  ];

  // Delete
  //Widget friendTemplate(friend){
  //  return FriendCard(friend: friend);
  //}

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.grey[200],
      appBar: AppBar(
        title: Text("My friends"),
        centerTitle: true,
        backgroundColor: Colors.redAccent,
      ),
      body: Column(
        children: friends.map((friend) => FriendCard(friend: friend)).toList(),
      ),
    );
  }
}