Error: You should set `SILENT_OBSERVATORY` to true when debugging the VM
Asked Answered
C

1

7

I am creating the chat and this is the error I am getting:

Warning: You should set SILENT_OBSERVATORY to true when debugging the VM as it will output the observatory URL by default. This breaks the various reporter contracts. To set the value define DART_VM_OPTIONS=-DSILENT_OBSERVATORY=true.

I didn't change anything in widget_test.dart, but this is how it looks like when I start the app: enter image description here

Full code is here:

void main() async {

 final client = Client(
    'b67pax5b2wdq',
    logLevel: Level.INFO,
  );

  await client.setUser(
    User(id: 'falling-mountain-7'),
    'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZmFsbGluZy1tb3VudGFpbi03In0.AKgRXHMQQMz6vJAKszXdY8zMFfsAgkoUeZHlI-Szz9E',
    
  );

  runApp(MaterialApp(home: Chat(client)));


class Chat extends StatelessWidget {
  final Client client;

  Chat(this.client);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Container(
        child: StreamChat(
          client: client,
          child: ChannelListPage(),
        ),
      ),
    );
  }
}

class ChannelListPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ChannelListView(
        filter: {
          'members': {
            '\$in': [StreamChat.of(context).user.id],
          }
        },
        sort: [SortOption('last_message_at')],
        pagination: PaginationParams(
          limit: 20,
        ),
        channelWidget: ChannelPage(),
      ),
    );
  }
}

class ChannelPage extends StatelessWidget {
  const ChannelPage({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: ChannelHeader(),
      body: Column(
        children: <Widget>[
          Expanded(
            child: MessageListView(
              messageBuilder: _messageBuilder,
            ),
          ),
          MessageInput(),
        ],
      ),
    );
  }

  Widget _messageBuilder(context, message, index) {
    final isCurrentUser = StreamChat.of(context).user.id == message.user.id;
    final textAlign = isCurrentUser ? TextAlign.right : TextAlign.left;
    final color = isCurrentUser ? Colors.blueGrey : Colors.blue;

    return Padding(
      padding: EdgeInsets.all(20.0),
      child: Container(
        decoration: BoxDecoration(
          color: Colors.blue,
          //border: Border.all(color: color, width: 1),
          borderRadius: BorderRadius.all(
            Radius.circular(45.0),
          ),
        ),
        child: ListTile(
          title: Text(
            message.text,
            textAlign: textAlign,
          ),
          subtitle: Text(
            message.user.extraData['name'],
            textAlign: textAlign,
          ),
        ),
      ),
    );
  }
}
Cathar answered 26/6, 2020 at 6:40 Comment(3)
What version of the plugin where you using at the time, I have same problem post install of 47.0.3, have submitted a report hereMukluk
Same here, I have updated plugin and crack me down: Warning: You should set SILENT_OBSERVATORY to true when debugging the VM as it will output the observatory URL by default. This breaks the various reporter contracts. To set the value define DART_VM_OPTIONS=-DSILENT_OBSERVATORY=true.Denudation
This is still a problem, and is tracked here: github.com/dart-lang/test/issues/1206Disappoint
M
1

This has been fixed (flag code reverted) with release of M47.1. download it and you should be good to go.

ChangeLog here

Mukluk answered 30/6, 2020 at 23:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.