Skip to content

Instantly share code, notes, and snippets.

@sgon00
sgon00 / main.dart
Last active April 30, 2022 13:06
Infinite List (Infinite Scrolling/Pagination) With Raw BLoC Pattern in Flutter
import 'dart:async';
import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@sgon00
sgon00 / components.js
Last active December 24, 2018 11:22
Note: `prism-shell.min.js` is actually not minimized JS file. Because I am using [MacDown](https://github.com/MacDownApp/macdown) locally, I am lazy to minimize the JS file. Just put it at `/Applications/MacDown.app/Contents/Resources/Prism/components/` and modifies your `components.js` and corresponding CSS file `my_macdown_style.css`.
...... other js codes ......
"shell": {
"title": "Shell",
"owner": "sgon00" // based on zeitgeist87's bash
},
...... other js codes ......
@sgon00
sgon00 / dart.vim
Created December 4, 2018 09:50
Put it at `~/.vim/after/syntax/dart.vim` to add/override anything in `~/.vim/bundle/dart-vim-plugin/syntax/dart.vim`.
syn match dartFunction "\zs\(\k\w*\)*\s*\ze("
hi! link dartFunction Function
syn match myCamelCase '\v(<_*\u\i*>)+'
hi! link myCamelCase Type
syntax keyword flutterConstant immutable kAlwaysCompleteAnimation kAlwaysDismissedAnimation
\ kBackMouseButton kBottomNavigationBarHeight kDoubleTapMinTime kDoubleTapSlop kDoubleTapTimeout
\ kDoubleTapTouchSlop kElevationToShadow kFloatingActionButtonMargin kFloatingActionButtonSegue
\ kFloatingActionButtonTurnInterval kForwardMouseButton kHoverTapSlop kHoverTapTimeout kJumpTapTimeout
<video id="video_1" class="video-js vjs-default-skin vjs-big-play-centered"
controls preload="auto" width="267" height="150"
poster="img/videos/1.jpg"
data-setup='{"autoplay": false}'>
<source src="videos/1.mp4" type='video/mp4' />
</video>