FilledStacks / flutter-tutorials

The repo contains the source code for all the tutorials on the FilledStacks Youtube channel.
MIT License
4.75k stars 1.76k forks source link

Layout Templates for Flutter Web error in NavigationService goBack #51

Closed alanlopcu closed 4 years ago

alanlopcu commented 4 years ago

Hello. Thanks for your videos. The function goBack class NavigationService in project Layout Templates for Flutter Web (part 3) I'm getting an error that says:

{
    "resource": ".../flutter-tutorials/037-advanced-web-navigation/00-starting/lib/services/navigation_service.dart",
    "owner": "dart",
    "code": "return_of_invalid_type",
    "severity": 8,
    "message": "A value of type 'void' can't be returned from method 'goBack' because it has a return type of 'bool'.",
    "source": "dart",
    "startLineNumber": 11,
    "startColumn": 12,
    "endLineNumber": 11,
    "endColumn": 43,
    "tags": []
}

Can you please tell me why this is going on? Thank you in advance.

FilledStacks commented 4 years ago

You can’t return a void when the function says it’ll return a bool.

Either change the function signature to return a void or remove the return keyword infront of the pop call. OR both.

Regards, Dane Mackier

From: Alvaro Andrés Lópezmailto:notifications@github.com Sent: Wednesday, 25 March 2020 20:04 To: FilledStacks/flutter-tutorialsmailto:flutter-tutorials@noreply.github.com Cc: Subscribedmailto:subscribed@noreply.github.com Subject: [FilledStacks/flutter-tutorials] Layout Templates for Flutter Web error in NavigationService goBack (#51)

Hello. Thanks for your videos. The function goBack class NavigationService in project Layout Templates for Flutter Web (part 3) I'm getting an error that says:

{

    "resource": ".../flutter-tutorials/037-advanced-web-navigation/00-starting/lib/services/navigation_service.dart",

    "owner": "dart",

    "code": "return_of_invalid_type",

    "severity": 8,

    "message": "A value of type 'void' can't be returned from method 'goBack' because it has a return type of 'bool'.",

    "source": "dart",

    "startLineNumber": 11,

    "startColumn": 12,

    "endLineNumber": 11,

    "endColumn": 43,

    "tags": []

}

Can you please tell me why this is going on? Thank you in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/FilledStacks/flutter-tutorials/issues/51, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA3M72TLXAHPKUPDT7GXOU3RJJBT7ANCNFSM4LTUUVCQ.