How to navigate from native iOS Widget to specific screen in Flutter app


So Im building a flutter app, where I want iOS Widgets.

For that I built a simple Widget with WidgetKit in Swift

import WidgetKit
import SwiftUI

struct MediumWorkout: View {
    
    var entry: TrainingEntry
    
    var body: some View {
                
        // I tried replacing the interval_timer with intervaltimer - the interval timer thing comes from my pubspec.yaml, its the name of my app
        Link(destination: URL(string: "interval_timer://profile")!) {
             Text(intervalString)
       }
    }
}

But Im not able to navigate from the Widget, to the specific destination in my flutter app. The widget just routes to my initial route “workouts”

  initialRoute: '/workouts',
  routes: {
    '/workouts': (context) => const Home(screenIndex: 0),
    '/jumpin': (context) => const Home(screenIndex: 1),
    '/profile': (context) => const Home(screenIndex: 2),
  },

even though I want it to navigate to the profile section.

I guessed that its maybe because my routing in flutter isnt compatible with the swift one. Has anyone done this before & how can I solve the problem

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img