Skip to content

Instantly share code, notes, and snippets.

View dumazy's full-sized avatar

Fré Dumazy dumazy

View GitHub Profile
@dumazy
dumazy / main.dart
Created October 23, 2024 17:05
Updating PopScope based on inner Navigator
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@dumazy
dumazy / main.dart
Created November 8, 2024 09:33
Example of AsyncCache for preventing concurrent execution.
import 'package:async/async.dart';
/// Example of how AsyncCache can prevent concurrent execution.
void main() async {
// Call _execute every second.
// In a real use case, multiple triggers can call [_execute]
// e.g: start up, user interaction, connectivity change, etc
for (int i = 0; i < 10; i++) {
_execute(i);
await Future.delayed(Duration(seconds: 1));