Code Monkey home page Code Monkey logo

niira's Introduction

niira

plus ultra

Coverage Status CI

Setup

  • get google maps api key
  • get added to firebase project
  • get some juice

Integration Tests

flutter drive --target=test_driver/app.dart

niira's People

Contributors

tamari-gray avatar nickmeinhold avatar t-davis avatar

Stargazers

 avatar Dylan Tonks avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

niira's Issues

player create game 2 - edit game settings

#observe crete game 2 screen
lobby

  • map gets user location and zooms in automatically
  • place default boundary. 200m radius, center is player position
  • boundary size is 10m increments
  • sonar intervals are 10s increments

create a game - 3 – 1

  • show dialog on click boundary text, (make hyperlink)

create a game - 3 – 2

  • show dialog on click sonar text, (make hyperlink)

Move navigation service out of auth folder

Was looking at #51 and couldn't find NavigationService, found it inside the auth folder - just wanted to move it up to the top level services folder but wanted to do it in a separate PR so the file changes don't get mixed in with #51 and make it a more difficult review. Thanks!

Oh I'm also going to sneak in adding a .vscode/launch.json file if that's cool - it's the file that allows for a button press to start the debugger.

Lobby: player join a game

#observe lobby screen

  • get + listen to created games from firebase
  • redirect to password page => input password to enter game
    • back button to lobby screen
    • form validation
    • route to waiting screen on success

Screen Shot 2020-08-20 at 9 45 28 pm

Setup backend for Google Maps

  • Get an API key at https://cloud.google.com/maps-platform/.
  • Enable Google Map SDK for each platform.
    • Go to Google Developers Console.
    • Choose the project that you want to enable Google Maps on.
    • Select the navigation menu and then select "Google Maps".
    • Select "APIs" under the Google Maps menu.
    • To enable Google Maps for Android, select "Maps SDK for Android" in the "Additional APIs" section, then select "ENABLE".
    • To enable Google Maps for iOS, select "Maps SDK for iOS" in the "Additional APIs" section, then select "ENABLE".
    • Make sure the APIs you enabled are under the "Enabled APIs" section.

Find detailed steps to get start with Google Maps Platform here.

later

  • add API Key to CD in GitHub actions

set up project with firebase

create new firebase project

  • make new email?

Potential subtasks

  • (tamari) create a firebase project
  • (tamari) add nick as a collaborator
  • create an android app and download credentials file
  • create an ios app and download credentials file
  • add credentials files to project and add to .gitignore
    • android
    • ios
  • enable email authentication
  • add note to README on how to add credential files to project

calculate distance between game and user

-requires #56 & #55 & #97, #106 & #108

When navigate to lobby:

  • get users location and pass it to gameTile

  • write fn to calculate distance between user location & game.boundary.position (games location)
    e.g with geolocator package: double distanceInMeters = await Geolocator().distanceBetween(52.2165157, 6.9437819, 52.3546274, 4.8285838);

  • display distance in ui

  • show distance to nearest 100m

  • order list of games from nearest to furtherest away

  • test distance function, is it getting same output as geolocator distance funtion would get?

  • test all widgets

  • unit test distance fn

  • navigate to input password screen via pushnamedroute

player find and join a game - 1

rename widget test files

most test files are just widget_test.dart

rename them to be more specific e.g create_account_widget_test.dart

Move firebase and service initialisation inside runApp

Is your feature request related to a problem? Please describe.
When the debugger is paused, hitting Hot Restart can cause the debugger to hang.

Describe the solution you'd like
I think the issue may be fixed by moving the services into runApp

  • display error message on failure of firebase initialisation

create firestore service for auth screens

##on submit create account form:
- [ ] check if username has been taken
- [ ] show snackbar error msg if has been taken

##on successfull create account:
- [ ] add username to player doc in firestore

define Game model

a game includes:

  • name of game
  • name of creator
  • id
  • location
  • boundary: size, position
  • sonar intervals

navigate between auth screens

navigate between create account and sign in via some state so when we pop after a successfull sign in it will always go back to the original material app

handle auth state changed

  • setup provider to listen to onauthstatechanged stream
  • if logged in observe lobby screen, else: create account screen

Show game creation screen when user clicks new game

observe lobby page & list of games

  • add a 'create game' fab btn -> on tap, navigate to first create game screen
  • add input for name
  • show form validation error if name is taken
    • EDIT: decided not to require uniqueness, just check for length being 1-15
  • add input password field
  • disable next button until all fields are filled in successfully,
  • on "Next" tap, redirect to create game screen 2
  • add a cancel button in appbar -> redirects to lobby

create a game - 2

show waiting screen after player joins a game

observe waiting screen

  • create list of joined players
  • when tagger is chosen, indicate with highlighted player tile
  • create quit button
    • on tap, show are you sure dialog
      • redirect to lobby on tap yes
      • navigator pop on no

player find and join a game - 4
player find and join a game - 5
player find and join a game - 6

sign in with firebase

##call sign in with firebase on submit sign in form

  • sign in to firebase account

  • show snackbar if firebase auth error

  • wait for authstatechanged to redirect to lobby screen

  • test sign in with email & pword fn

  • navigate between welcome screen, sign in, create account, all while having access to authStateStream

    • after navigator.push => go from sign in to create screen, how can still have access to auth stream??

Move mocks folder into test directory

@tamari-gray hey mate, I didn't notice when we were working on this last sorry or I could have discussed it with you then, I suggest that the mocks be moved into the test dir for now and as we need mocks for the integration tests we create them in test_driver - it's a weird one, terrible for code reuse but arguably different enough contexts to have different classes anyway and you get a lot of benefits - the autocomplete will work being the big one I think... what do you reckon? If you agree I'm happy to put up a PR. Thanks!

Figure out async logic on app load

Right now, on app load we need to:

  • initialize firebase (currently done in main() before runApp() which will probably cause longer white screen on load)
  • get permissions (eg. fine location for google maps)

Could be just as simple as -> keep state for completion of async tasks and show a waiting indicator until all async tasks have completed

  • a streambuilder at the top of the widget tree could do this

Some other possibilities off the top of my head:

  • try to avoid a waiting screen that blocks all interaction and just make specific UI unavailable until relevant async task has completed
  • only ask for permission at the time (eg for maps, ask when map is trying to load)

handle user sign out

  • app bar btn
  • pop up to confirm logout
  • firebase logout service
  • redirect to welcome screen on success
  • show notification if error "error signing out, please try again"
  • test

admin start game

quiting game forces all joined players to quit

  • check if user is admin: get game.admin id + authservice.userId => check if same then give user admin privilages

  • create AdminQuitCreatingGame bool in game object

  • make waitingForGameToStartScreen listen to streamOfJoinedGame =>

  • when admin quits, make AdminQuitCreatingGame() fn in database service => sets AdminQuitCreatingGame: true in fb

  • [ ]

  • show start game fab if user is admin

  • if tagger is chosen => confirmation dialog => navigation to playingGame

  • if no tagger is chosen =>pop toast "please choose tagger first"

  • update taggerTile to be light orange color

admin start game – 1
admin start game – 2
admin start game – 3

as a user i want to sign in/ create account frontend

  • make frontend (copy create account widgets)
    • Open the app
    • Observe the create account screen
    • Enter username
    • Enter email
    • Enter password
    • Re-enter password
    • Tap create account Button
    • Observe loading UI
  • make sure navigation between sign up & create account works
  • form validation with success/ error messages
  • show loading icon on form submit

allow getting user location

  • choose a package
  • location service
  • listen to stream and save latest value
  • provide a function that returns a Future with the latest location

welcome screen

  • copy widgets from adobe
  • navigate to sign in screen and create account screen

On InputPasswordScreen completion, show GameSettingsScreen

Add UI:

  • 'drag boundary' text => "move map to reposition boundary"

  • boundary size slider -> sets the boundary size, which updates the boundary on the map

  • sonar intervals slider -> sets the sonar value, shown in slider

  • add a cancel button in app bar -> pops back to Lobby

  • Next fab -> navigates to waitingScreen

  • make user icon size relative to camera zoom

todo:

  • test using gameService as changenotifierProvider and using that as state

create a game - 3

create a game - 3 – 4

choose a licence

youll get another badge, and it will help when people come to fork

On game creation, save settings to database

Was closed in #145

  • grab: match name, password, boundary position, boundary size, sonar intervals
    => put in firebase doc when submit settings
    => observe loading icon before redirect to choose tagger screen

see also:

  • game model #54

clean up test files

lots of files are creating the same mocks/fakes.
to prevent code reuse create a factory class of mock or fake class and store in test_driver/mocks

create confirmation dialog

shows "are you sure" dialog

  • currently there is a confirmation dialog shown on sign out from lobby screen
  • we need a global solution

Allow adding maps to widgets

Android

iOS

  • add Flutter/MapsKey.xcconfig with MAPS_API_KEY=...
  • add to Info.plist
<key>maps_api_key</key>
<string>$(MAPS_API_KEY)</string>
<key>io.flutter.embedded_views_preview</key>
<true/>
  • add to AppDelegate.swift to retrieve the API key and provide it to the Maps
let mapsKey = Bundle.main.infoDictionary?["maps_api_key"] as! String
GMSServices.provideAPIKey(mapsKey)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.