This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/foundation.dart'; | |
class BottomScrollDetector extends StatefulWidget { | |
const BottomScrollDetector({ | |
super.key, | |
required this.extent, | |
required this.slivers, | |
required this.onBottomReached, | |
this.controller, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"github.com/labstack/echo/v5" | |
"github.com/pocketbase/dbx" | |
"github.com/pocketbase/pocketbase" | |
"github.com/pocketbase/pocketbase/apis" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:grab/grab.dart'; | |
import 'package:pot/pot.dart'; | |
final counterPot = Pot( | |
() => ValueNotifier(0), | |
disposer: (notifier) => notifier.dispose(), // This disposer is not called in this example, but I think you get the idea. | |
); | |
void main() => runApp(const App()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:grab/grab.dart'; | |
final counter = ValueNotifier(0); | |
void main() => runApp(const App()); | |
class App extends StatelessWidget { | |
const App({super.key}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData.from( | |
colorScheme: ColorScheme.light(primary: Colors.green), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
enum ErrorTypes { addUser, saveUser } | |
final errorHandler = ErrorHandler<ErrorTypes>(); | |
Future<void> main() async { | |
Process.p1(); | |
await Future<void>.delayed(const Duration(seconds: 1)); | |
Process.p2(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(const App()); | |
class App extends StatelessWidget { | |
const App(); | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
const MaterialApp( | |
home: SafeArea( | |
child: Scaffold( | |
body: App(), | |
), | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
Future<void> main() async { | |
final controller = StreamController<int>(); | |
final stream = counterStream(controller); | |
counter(controller); | |
await stream.forEach(print); | |
controller.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A floating bottom navigation bar for flutter inspired by a screen cast of | |
// a similar one for React Native that I saw on Twitter. The original source | |
// is probably this post: | |
// https://hackernoon.com/how-we-created-tabbar-plugin-with-react-native-c00de2337f22 | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(const App()); |
NewerOlder