flutter-webrtc / flutter-webrtc-demo

Demo for flutter-webrtc
MIT License
1.15k stars 417 forks source link

FlatButton is now deprecated and should be replaced with TextButton #185

Closed MayurSMahajan closed 2 years ago

MayurSMahajan commented 2 years ago

Use TextButton instead of FlatButton

This is a snippet from Flutter official documentation: (https://api.flutter.dev/flutter/material/FlatButton-class.html)

FlatButton and RaisedButton have been replaced by TextButton and ElevatedButton respectively. ButtonTheme has been replaced by TextButtonTheme and ElevatedButtonTheme. The original classes will eventually be removed, please migrate code that uses them. There's a detailed migration guide for the new button and button theme classes in flutter.dev/go/material-button-migration-guide.

Currently in the main.dart, FlatButtons are used

FlatButton( child: const Text('CANCEL'), onPressed: () { Navigator.pop(context, DialogDemoAction.cancel); }), FlatButton( child: const Text('CONNECT'), onPressed: () { Navigator.pop(context, DialogDemoAction.connect); })

If not replaced from this project, they might produce an error.