This repository was archived by the owner on Feb 25, 2025. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed 
shell/platform/android/io/flutter/embedding/engine/systemchannels Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 99import  io .flutter .Log ;
1010import  io .flutter .embedding .engine .dart .DartExecutor ;
1111import  io .flutter .plugin .common .JSONMethodCodec ;
12+ import  io .flutter .plugin .common .MethodCall ;
1213import  io .flutter .plugin .common .MethodChannel ;
1314
1415/** TODO(mattcarroll): fill in javadoc for NavigationChannel. */ 
@@ -19,8 +20,19 @@ public class NavigationChannel {
1920
2021  public  NavigationChannel (@ NonNull  DartExecutor  dartExecutor ) {
2122    this .channel  = new  MethodChannel (dartExecutor , "flutter/navigation" , JSONMethodCodec .INSTANCE );
23+     channel .setMethodCallHandler (defaultHandler );
2224  }
2325
26+   // Provide a default handler that returns an empty response to any messages 
27+   // on this channel. 
28+   private  final  MethodChannel .MethodCallHandler  defaultHandler  =
29+       new  MethodChannel .MethodCallHandler () {
30+         @ Override 
31+         public  void  onMethodCall (@ NonNull  MethodCall  call , @ NonNull  MethodChannel .Result  result ) {
32+           result .success (null );
33+         }
34+       };
35+ 
2436  public  void  setInitialRoute (@ NonNull  String  initialRoute ) {
2537    Log .v (TAG , "Sending message to set initial route to '"  + initialRoute  + "'" );
2638    channel .invokeMethod ("setInitialRoute" , initialRoute );
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments