|
1 | 1 | import 'dart:async'; |
| 2 | +import 'package:flutter/foundation.dart'; |
2 | 3 | import 'package:flutter/material.dart'; |
3 | 4 | import 'package:flutter_webrtc/flutter_webrtc.dart'; |
| 5 | +import 'package:flutter_dtmf/flutter_dtmf.dart'; |
4 | 6 |
|
5 | 7 | import 'widgets/action_button.dart'; |
6 | 8 | import 'package:sip_ua/sip_ua.dart'; |
@@ -270,6 +272,9 @@ class _MyCallScreenWidget extends State<CallScreenWidget> |
270 | 272 |
|
271 | 273 | void _handleDtmf(String tone) { |
272 | 274 | print('Dtmf tone => $tone'); |
| 275 | + if (WebRTC.platformIsMobile) { |
| 276 | + FlutterDtmf.playTone(digits: tone); |
| 277 | + } |
273 | 278 | call.sendDTMF(tone); |
274 | 279 | } |
275 | 280 |
|
@@ -485,41 +490,40 @@ class _MyCallScreenWidget extends State<CallScreenWidget> |
485 | 490 | } |
486 | 491 |
|
487 | 492 | stackWidgets.addAll([ |
488 | | - Positioned( |
489 | | - top: voiceonly ? 48 : 6, |
490 | | - left: 0, |
491 | | - right: 0, |
492 | | - child: Center( |
493 | | - child: Column( |
494 | | - crossAxisAlignment: CrossAxisAlignment.center, |
495 | | - mainAxisAlignment: MainAxisAlignment.center, |
496 | | - children: <Widget>[ |
497 | | - Center( |
498 | | - child: Padding( |
499 | | - padding: const EdgeInsets.all(6), |
500 | | - child: Text( |
501 | | - (voiceonly ? 'VOICE CALL' : 'VIDEO CALL') + |
502 | | - (_hold |
503 | | - ? ' PAUSED BY ${this._holdOriginator.toUpperCase()}' |
504 | | - : ''), |
505 | | - style: TextStyle(fontSize: 24, color: Colors.black54), |
506 | | - ))), |
507 | | - Center( |
508 | | - child: Padding( |
509 | | - padding: const EdgeInsets.all(6), |
510 | | - child: Text( |
511 | | - '$remote_identity', |
512 | | - style: TextStyle(fontSize: 18, color: Colors.black54), |
513 | | - ))), |
514 | | - Center( |
515 | | - child: Padding( |
516 | | - padding: const EdgeInsets.all(6), |
517 | | - child: Text(_timeLabel, |
518 | | - style: |
519 | | - TextStyle(fontSize: 14, color: Colors.black54)))) |
520 | | - ], |
521 | | - )), |
522 | | - ), |
| 493 | + Positioned( |
| 494 | + top: voiceonly ? 48 : 6, |
| 495 | + left: 0, |
| 496 | + right: 0, |
| 497 | + child: Center( |
| 498 | + child: Column( |
| 499 | + crossAxisAlignment: CrossAxisAlignment.center, |
| 500 | + mainAxisAlignment: MainAxisAlignment.center, |
| 501 | + children: <Widget>[ |
| 502 | + Center( |
| 503 | + child: Padding( |
| 504 | + padding: const EdgeInsets.all(6), |
| 505 | + child: Text( |
| 506 | + (voiceonly ? 'VOICE CALL' : 'VIDEO CALL') + |
| 507 | + (_hold |
| 508 | + ? ' PAUSED BY ${this._holdOriginator.toUpperCase()}' |
| 509 | + : ''), |
| 510 | + style: TextStyle(fontSize: 24, color: Colors.black54), |
| 511 | + ))), |
| 512 | + Center( |
| 513 | + child: Padding( |
| 514 | + padding: const EdgeInsets.all(6), |
| 515 | + child: Text( |
| 516 | + '$remote_identity', |
| 517 | + style: TextStyle(fontSize: 18, color: Colors.black54), |
| 518 | + ))), |
| 519 | + Center( |
| 520 | + child: Padding( |
| 521 | + padding: const EdgeInsets.all(6), |
| 522 | + child: Text(_timeLabel, |
| 523 | + style: TextStyle(fontSize: 14, color: Colors.black54)))) |
| 524 | + ], |
| 525 | + )), |
| 526 | + ), |
523 | 527 | ]); |
524 | 528 |
|
525 | 529 | return Stack( |
|
0 commit comments