Skip to content

Instantly share code, notes, and snippets.

@CoderJava
Created October 3, 2020 16:34
Show Gist options
  • Select an option

  • Save CoderJava/631e04b4534d3f40978821480cbce3ea to your computer and use it in GitHub Desktop.

Select an option

Save CoderJava/631e04b4534d3f40978821480cbce3ea to your computer and use it in GitHub Desktop.
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