# Project Setup
task-master init # Initialize Task Master in current project
task-master parse-prd .taskmaster/docs/prd.txt # Generate tasks from PRD document
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:time_tracker_flutter_course/app/home/tab_item.dart'; | |
class CupertinoHomeScaffold extends StatelessWidget { | |
// final TabItem currentTab; | |
// final ValueChanged<TabItem> onSelectTab; | |
final Map<TabItem, WidgetBuilder> widgetBuilders; | |
const CupertinoHomeScaffold({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:time_tracker_flutter_course/app/home/cupertino_home_scaffold.dart'; | |
import 'package:time_tracker_flutter_course/app/home/tab_item.dart'; | |
import 'jobs/jobs_page.dart'; | |
// ? would this be a good place to put a riverpod database provider? Would it be globally available? | |
class HomePage extends StatefulWidget { | |
@override |
Manage the subscription state using localStorage, IndexedDB, or a server-side solution(e.g. in Firestore, store per-user), depending on the flow of your app.
Create a notification section in settings, in navbar or just prompt it directly(not recommended, bad UX).
On UI interaction such as a subscribe
button, call subscribeNotifications
with the related parameters(subscribe = true/false, token
), then persist the notification state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const messaging = firebase.messaging(); | |
messaging.usePublicVapidKey(YOUR_PUBLIC_VAPID_KEY_HERE); | |
messaging.onTokenRefresh(() => { | |
messaging.getToken().then(async token => { | |
const subscribeNotifications = firebase.functions().httpsCallable('subscribeNotifications'); | |
await subscribeNotifications({ token }); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ! also set ```asar: false``` in electron build process. | |
const path = require('path') | |
const electron = require('electron'); | |
/* path to the HandbrakeCLI executable downloaded by the install script */ | |
let HandbrakeCLIPath = null | |
switch (process.platform) { | |
case 'darwin': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the firebase script called to create each user. | |
exports.createUser = functions.https.onCall((data) => { | |
const user = data.user[0] | |
let displayName = `${user.firstName} ${user.lastName}` | |
return admin.auth().createUser({ | |
displayName: displayName, | |
email: user.email, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I use this js function inside ManageUsers.vue. It maps through an array of user data (jsonData) to call the createUser httpsCallable function. | |
async createNewUsers () { | |
this.loadingNewUsers = true | |
var createUser = this.$fb.functions().httpsCallable('createUser') | |
let promises = this.jsonData.map(person => { | |
// I use quasar uid to create an initial password: https://quasar.dev/quasar-utils/other-utils#Generate-UID | |
person.password = uid() | |
let jsonDatum = [] | |
jsonDatum.push(person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
... | |
<my-uploader | |
flat | |
color="grey-3" | |
text-color="grey-10" | |
style="min-width: 418px" | |
@uploaded="videoUploaded" | |
@failed="videoUploadFailed" | |
:pathPrefix="`${currentUser.uid}/videos`" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adapted from https://github.com/quasarframework/quasar/issues/3428 | |
import { QUploaderBase } from 'quasar' | |
import _ from 'lodash' | |
export default { | |
name: 'toStorage', | |
props: { | |
pathPrefix: { | |
type: String, |
NewerOlder