Hi
I just installed Felgo and am going through the first example code on navigation from one page to another.
I followed the example code but there is an error.
Page 1:
App {
NavigationStack {
id:page
Page {
title: qsTr("Page 1")
AppText {
id: myText
text: "Welcome to Felgo"
//anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
}
AppImage {
anchors.horizontalCenter: myText.horizontalCenter
anchors.bottom: myText.top
source: "../assets/felgo-logo.png"
}
AppButton{
anchors.horizontalCenter: parent.horizontalCenter
text: "Page 2"
onClicked: {
page.navigationStack.push(Qt.resolvedUrl("DetailPage.qml"))
// NavigationStack.push((Qt.resolvedUrl("DetailPage.qml")))
}
}
}
}
}
Page 2:
Page {
id:page
title: "Detail Page"
AppText {
text: "Second Page"
anchors.centerIn: parent
}
}
I cant seem to navigate to the second page.
I tried
page.NavigationStack.push and NavigationStack.push
The error log is this:
file:///C:/…./Felgo Live Client/AppPlayground/qml/Main.qml:31: TypeError: Cannot call method ‘push’ of undefined
Please let me know how to resolve this issue.
Thanks!