show dbs
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
| // app/plugins/api.ts | |
| import { appendResponseHeader } from 'h3'; | |
| import { parseCookie, parseSetCookie, stringifyCookie } from 'cookie'; | |
| export default defineNuxtPlugin(() => { | |
| const event = import.meta.server ? useRequestEvent() : undefined; | |
| // During SSR, we parse the initial browser cookies. During the request lifecycle, | |
| // we update this object with new cookies from backend responses (e.g. after a token refresh). | |
| const cookies = import.meta.server && event ? parseCookie(event.node.req.headers.cookie ?? '') : {}; |
A quick cheatsheet of useful snippet for Flutter
A widget is the basic type of controller in Flutter Material.
There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.
StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like: