Skip to content

Commit 67b2e21

Browse files
authored
Fix example (#166)
* example: Sort imports. * example: Remove space. * example: Use ElevatedButton instead of RaisedButton. * example: Lint.
1 parent d1c483e commit 67b2e21

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

example/lib/main.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import 'dart:async';
22
import 'dart:io';
33

4+
import 'package:callkeep/callkeep.dart';
45
import 'package:firebase_messaging/firebase_messaging.dart';
56
import 'package:flutter/material.dart';
6-
7-
import 'package:callkeep/callkeep.dart';
87
import 'package:uuid/uuid.dart';
98

109
/// For fcm background message handler.
@@ -16,7 +15,7 @@ bool _callKeepInited = false;
1615
"uuid": "xxxxx-xxxxx-xxxxx-xxxxx",
1716
"caller_id": "+8618612345678",
1817
"caller_name": "hello",
19-
"caller_id_type": "number",
18+
"caller_id_type": "number",
2019
"has_video": false,
2120
2221
"extra": {
@@ -377,25 +376,25 @@ class _MyAppState extends State<HomePage> {
377376
Row(
378377
mainAxisAlignment: MainAxisAlignment.center,
379378
children: <Widget>[
380-
RaisedButton(
379+
ElevatedButton(
381380
onPressed: () async {
382381
setOnHold(item.key, !item.value.held);
383382
},
384383
child: Text(item.value.held ? 'Unhold' : 'Hold'),
385384
),
386-
RaisedButton(
385+
ElevatedButton(
387386
onPressed: () async {
388387
updateDisplay(item.key);
389388
},
390389
child: const Text('Display'),
391390
),
392-
RaisedButton(
391+
ElevatedButton(
393392
onPressed: () async {
394393
setMutedCall(item.key, !item.value.muted);
395394
},
396395
child: Text(item.value.muted ? 'Unmute' : 'Mute'),
397396
),
398-
RaisedButton(
397+
ElevatedButton(
399398
onPressed: () async {
400399
hangup(item.key);
401400
},
@@ -418,13 +417,13 @@ class _MyAppState extends State<HomePage> {
418417
child: Column(
419418
mainAxisAlignment: MainAxisAlignment.start,
420419
children: [
421-
RaisedButton(
420+
ElevatedButton(
422421
onPressed: () async {
423422
displayIncomingCall('10086');
424423
},
425424
child: const Text('Display incoming call now'),
426425
),
427-
RaisedButton(
426+
ElevatedButton(
428427
onPressed: () async {
429428
displayIncomingCallDelayed('10086');
430429
},

example/test/widget_test.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
// tree, read text, and verify that the values of widget properties are correct.
77

88
import 'package:flutter/material.dart';
9-
import 'package:flutter_test/flutter_test.dart';
10-
119
import 'package:flutter_callkeep_example/main.dart';
10+
import 'package:flutter_test/flutter_test.dart';
1211

1312
void main() {
1413
testWidgets('Verify Platform version', (WidgetTester tester) async {
@@ -18,8 +17,8 @@ void main() {
1817
// Verify that platform version is retrieved.
1918
expect(
2019
find.byWidgetPredicate(
21-
(Widget widget) => widget is Text &&
22-
widget.data.startsWith('Running on:'),
20+
(Widget widget) =>
21+
widget is Text && widget.data.startsWith('Running on:'),
2322
),
2423
findsOneWidget,
2524
);

0 commit comments

Comments
 (0)