Skip to content

Instantly share code, notes, and snippets.

View davidmartos96's full-sized avatar
💭
🧙‍♂️

David Martos davidmartos96

💭
🧙‍♂️
View GitHub Profile
@davidmartos96
davidmartos96 / main.dart
Created December 10, 2021 09:03
#26072 with slivers, renders all slivers
import 'dart:math';
import 'package:flutter/material.dart';
const numLists = 250;
const numberOfItemsPerList = 10;
void main() {
runApp(const MyApp());
}
@davidmartos96
davidmartos96 / flat_map.dart
Created January 22, 2021 11:06
Map as a List helper to make building nested lists in Flutter easier.
import 'package:flutter/material.dart';
class FlatMapItem<MapKey, MapValue> {
MapKey key;
MapValue value;
int index;
FlatMapItem.value(this.value, {@required this.index}) : assert(value != null);
FlatMapItem.key(this.key, {@required this.index}) : assert(key != null);
@davidmartos96
davidmartos96 / main.dart
Created July 15, 2020 07:00
Provider: markNeedsRebuild() called during build
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@davidmartos96
davidmartos96 / main.dart
Last active February 18, 2020 16:14
ChangeNotifierProxyProvider update
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MaterialApp(home: MainPage()));
}
const List<Destination> allDestinations = <Destination>[
Destination(0, 'Home', Icons.home),
Destination(1, 'Other', Icons.settings),