Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<item>
<enclosure
sparkle:os="ios"
sparkle:version="2.0.0"
url="https://apps.apple.com/tw/app/google/id284815942"/>
<!-- Uncomment this line to force update-->
<!--<sparkle:tags><sparkle:criticalUpdate/></sparkle:tags>-->
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<item>
<enclosure
sparkle:os="android"
sparkle:version="2.0.0"
url="https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox"/>
<!-- Uncomment this line to force update-->
<!--<sparkle:tags><sparkle:criticalUpdate/></sparkle:tags>-->
@FantasyCheese
FantasyCheese / node.dart
Created October 17, 2021 17:27
Copy data class with recursive children
class Node {
Node(this.title, [this.children = const []]);
final String title;
final List<Node> children;
}
Node copy(Node n) {
// create new object with data from old object
return Node(
@FantasyCheese
FantasyCheese / main.dart
Created July 2, 2021 08:56
Flutter slider minimum
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: App(),
),
);
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
body: Center(
child: Text("Please help me!!!"),
),
),
@FantasyCheese
FantasyCheese / main.dart
Created June 9, 2021 17:55
Radio Group
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
final doubleListQueue = ["personalName", "carrierType", "email"];
final tripleListQueue = ["companyName", "taxID", "email"];
@FantasyCheese
FantasyCheese / main.dart
Last active September 23, 2020 15:33
Pacman in Flutter
import 'package:flutter/material.dart';
import 'dart:async';
import 'dart:math';
const originalMap = [
[1,1,1,1,1,1,1,1,1,1,1,],
[1,0,0,0,0,0,0,0,0,0,1,],
[1,0,1,0,1,0,1,0,1,0,1,],
[1,0,1,0,1,1,1,0,1,0,1,],
[1,0,1,0,0,0,0,0,1,0,1,],
@FantasyCheese
FantasyCheese / main.dart
Last active September 18, 2020 15:21
Simplest Riverpod without Flutter Example
import 'dart:async';
import 'package:flutter_riverpod/all.dart';
final container = ProviderContainer(); // declare global ProviderContainer
final countProvider = StateProvider((ref) => 0); // declare providers anywhere
void main() {
final ProviderSubscription<StateController<int>> subscription = container.listen(countProvider, didChange: (sub) { // listen from container
print(sub.read().state);
@FantasyCheese
FantasyCheese / main.dart
Last active September 15, 2024 09:49
Simplest Riverpod Example
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/all.dart';
final countProvider = StateProvider((ref) => 0); // declare providers anywhere
final clockProvider = StateProvider((ref) => DateTime.now());
void main() {
runApp(ProviderScope(child: MyApp())); // add ProviderScope at top level
}
@FantasyCheese
FantasyCheese / main.dart
Created September 18, 2020 11:57
Simplest MultiProvider Example
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => Counter()),
ChangeNotifierProvider(create: (_) => Clock())