This file contains 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 "dart:convert"; | |
void main() { | |
var rawJson = '{"url":"http://blah.jpg", "id":1}'; | |
var parsedJson = json.decode(rawJson); | |
var imageModel = ImageModel.fromJson(parsedJson); | |
} |
This file contains 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
// method in a widget that inherits stateful widget | |
Future<void> _refreshFoo(BuildContext context) async { | |
// First category: Foo | |
await Provider.of<Foo>(context, listen: false) | |
.fetchFoo(true); | |
//Second category: Bar | |
await Provider.of<Bar>(context, listen: false) | |
.fetchBar(true); | |
} |
This file contains 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 '../constants/store.dart'; | |
import '../model/directions.dart'; | |
class AppInfo extends ChangeNotifier { | |
Directions? userPickupLocation, userDropOffLocation; | |
updatePickupLocationAddress(Directions userPickupAddress) { | |
userPickupLocation = userPickupAddress; |
This file contains 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 '../constants/store.dart'; | |
import '../model/directions.dart'; | |
class AppInfo extends ChangeNotifier { | |
Directions? userPickupLocation, userDropOffLocation; | |
updatePickupLocationAddress(Directions userPickupAddress) { | |
userPickupLocation = userPickupAddress; |
This file contains 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
https://{{url}}/?link=https://{{url}}/?screen=/new-password?PARAMETER=2&apn=com.example.marketplace |
This file contains 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 jwt = require("jsonwebtoken") | |
const User = require("../models/user") | |
const auth = async (req, res, next) => { | |
try { | |
const token = req.header("Authorization").replace("Bearer ", "") | |
const decode = jwt.verify(token, "thisismysecretkey") | |
const user = await User.findOne({ _id: decode._id, "tokens.token": token }) | |
if (!user) { |