Created
May 3, 2023 14:07
-
-
Save esouthren/bef6b05ab0da733c485bc6794c43a883 to your computer and use it in GitHub Desktop.
Chip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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