nice_wrappable_tags 0.0.2 nice_wrappable_tags: ^0.0.2 copied to clipboard
It is a tag that can be wrapped according to the size of the device when several tags are listed.
import 'package:flutter/material.dart';
import 'package:nice_wrappable_tags/nice_wrappable_tags.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'nice_wrappable_tags',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
static const List<String> tags = [
'developer',
'ios',
'flutter',
'android',
'React Native',
'java'
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: NiceWrappableTags(
onTap: (index) {
print('${index} tapped');
},
tagTitles: tags,
boxDecoration: BoxDecoration(borderRadius: BorderRadius.circular(20)),
),
),
);
}
}