ivk1800 / tdlib-dart

MIT License
19 stars 12 forks source link

Question: Adding tdlib to Project #12

Closed cliftonlabrum closed 8 months ago

cliftonlabrum commented 8 months ago

Please forgive me for such a simple question, but your example app shows import statements like this:

import 'package:tdlib/td_api.dart' as td;
import 'package:tdlib/td_client.dart';

Does this mean you are using this tdlib package from pub.dev? Or are you copying the tdlib folder directly into your project?

I don't see tdlib into your pubspec.yaml, so I was a little confused.

ivk1800 commented 8 months ago

You can use package from git as here: https://github.com/ivk1800/telegram-flutter/blob/fc43850edb299b5d1825d429a245ddef3d711efd/td/td_api/pubspec.yaml#L8

cliftonlabrum commented 8 months ago

Thanks for your help on this. Quick question. Does the ref: c54a942a65bd734755659a91964c2b0ad90d6cf2 line have to change per TDLib release? I'm not clear on where that comes from and if I need to change it as you make updates.

cliftonlabrum commented 8 months ago

When I added this dependency like this:

tdlib:
    git:
      url: git@github.com:ivk1800/tdlib-dart.git
      ref: c54a942a65bd734755659a91964c2b0ad90d6cf2

I get this error:

Because file_picker >=5.0.0 depends on ffi ^2.0.1 and every version of tdlib from git depends on ffi ^1.0.0, file_picker >=5.0.0 is incompatible with tdlib from git.
So, because teleglam depends on both tdlib from git and file_picker ^6.0.0, version solving failed.

But if I manually including the /tdlib folder in my project, I get no such error. Is FFI really stuck on 1.0.0 in your repo?

ivk1800 commented 8 months ago

Does the ref: c54a942a65bd734755659a91964c2b0ad90d6cf2 line have to change per TDLib release?

Yes, just use hash of last commit.