Skip to content

Instantly share code, notes, and snippets.

View vincevargadev's full-sized avatar
:shipit:
Ship it!

Vince Varga vincevargadev

:shipit:
Ship it!
View GitHub Profile
@vincevargadev
vincevargadev / f.dart
Created September 4, 2024 15:54
Dart firstThatResolves
import 'dart:async';
extension FutureX<T> on Future<T> {
/// This function accepts two functions returning a future,
/// and returns whichever function resolves successfully first.
///
/// Can be used in case one of the functions may fail
/// even under normal circumstances as long as the other succeeds
/// (so at least one of them should succeed).
///
@vincevargadev
vincevargadev / main.dart
Last active February 7, 2021 20:40
Simple 3-dot popup menu in the app bar in Flutter
// This gist is part of the https://github.com/dartsidedev/gists repository.
// There, you'll find further information about this gist.
// https://github.com/dartsidedev/gists#3cd82881966c0e1314504e4e2e54e373
import 'package:flutter/material.dart';
void main() => runApp(PopupDemo());
class PopupDemo extends StatefulWidget {
@override
@vincevargadev
vincevargadev / main.dart
Last active February 6, 2021 20:12
Flutter SnackBar layout demos
// This gist is part of the https://github.com/dartsidedev/gists repository.
// There, you'll find further information about this gist.
// https://github.com/dartsidedev/gists#5e2a8558d496fecd518b7846ba5995b7
import 'package:flutter/material.dart';
void main() => runApp(App());
class App extends StatelessWidget {
@override
@vincevargadev
vincevargadev / main.dart
Last active February 6, 2021 12:31
DartPad test - Flutter
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@vincevargadev
vincevargadev / main.dart
Created February 6, 2021 12:26
DartPad test - Dart
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}
@vincevargadev
vincevargadev / i-have-no-idea-what-i-am-doing.sh
Last active December 27, 2021 20:34
Fix all Flutter issues ever!
rm -f ios/Podfile ios/Podfile.lock pubspec.lock && rm -rf ios/Runner.xcworkspace/xcshareddata/ &&
flutter clean &&
flutter pub cache repair &&
rm -f ios/Podfile ios/Podfile.lock pubspec.lock &&
flutter pub get &&
flutter pub run build_runner clean
@vincevargadev
vincevargadev / main.dart
Created December 4, 2019 22:14
I tried out the new DartPad!
import 'dart:math' as math;
import 'package:flutter/material.dart';
final dscTeam = [
{
'name': 'Viviana Sutedjo',
'nickName': 'Vivi',
'color': getRandomColor(),
},
@vincevargadev
vincevargadev / main.dart
Last active July 14, 2020 00:04 — forked from bitsydarel/switching theme without any library.
switching theme without any library.
void main() {
runApp(_SwitchingThemeApp());
}
/// Properties that help me keep track of the example being run.
bool _useMaterial = false;
class _SwitchingThemeApp extends StatefulWidget {
@override
_SwitchingThemeAppState createState() => _SwitchingThemeAppState();
@vincevargadev
vincevargadev / in-console.js
Last active January 28, 2020 21:14
Get first and last names from meetup event
/**
* HOW TO USE IT
* Go the your event, then select attendee list.
* Make sure you are on the "Going" tab.
*/
const $attendees = Array.from(document.querySelectorAll('h4.text--ellipsisOneLine'));
// Sorted names.
// Start with long names, then leave the names with no spaces to the end.