nuntio_pluto 0.0.2 nuntio_pluto: ^0.0.2 copied to clipboard
Nuntio Pluto is a simple to use logging tool.
import 'package:flutter/material.dart';
import 'package:nuntio_pluto/nuntio_pluto.dart';
void main() async {
await Pluto.initialize();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
void throwError() {
throw Exception("This is a test exception");
}
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example of Nuntio Pluto',
home: Scaffold(
body: Container(
padding: const EdgeInsets.all(20),
width: double.infinity,
child: Column(
children: [
const Padding(
padding: EdgeInsets.all(8.0),
child: Text("Test the Pluto Logging Tool"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.verbose("Test verbose"),
child: const Text("Test verbose log"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.debug("Test debug"),
child: const Text("Test debug log"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.info("Test info"),
child: const Text("Test info log"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.warn("Test warning"),
child: const Text("Test warn log"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.error("Test error"),
child: const Text("Test error log"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.fatal("Test fatal"),
child: const Text("Test fatal log"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: throwError,
child: const Text("Test throw exception"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () {
Pluto.instance.crash();
},
child: const Text("Test crash app"),
),
),
const Padding(
padding: EdgeInsets.all(8.0),
child: Text("Test logging of different types"),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () =>
PlutoLogger.info(["item 1", "item 2", "item 3"]),
child: const Text("Test log list"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.info(Text("Text")),
child: const Text("Test log Text widget"),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => PlutoLogger.info(() => "function output"),
child: const Text("Test log function"),
),
),
],
),
),
),
);
}
}