Frezyx / talker

☎️ Advanced error handler and logger for dart and flutter apps
https://pub.dev/packages/talker_flutter
MIT License
510 stars 62 forks source link

Unsupported operation: StdIOUtils._getStdioOutputStream #185

Closed tas-unn closed 8 months ago

tas-unn commented 9 months ago

Describe the bug I've tried to use gorouter with this package.

To Reproduce Steps to reproduce the behavior: 1) This is a short version of my code

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:talker_flutter/talker_flutter.dart';

void main() async {
  GoRouter.optionURLReflectsImperativeAPIs = true;
  runApp(const RouteIt());
}

class RouteIt extends StatefulWidget {

  const RouteIt({super.key});

  @override
  State<RouteIt> createState() => _RouteItState();
}

class _RouteItState extends State<RouteIt> {

  @override
  void initState() {
    super.initState();
  }
  @override
  Widget build(BuildContext context) {
    final talker = Talker();
    final GoRouter _router = GoRouter(
      observers: [TalkerRouteObserver(talker)],
      routes: <GoRoute>[
        GoRoute(

            routes: <GoRoute>[
            ],

            path: "/",
            builder: (BuildContext context1, state1) =>
                                Text("!")

        )
      ],
    );
    return
      MaterialApp.router(

          routerDelegate: _router.routerDelegate,
          routeInformationParser: _router.routeInformationParser,
          routeInformationProvider: _router.routeInformationProvider,
          title:"111",
          debugShowCheckedModeBanner: false,
          );

  }

}

2) If i comment observers line - it works fine, but Talker is not work)

All packages have been updated to the latest version

  go_router: ^13.1.0
  talker_flutter: ^4.0.0
cfsbhawkins commented 8 months ago

I am getting the same issue after upgrading from v3 on a flutter web project. I also noticed that with v4 web is no longer listed as a platform. Will have to revert back to v3.

sarp86 commented 8 months ago

Same Problem we also have - any solutions?

cfsbhawkins commented 8 months ago

Same Problem we also have - any solutions?

Revert to v3

Frezyx commented 8 months ago

Hello everyone! Please check out this article in docs

Talker uses different log methods for different platforms with TalkerFlutter.init() constructor By default - stdout.writeln For web - print (because the stdout.writeln method from io package is not available in web)

Frezyx commented 8 months ago

All you need to fix this issue - just replace Talker() constructor with TalkerFlutter.init()