This file contains 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:dart_frog/dart_frog.dart'; | |
Handler middleware(Handler handler) { | |
return Cascade().add(handler).add(catchAll).handler; | |
} | |
Response catchAll(RequestContext context) => Response(body: 'Catch All'); |
This file contains 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:io'; | |
import 'package:dart_frog/dart_frog.dart'; | |
Future<HttpServer> run(Handler handler, InternetAddress ip, int port) { | |
final cascade = Cascade().add(handler).add(catchAll); | |
return serve(cascade.handler, ip, port); | |
} | |
Response catchAll(RequestContext context) => Response(body: 'Catch All'); |
This file contains 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:io'; | |
import 'package:dart_frog/dart_frog.dart'; | |
Future<HttpServer> run(Handler handler, InternetAddress ip, int port) { | |
final cascade = Cascade().add(trackableStaticFileHandler).add(handler); | |
return serve(cascade.handler, ip, port); | |
} | |
Future<Response> trackableStaticFileHandler(RequestContext context) async { |
This file contains 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
format = "$all" | |
add_newline = true | |
[character] | |
success_symbol="[\\$](bold bright-red)" | |
error_symbol = "[✖](bold bright-red)" | |
[battery] | |
full_symbol = "🔋" |
This file contains 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:flutter_bloc/flutter_bloc.dart'; | |
void main() => runApp(App()); | |
abstract class CounterEvent {} | |
class Increment extends CounterEvent {} | |
class CounterBloc extends Bloc<CounterEvent, int> { |
This file contains 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:bloc/bloc.dart'; | |
import 'package:equatable/equatable.dart'; | |
import 'package:flow_builder/flow_builder.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
class Book extends Equatable { | |
const Book(this.title, this.author); | |
final String title; |
This file contains 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( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
This file contains 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( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
This file contains 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( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, |
This file contains 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:bloc/bloc.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
class SimpleBlocDelegate extends BlocDelegate { | |
@override | |
void onEvent(Bloc bloc, Object event) { | |
super.onEvent(bloc, event); | |
print(event); | |
} |
NewerOlder