fetch_app_logs 0.0.3 copy "fetch_app_logs: ^0.0.3" to clipboard
fetch_app_logs: ^0.0.3 copied to clipboard

discontinued

Fetch all of the logs produced by the application during its execution

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:fetch_app_logs/fetch_app_logs.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String logText = "";

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: SingleChildScrollView(
            child: Column(
              children: <Widget>[
                Text(logText),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    RaisedButton(
                      child: Text("Get Logs"),
                      onPressed: _loadLogs,
                    ),
                    RaisedButton(
                      child: Text("Clear Screen"),
                      onPressed: () {
                        setState(() {
                          logText = "";
                        });
                      },
                    ),
                  ],
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }

  void _loadLogs() async {
    var filePath = await FetchAppLogs.dumpAppLogsToFile();
    var logFile = File(filePath);
    var contents = await logFile.readAsString();
    setState(() {
      logText = contents;
    });
  }
}
0
likes
40
pub points
20%
popularity

Publisher

verified publishergitjournal.io

Fetch all of the logs produced by the application during its execution

Homepage

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on fetch_app_logs