Skip to content

Instantly share code, notes, and snippets.

@esouthren
Created May 3, 2023 14:07
Show Gist options
  • Save esouthren/bef6b05ab0da733c485bc6794c43a883 to your computer and use it in GitHub Desktop.
Save esouthren/bef6b05ab0da733c485bc6794c43a883 to your computer and use it in GitHub Desktop.
Chip
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData().copyWith(
scaffoldBackgroundColor: darkBlue,
useMaterial3: true,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Chip(
label: const Text('hello world!'),
deleteIcon: const Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onDeleted: () {},
// This is the default in Material 3 anyway,
// but can be added if using Material 2.
side: BorderSide.none,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment