Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom colors are not applying for the TalkerScreen. v4.3.4 #250

Open
booooohdan opened this issue Jul 25, 2024 · 1 comment
Open

Custom colors are not applying for the TalkerScreen. v4.3.4 #250

booooohdan opened this issue Jul 25, 2024 · 1 comment

Comments

@booooohdan
Copy link

Colors are not applying, and TalkerScreen shows default colors. Btw custom titles working fine

    talker = TalkerFlutter.init(
      settings: TalkerSettings(
        useConsoleLogs: false,
        colors: {
          TalkerLogType.critical: AnsiPen()..red(),
          TalkerLogType.error: AnsiPen()..red(),
          TalkerLogType.exception: AnsiPen()..red(),
          TalkerLogType.warning: AnsiPen()..red(),
          TalkerLogType.info: AnsiPen()..red(),
          TalkerLogType.debug: AnsiPen()..red(),
          TalkerLogType.verbose: AnsiPen()..red(),
        },
      ),
    );
 class FirestoreReadsLog extends TalkerLog {
  FirestoreReadsLog(String super.message);

  @override
  String get title => 'firestore reads';

  @override
  AnsiPen get pen => AnsiPen()..red();
}

class NavigationLog extends TalkerLog {
  NavigationLog(String super.message);

  @override
  String get title => 'navigation';

  @override
  AnsiPen get pen => AnsiPen()..red();
}

class JsonLog extends TalkerLog {
  JsonLog(String super.message);

  @override
  String get title => 'json';

  @override
  AnsiPen get pen => AnsiPen()..red();
}

5264884883145219441

@booooohdan
Copy link
Author

Documentation is unclear. This code is changing colors in the debug console:

    talker = TalkerFlutter.init(
      settings: TalkerSettings(
        colors: {
          TalkerLogType.critical: AnsiPen()..xterm(160),
          TalkerLogType.exception: AnsiPen()..xterm(160),
          TalkerLogType.error: AnsiPen()..xterm(160),
          TalkerLogType.warning: AnsiPen()..xterm(208),
          TalkerLogType.info: AnsiPen()..xterm(39),
          TalkerLogType.debug: AnsiPen()..xterm(40),
          TalkerLogType.verbose: AnsiPen()..xterm(8),
        },
      ),
    );

and this code in Talker Screen.

          builder: (context, state) => TalkerScreen(
             appBarTitle: 'FamilyHub Logs',
             talker: FamilyHubLogger.instance.talker,
             theme: const TalkerScreenTheme(
               logColors: {
                 TalkerLogType.critical: Colors.red,
                 TalkerLogType.exception: Colors.red,
                 TalkerLogType.error: Colors.red,
                 TalkerLogType.warning: Colors.orange,
                 TalkerLogType.info: Colors.blue,
                 TalkerLogType.debug: Colors.green,
                 TalkerLogType.verbose: Colors.grey,
               },
             ),
           ),

anyway I cannot change colors for my custom Log Types, because it work only for the debug console, I can only override LogLevel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant