Skip to content

Instantly share code, notes, and snippets.

View mkiisoft's full-sized avatar
🤓
Flutter + Android + iOS

Mariano Zorrilla mkiisoft

🤓
Flutter + Android + iOS
View GitHub Profile
class Task {
final IconData icon;
final int tasks;
final String title;
final double percentage;
Task(this.icon, this.tasks, this.title, this.percentage);
}
class MyHomePage extends StatefulWidget {
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
@mkiisoft
mkiisoft / CurvedShape.dart
Created July 16, 2019 05:35 — forked from tarek360/CurvedShape.dart
Draw a curved shape in Flutter
import "package:flutter/material.dart";
import 'package:flutter/services.dart';
import 'dart:math';
const CURVE_HEIGHT = 160.0;
const AVATAR_RADIUS = CURVE_HEIGHT * 0.28;
const AVATAR_DIAMETER = AVATAR_RADIUS * 2;
void main() => runApp(new MyApp());
import 'package:flutter/material.dart';
class BreathingWidget extends StatefulWidget {
final Widget child;
const BreathingWidget({Key key, @required this.child}) : super(key: key);
@override
_BreathingWidgetState createState() => _BreathingWidgetState();
}
@mkiisoft
mkiisoft / tiltable_stack.dart
Created August 5, 2019 15:48 — forked from Schwusch/tiltable_stack.dart
A tiltable stack, an idea originated from 2dimensions
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class TiltableStack extends StatefulWidget {
final List<Widget> children;
final Alignment alignment;
const TiltableStack({
@mkiisoft
mkiisoft / slow_scroll_flutter.dart
Created August 7, 2019 15:28 — forked from rodydavis/slow_scroll_flutter.dart
just need random color package
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:random_color/random_color.dart';
class SlowScrollView extends StatefulWidget {
@override
_SlowScrollViewState createState() => _SlowScrollViewState();
}
@mkiisoft
mkiisoft / multi_select.dart
Created September 2, 2019 18:11 — forked from slightfoot/multi_select.dart
Multi Select GridView in Flutter - by Simon Lightfoot (Drag to select multiple items)
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@override
Widget build(BuildContext context) {
final width = MediaQuery
.of(context)
.size
.width - 80;
return Material(
child: Scaffold(
body: Container(
@mkiisoft
mkiisoft / login_example.dart
Last active February 7, 2020 01:07
Correct way to keep a login state of users and do the expected routing. Flutter - Dart (Flutter NYC Meetup)
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart'; // pubspec.yaml shared_preferences: any
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final backend = await Backend.init();
runApp(DemoApp(backend: backend));
}
class Backend extends ChangeNotifier {
@mkiisoft
mkiisoft / wrap_extension_web.dart
Last active January 28, 2020 01:16
Wrap + Extensions + Flutter Web
// Dart Extensions were introduced in Dart 2.7. Make sure you're using 'flutter channel dev'
// to try the latest implementations.
// Add the following lines inside 'analysis_options.yaml' file (root folder)
// analyzer:
// enable-experiment:
// - spread-collections
// Make sure to use 'flutter upgrade' and then run the code if you were not up to date.