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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
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'; | |
extension PaddingExtensions on Widget { | |
Widget horizontalListPadding({ | |
@required int index, | |
@required int listLength, | |
double spacingFirstItem = 16, | |
double spacingLastItem = 16, | |
double spaceBetweenItems = 16, | |
}) { |
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 'dart:ui' as ui; | |
import 'dart:io'; | |
class DeviceInfo { | |
static double devicePixelRatio = ui.window.devicePixelRatio; | |
static ui.Size size = ui.window.physicalSize; | |
static double width = size.width; | |
static double height = size.height; | |
static double screenWidth = width / devicePixelRatio; | |
static double screenHeight = height / devicePixelRatio; |
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 'dart:io'; | |
import 'package:device_info/device_info.dart'; //https://pub.dev/packages/device_info | |
class DeviceInfo { | |
Future<String> get deviceModel async { | |
final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); | |
if (Platform.isAndroid) { | |
final AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; | |
final String manufacturer = androidInfo.manufacturer; |
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:package_info/package_info.dart'; //https://pub.dev/packages/package_info | |
class AppInfo { | |
Future<String> get version async { | |
final PackageInfo packageInfo = await PackageInfo.fromPlatform(); | |
return packageInfo.version ?? 'Unknown Version'; // 1.2.7 | |
} | |
Future<String> get buildNumber async { |
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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH |
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 interceptor is simplified because is doesn't contemplate | |
/// a refresh token, which you should take care of. | |
/// I haven't tested this code, but I believe it should work. | |
/// If you have some feedback, please leave a comment and I'll review it :) Thanks. | |
class AuthInterceptor extends InterceptorsWrapper { | |
final Dio loggedDio; | |
final Dio tokenDio; |
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
{ | |
"terminal.integrated.shell.osx": "/bin/zsh", | |
"workbench.colorTheme": "Dracula Pro", | |
"workbench.iconTheme": "vscode-icons", | |
"workbench.startupEditor": "newUntitledFile", | |
"terminal.integrated.rendererType": "dom", | |
"terminal.integrated.fontFamily": "Fira Code", | |
"editor.fontFamily": "Fira Code", | |
"editor.fontLigatures": true, | |
"window.title": "${activeEditorLong}${separator}${rootName}", |