본문 바로가기
mobile/flutter

[flutter] Copy to clipboard on tap. Use ScaffoldMessenger.showSnackBar.

by moonsiri 2021. 8. 17.
728x90
반응형

_key.currentState!.showSnackBar(...) 가 depreated 되면서 Use ScaffoldMessenger.showSnackBar. 라고 안내하고있습니다.

 

AS-IS)

scaffoldKey.currentState.hideCurrentSnackBar();
scaffoldKey.currentState.showSnackBar(SnackBar(content:Text(messages.copied)));

 

TO-BE)

ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content:Text(messages.copied)));

 

 

 

 

 

728x90
반응형

댓글