Created
October 3, 2020 16:34
-
-
Save CoderJava/631e04b4534d3f40978821480cbce3ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
| class ActionChipExample extends StatelessWidget { | |
| final scaffoldState = GlobalKey<ScaffoldState>(); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| key: scaffoldState, | |
| appBar: AppBar( | |
| title: Text( | |
| 'Action Chip', | |
| ), | |
| ), | |
| body: Center( | |
| child: ActionChip( | |
| label: Text('Start Download'), | |
| onPressed: () { | |
| scaffoldState.currentState.showSnackBar(SnackBar(content: Text('Start downloading...'))); | |
| }, | |
| avatar: CircleAvatar( | |
| child: Icon(Icons.download_rounded, size: 16,), | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment