1

I want to design something like the below image: enter image description here

the main widget is Card and the skill's widget is Chip. skills length can be between 3 words to 12 words, so the number of chips that can show is variable. this is my model:

class NurseListItem {
  late String imageUrl;
  late String nurseName;
  late String userType;
  late List<String> skills;
  late bool isBusy;
}

how can I create this listItem widget?

3
  • Are you looking/want image like in my answer here stackoverflow.com/a/68594656/13997210 Commented Aug 1, 2021 at 12:23
  • no unfortunately Commented Aug 1, 2021 at 13:28
  • You want your image? Commented Aug 1, 2021 at 13:29

1 Answer 1

1

Try to below code I have try above image like Widget hope its helpful for you.

Card(
     shape: RoundedRectangleBorder(
     side: BorderSide(
            color: Colors.green.shade300,
           ),
          borderRadius: BorderRadius.circular(15.0),
         ),
         child: Column(
                children: [
                   ListTile(
                     leading: Icon(Icons.check),
                     title: Text('User Name'),
                     subtitle: Text('User Type'),
                     trailing: FlutterLogo(size: 100),
                   ),
                   ButtonBar(
                     alignment: MainAxisAlignment.spaceEvenly,
                     children: [
                       Container(
                         padding: const EdgeInsets.all(5.0),
                         decoration: BoxDecoration(
                          border: Border.all(color: Colors.green),
                          borderRadius: BorderRadius.circular(5),
                        ),
                        child: Text('Skill 0'),
                       ),
                       Container(
                         padding: const EdgeInsets.all(5.0),
                         decoration: BoxDecoration(
                          border: Border.all(color: Colors.green),
                          borderRadius: BorderRadius.circular(5),
                        ),
                        child: Text('Skill 1'),
                       ),
                       Container(
                          padding: const EdgeInsets.all(5.0),
                          decoration: BoxDecoration(
                          border: Border.all(color: Colors.green),
                          borderRadius: BorderRadius.circular(5),
                        ),
                        child: Text('Skill 2'),
                       ),
                       Container(
                         padding: const EdgeInsets.all(5.0),
                          decoration: BoxDecoration(
                          border: Border.all(color: Colors.green),
                          borderRadius: BorderRadius.circular(5),
                        ),
                        child: Text('Skill 3'),
                       ),
                      ],
                     )
                    ],
                  ),
                 )

Your Screen Look like this -> Output Image

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.