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

Flutter package for logging with some simple template and customization

Flutter package for logging with some simple template and customization like to check response from api.

Features #

  • Basic

    Simple logging with border like table

  • Title

    The basic and additional title/header

  • Response Http

    Response api using http package, just put response to this method then you will see the detail about the response

  • Result Firestore Document

    Just like response http but for firestore document. If you want to check your response collection, just looping it then use this method. (If using firebase)

  • Disable Log

    if your development proses has ended, you can disable log with just set enable as false. this feature better if you use singleton.

Getting started #

  • Add this package to your dependency
  • Add http pakage if you use
  • Add And Setup Your Firebase Project to use some method for check response from firestore

Usage #

FDLog().basic('basic');

FDLog fdLog = FDLog();
fdLog.basic('basic 2');

fdLog.title(
  'Lorem ipsum',
  'Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.',
);

String url = 'https://jsonplaceholder.typicode.com/todos/1';
final response = await http.get(Uri.parse(url));
fdLog.response(response);

final doc = await FirebaseFirestore.instance
                    .collection('Cars')
                    .doc('jFIrKWrOCMNoWBcwUrgq')
                    .get();
fdLog.firestoreDocument(doc);
copied to clipboard

[result]

Singleton #

You can also use DLog with Singleton Schema, for example with GetIt package

GetIt getIt = GetIt.instance;

initInjection() {
  FDLog fdLog = FDLog(
    bodyColorCode: 49,
    titleColorCode: 50,
    maxCharPerRow: 70,
    prefix: 'Ok',
  );
  getIt.registerLazySingleton(() => fdLog);
}

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

ElevatedButton(
  onPressed: () {
    getIt<FDLog>().title('Dependency Injection', 'Service Locator');
  },
  child: const Text('GetIt'),
),
copied to clipboard

[getit]

Color Code: #

  • Ordered

    [Ordered]

  • Palette

    [Palette]

Additional information #

You can see the tutorial from: Flutter Delux

0
likes
0
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.16 - 2025.03.31

Flutter package for logging with some simple template and customization

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cloud_firestore, flutter, http

More

Packages that depend on fd_log