package Ġcom . adr sh . flutter _ deep _ speech Ċ Ċ import Ġio . flutter . embedding . engine . plugins . Flutter Plugin Ċ import Ġio . flutter . embedding . engine . plugins . activity . Activity Aware Ċ import Ġio . flutter . embedding . engine . plugins . activity . Activity Plugin Binding Ċ import Ġio . flutter . plugin . common . Event Channel Ċ import Ġio . flutter . plugin . common . Event Channel . Event Sink Ċ import Ġio . flutter . plugin . common . Event Channel . Stream Handler Ċ import Ġio . flutter . plugin . common . MethodCall Ċ import Ġio . flutter . plugin . common . Method Channel Ċ import Ġio . flutter . plugin . common . Method Channel . MethodCall Handler Ċ import Ġio . flutter . plugin . common . Method Channel . Result Ċ Ċ class ĠFlutter Deep Speech Plugin Ġ: ĠFlutter Plugin , ĠMethod Call Handler , ĠActivity Aware , ĠStream Handler Ġ{ ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġmethod Channel : ĠMethod Channel ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġlisten Event Channel : ĠEvent Channel ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġdeep Speech Service : ĠDeep Speech Service ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġpermissions Handler : ĠPermissions Handler ĊĊĠĠĠ Ġoverride Ġfun Ġon Attached To Engine ( flutter Plugin Binding : ĠFlutter Plugin . Flutter Plugin Binding ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpermissions Handler Ġ= ĠPermissions Handler () ĊĠĠĠĠĠĠĠ Ġpermissions Handler . context Ġ= Ġflutter Plugin Binding . application Context ĊĊĠĠĠĠĠĠĠ Ġdeep Speech Service Ġ= ĠDeep Speech Service () ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . context Ġ= Ġflutter Plugin Binding . application Context ĊĊĠĠĠĠĠĠĠ Ġmethod Channel Ġ= ĠMethod Channel ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġflutter Plugin Binding . binary Messenger , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" adr sh / flutter _ deep _ speech " ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġmethod Channel . set MethodCall Handler ( this ) ĊĊĠĠĠĠĠĠĠ Ġlisten Event Channel Ġ= ĠEvent Channel ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġflutter Plugin Binding . binary Messenger , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" adr sh / flutter _ deep _ speech / listen " ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġlisten Event Channel . set Stream Handler ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Detached From Engine ( binding : ĠFlutter Plugin . Flutter Plugin Binding ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmethod Channel . set MethodCall Handler ( null ) ĊĠĠĠĠĠĠĠ Ġlisten Event Channel . set Stream Handler ( null ) ĊĠĠĠĠĠĠĠ Ġpermissions Handler . dispose () ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . dispose () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Attached To Activity ( binding : ĠActivity Plugin Binding ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . activity Ġ= Ġbinding . activity ĊĠĠĠĠĠĠĠ Ġpermissions Handler . activity Ġ= Ġbinding . activity ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Detached From Activity () Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . activity Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġpermissions Handler . activity Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Re attached To Activity For Config Changes ( binding : ĠActivity Plugin Binding ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . activity Ġ= Ġbinding . activity ĊĠĠĠĠĠĠĠ Ġpermissions Handler . activity Ġ= Ġbinding . activity ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Detached From Activity For Config Changes () Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . activity Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġpermissions Handler . activity Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Listen ( o : ĠAny ?, Ġsink : ĠEvent Sink ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . listen Event Sink Ġ= Ġsink ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Cancel ( o : ĠAny ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . listen Event Sink Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon MethodCall ( call : ĠMethod Call , Ġresult : ĠResult ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdeep Speech Service . result Ġ= Ġresult ĊĠĠĠĠĠĠĠ Ġwhen Ġ( call . method ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" load Model FromName " Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġmodel Name Ġ= Ġcall . argument < String >(" model Name ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsc orer Name Ġ= Ġcall . argument < String >(" sc orer Name ") ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( model Name . isNull Or Blank () Ġ|| Ġsc orer Name . isNull Or Blank ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresult . success ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdeep Speech Service . load Model FromName ( model Name , Ġsc orer Name ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" request Mic Permission " Ġ-> Ġpermissions Handler . request Mic Permission ( result ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" listen " Ġ-> Ġdeep Speech Service . listen () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" stop " Ġ-> Ġdeep Speech Service . stop () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" dispose " Ġ-> Ġdeep Speech Service . dispose () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġresult . not Implemented () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }