skip to Main Content

I tried to print to console but can’t get it to work. I have checked other forums and tried their recommendations but no result.

import 'dart:developer';

log('your message here'); // nothing

or

import 'package:flutter/foundation.dart';

debugPrint('your message here'); // nothing

Filtering "your message here" in the Android Studio logcat shows nothing. I’m just learning Flutter. I need help.

2

Answers


  1. You will find it on the Run section of your Android Studio. Moreover, importing 'package:flutter/material.dart'; will be enough to find debugPrint(). Hope you’ll find your log, happy coding!

    Login or Signup to reply.
  2. @TryCatchFinally nice to meet you.
    I also needed a feature like Logcat, so I created one.

    It’s called flutter_logcat package.
    You can find more details on Pub.dev site.
    I hope it has the features you’re looking for.
    If it does, that would make me really happy.
    If you need any enhancement features, feel free to request them on GitHub issues, and I’ll work on it!

    Thanks!

    Add
    flutter pub add flutter_logcat
    

    Usage
    import 'package:flutter_logcat/flutter_logcat.dart';
    
    @override
    void initState() {
      ...
      Log.d("Test initState..");
    }
    

    https://pub.dev/packages/flutter_logcat

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search