Fireship · @fireship

Flutter - Google SignIn from Scratch

Uploaded January 15, 2019 · Length 12:06

Flutter - Google SignIn from Scratch

Summary

Implementing Google sign-in from scratch in Flutter using Firebase and Firestore.

  • flutter google sign in
  • firebase authentication
  • flutter firestore
  • google sign in from scratch
  • firebase mobile app

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:06

    welcome to the first ever flutter video

  3. 0:08

    on this channel today we'll start from

  4. 0:10

    scratch and build a user authentication

  5. 0:12

    system using firebase Google sign-in and

  6. 0:14

    firestore the UI is nothing special but

  7. 0:17

    this video is important because it will

  8. 0:18

    show you how to handle real-time streams

  9. 0:20

    of data from external sources and update

  10. 0:22

    the UI reactively if you're new here

  11. 0:24

    like and subscribe and you can grab the

  12. 0:26

    full source code from fire ship IO I'd

  13. 0:28

    like to start by saying that this video

  14. 0:30

    is intermediate level so if you're brand

  15. 0:32

    new to flutter it might seem a little

  16. 0:33

    overwhelming but don't worry because

  17. 0:34

    next week I have a more gentle

  18. 0:36

    introduction plan that's specifically

  19. 0:37

    for JavaScript and/or typescript

  20. 0:39

    developers who are starting from scratch

  21. 0:41

    so the first thing we'll do is run

  22. 0:43

    flutter create from the command line to

  23. 0:45

    create a new app we can then open up the

  24. 0:47

    app in vs code and we'll have some

  25. 0:48

    configuration to do for the platform's

  26. 0:50

    we want to use in this case we'll only

  27. 0:52

    be setting up Android but the iOS setup

  28. 0:54

    is super easy so feel free to do that if

  29. 0:55

    you're on a Mac from here we'll jump

  30. 0:58

    into the firebase console click on the

  31. 0:59

    Android button and then we'll need to

  32. 1:01

    set a package ID for our project that

  33. 1:03

    should be something like calm you're a

  34. 1:05

    company name followed by the app name so

  35. 1:07

    IO dot fire shipped lesson app in this

  36. 1:10

    case the next thing we want to do is

  37. 1:12

    generate a signing certificate

  38. 1:13

    specifically for Google OAuth we can

  39. 1:16

    generate it by copying and pasting this

  40. 1:17

    command I'll link that in the full

  41. 1:18

    lesson and then going to the terminal

  42. 1:20

    and entering the command I'm not sure if

  43. 1:23

    this is a problem on my end or if the

  44. 1:25

    command is just outdated but it gives me

  45. 1:26

    an error if I try to use export cert and

  46. 1:28

    list together if it works for you then

  47. 1:31

    that's great but if not you'll want to

  48. 1:33

    go in here and take out the list from

  49. 1:35

    the command and then when prompted for a

  50. 1:37

    password type in Android and all

  51. 1:39

    lowercase and finally copy and paste the

  52. 1:41

    same command but this time delete export

  53. 1:43

    cert from it that should give you an

  54. 1:45

    sha-1 certificate that you can just copy

  55. 1:47

    and paste in there and then click the

  56. 1:49

    next step and that will give us our

  57. 1:51

    Google services JSON file we can

  58. 1:53

    download it and save it in the Android

  59. 1:55

    app directory inside of our flutter

  60. 1:57

    project now getting back to vs code

  61. 1:59

    we'll go into that Android directory it