Use ElevatedButton instead of RaisedButton

multipeer_ios
Prerak Mann 3 years ago
parent 6039334d48
commit 06cba84c13

@ -53,7 +53,7 @@ class _MyBodyState extends State<Body> {
), ),
Wrap( Wrap(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
child: Text("checkLocationPermission"), child: Text("checkLocationPermission"),
onPressed: () async { onPressed: () async {
if (await Nearby().checkLocationPermission()) { if (await Nearby().checkLocationPermission()) {
@ -66,7 +66,7 @@ class _MyBodyState extends State<Body> {
} }
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("askLocationPermission"), child: Text("askLocationPermission"),
onPressed: () async { onPressed: () async {
if (await Nearby().askLocationPermission()) { if (await Nearby().askLocationPermission()) {
@ -79,7 +79,7 @@ class _MyBodyState extends State<Body> {
} }
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("checkExternalStoragePermission"), child: Text("checkExternalStoragePermission"),
onPressed: () async { onPressed: () async {
if (await Nearby().checkExternalStoragePermission()) { if (await Nearby().checkExternalStoragePermission()) {
@ -93,7 +93,7 @@ class _MyBodyState extends State<Body> {
} }
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("askExternalStoragePermission"), child: Text("askExternalStoragePermission"),
onPressed: () { onPressed: () {
Nearby().askExternalStoragePermission(); Nearby().askExternalStoragePermission();
@ -105,7 +105,7 @@ class _MyBodyState extends State<Body> {
Text("Location Enabled"), Text("Location Enabled"),
Wrap( Wrap(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
child: Text("checkLocationEnabled"), child: Text("checkLocationEnabled"),
onPressed: () async { onPressed: () async {
if (await Nearby().checkLocationEnabled()) { if (await Nearby().checkLocationEnabled()) {
@ -117,7 +117,7 @@ class _MyBodyState extends State<Body> {
} }
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("enableLocationServices"), child: Text("enableLocationServices"),
onPressed: () async { onPressed: () async {
if (await Nearby().enableLocationServices()) { if (await Nearby().enableLocationServices()) {
@ -136,7 +136,7 @@ class _MyBodyState extends State<Body> {
Text("User Name: " + userName), Text("User Name: " + userName),
Wrap( Wrap(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
child: Text("Start Advertising"), child: Text("Start Advertising"),
onPressed: () async { onPressed: () async {
try { try {
@ -161,7 +161,7 @@ class _MyBodyState extends State<Body> {
} }
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("Stop Advertising"), child: Text("Stop Advertising"),
onPressed: () async { onPressed: () async {
await Nearby().stopAdvertising(); await Nearby().stopAdvertising();
@ -171,7 +171,7 @@ class _MyBodyState extends State<Body> {
), ),
Wrap( Wrap(
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
child: Text("Start Discovery"), child: Text("Start Discovery"),
onPressed: () async { onPressed: () async {
try { try {
@ -189,7 +189,7 @@ class _MyBodyState extends State<Body> {
Text("id: " + id), Text("id: " + id),
Text("Name: " + name), Text("Name: " + name),
Text("ServiceId: " + serviceId), Text("ServiceId: " + serviceId),
RaisedButton( ElevatedButton(
child: Text("Request Connection"), child: Text("Request Connection"),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -229,7 +229,7 @@ class _MyBodyState extends State<Body> {
} }
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("Stop Discovery"), child: Text("Stop Discovery"),
onPressed: () async { onPressed: () async {
await Nearby().stopDiscovery(); await Nearby().stopDiscovery();
@ -238,7 +238,7 @@ class _MyBodyState extends State<Body> {
], ],
), ),
Text("Number of connected devices: ${endpointMap.length}"), Text("Number of connected devices: ${endpointMap.length}"),
RaisedButton( ElevatedButton(
child: Text("Stop All Endpoints"), child: Text("Stop All Endpoints"),
onPressed: () async { onPressed: () async {
await Nearby().stopAllEndpoints(); await Nearby().stopAllEndpoints();
@ -251,7 +251,7 @@ class _MyBodyState extends State<Body> {
Text( Text(
"Sending Data", "Sending Data",
), ),
RaisedButton( ElevatedButton(
child: Text("Send Random Bytes Payload"), child: Text("Send Random Bytes Payload"),
onPressed: () async { onPressed: () async {
endpointMap.forEach((key, value) { endpointMap.forEach((key, value) {
@ -263,7 +263,7 @@ class _MyBodyState extends State<Body> {
}); });
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("Send File Payload"), child: Text("Send File Payload"),
onPressed: () async { onPressed: () async {
PickedFile file = PickedFile file =
@ -308,7 +308,7 @@ class _MyBodyState extends State<Body> {
Text("Token: " + info.authenticationToken), Text("Token: " + info.authenticationToken),
Text("Name" + info.endpointName), Text("Name" + info.endpointName),
Text("Incoming: " + info.isIncomingConnection.toString()), Text("Incoming: " + info.isIncomingConnection.toString()),
RaisedButton( ElevatedButton(
child: Text("Accept Connection"), child: Text("Accept Connection"),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -371,7 +371,7 @@ class _MyBodyState extends State<Body> {
); );
}, },
), ),
RaisedButton( ElevatedButton(
child: Text("Reject Connection"), child: Text("Reject Connection"),
onPressed: () async { onPressed: () async {
Navigator.pop(context); Navigator.pop(context);

Loading…
Cancel
Save