Skip to content

Instantly share code, notes, and snippets.

View wilburx9's full-sized avatar

Wilberforce Uwadiegwu wilburx9

View GitHub Profile
@wilburx9
wilburx9 / dismissible_handle_dismiss.dart
Last active February 18, 2021 17:30
Handle dismiss action of Flutter Dismissible.
handleDismiss(DismissDirection direction, int index) {
// Get a reference to the swiped item
final swipedEmail = items[index];
// Remove it from the list
items.removeAt(index);
String action;
if (direction == DismissDirection.startToEnd) {
deleteItem();
@wilburx9
wilburx9 / dismissible_animated.dart
Last active January 16, 2023 07:02
Animated Flutter Dismissible
Tween<Offset> _offSetTween = Tween(
begin: Offset(1, 0),
end: Offset.zero,
);
...
@override
Widget build(BuildContext context) {
return Scaffold(
...
@wilburx9
wilburx9 / main.dart
Last active November 8, 2020 01:40
Convert Apple devices utsname.machine to Json. See https://gist.github.com/adamawolf/3048717 for the updated list
import "dart:convert";
// Convert Apple devices utsname.machine to Json. See https://gist.github.com/adamawolf/3048717 for the updated list
void main() {
final splits = sss.split("\n");
final json = Map<String, String>();
splits.forEach((s) {
final k = s.split(":");
if (k.length == 2) {