chip_emails 1.0.0
chip_emails: ^1.0.0 copied to clipboard
A high-performance, professional email input widget for Flutter with intelligent chip management and batch parsing.
import 'package:chip_emails/chip_emails.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Chip Email',
debugShowCheckedModeBanner: false,
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF0F172A)),
),
home: const ProfessionalDemoPage(),
);
}
}
class ProfessionalDemoPage extends StatelessWidget {
const ProfessionalDemoPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFF1F5F9),
appBar: AppBar(
title: const Text("Chip Email",
style: TextStyle(fontWeight: FontWeight.w700)),
centerTitle: true,
backgroundColor: Colors.white,
elevation: 0.5,
),
body: Center(
child: SingleChildScrollView(
padding: const EdgeInsets.all(32.0),
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 600),
child: Card(
color: Colors.white,
elevation: 4,
shadowColor: Colors.black12,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)),
child: Padding(
padding: const EdgeInsets.all(40.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"CHIP EMAIL",
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w900,
color: Color(0xFF64748B),
letterSpacing: 2.0,
),
),
const SizedBox(height: 20),
// Professional Implementation
EmailChipInput(
decoration: InputDecoration(
hintText: "Enter email addresses or paste lists...",
prefixIcon: const Icon(Icons.mail_outline,
size: 18, color: Color(0xFF64748B)),
contentPadding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 18),
filled: true,
fillColor: const Color(0xFFF8FAFC),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide:
const BorderSide(color: Color(0xFFE2E8F0)),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide:
const BorderSide(color: Color(0xFFE2E8F0)),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Color(0xFF0F172A), width: 1.5),
),
helperText:
"Supports individual entry and bulk clipboard extraction.",
helperStyle: const TextStyle(
color: Color(0xFF94A3B8), fontSize: 11),
),
),
const SizedBox(height: 48),
SizedBox(
width: double.infinity,
child: FilledButton(
onPressed: () {},
style: FilledButton.styleFrom(
backgroundColor: const Color(0xFF0F172A),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
padding: const EdgeInsets.symmetric(vertical: 20),
),
child: const Text("Finalize Recipients",
style: TextStyle(
fontWeight: FontWeight.bold,
letterSpacing: 0.5)),
),
),
],
),
),
),
),
),
),
);
}
}