folivora_logger 0.0.1 copy "folivora_logger: ^0.0.1" to clipboard
folivora_logger: ^0.0.1 copied to clipboard

A useful logger.


import 'package:folivora_logger/folivora_logger.dart';

// ignore: depend_on_referenced_packages
import 'package:http/http.dart' as http;
import 'package:flutter/material.dart';
import 'package:twostrings_palette/twostrings_palette.dart';

void main() {
  runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Two Strings Package Test App',
      theme: ThemeData(
      home: const MyHomePage(title: 'Two Strings Home Page'),

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  State<MyHomePage> createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Uri _generateUri() {
    return Uri(scheme: "https", host: "", path: null, queryParameters: null, query: "name=dhkim");

  Future<http.Response> _httpRequest({required http.Request request}) async {
    final streamedResponse = await request.send();
    return await http.Response.fromStream(streamedResponse);

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Package example app'),
      body: Center(
        child: ElevatedButton(
          onPressed: () async {
            FvLogger("Default Logger");
            FvLogger("You can use this for even Object ${_TestObjectPrint()}");
  "build start\nbuilding...\nbuilding...\nbuilding...\nbuild done");
            FvFunLogger.heart("I Love You.");
            FvFunLogger.poop("Shit Code");

            FvLogger.exception(_FvException("Exception Message"));

            http.Request request = http.Request("GET", _generateUri());
            request.headers.addAll({'Content-Type': 'application/json'});

            FvLogger.httpRequest(httpRequest: request);
            http.Response response = await _httpRequest(request: request);
            FvLogger.httpResponse(httpResponse: response);
            FvLogger.httpResponse(httpResponse: response, printHeaders: true);
          child: const Text("Test"),

class _TestObjectPrint {
  final String str = "Instance";
  final int integer = 3;

class _FvException implements Exception {

  final String? message;

  String toString() {
    return "FvException: $message";

class FvError implements Error {
  final String? type;
  final String? message;
  final String? title;
  final String? detail;

  FvError({this.type, this.message, this.title, this.detail});

  String toString() {
    return "$type\n$message\n$title\n$detail";

  StackTrace? get stackTrace => throw UnimplementedError();

  factory FvError.example({String? type, String? message, String? title, String? detail}) = _Example;

class _Example extends FvError {
  _Example({String? type, String? message, String? title, String? detail})
      : super(
            type: type ?? "TEST_ERROR",
            message: message ?? 'Error occurred',
            title: title ?? 'Error Title',
            detail: detail ?? 'Error Message');