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

How to use "libadwaita_bitsdojo"? #1

Open
Ridhubharan opened this issue Jun 25, 2022 · 2 comments
Open

How to use "libadwaita_bitsdojo"? #1

Ridhubharan opened this issue Jun 25, 2022 · 2 comments

Comments

@Ridhubharan
Copy link

Instructions are not clear. Where am I supposed to put the following(as per https://github.com/gtk-flutter/libadwaita_plugins/tree/main/libadwaita_bitsdojo#usage)?

AdwHeaderBar.bitsdojo(
    appWindow: appWindow,
    ...
)

The 'headerbar' used in the 'AdwScaffold' widget is deprecated. (https://github.com/gtk-flutter/libadwaita_plugins/blob/main/libadwaita_bitsdojo/example/example.md)

@TDuffinNTU
Copy link

Check out this! https://pub.dev/packages/bitsdojo_window#for-linux-apps

Step by step:

  1. flutter pub get libadwaita_bitsdojo to install the package
  2. in your my_application.cc file, add
    #include <bitsdojo_window_linux/bitsdojo_window_plugin.h>
    to the top of the file, comment out the line
    gtk_window_set_default_size(window, 1280, 720);
    and add
auto bdw = bitsdojo_window_from(window);
bdw->setCustomFrame(true);

directly above it
3. In your main.dart file (your root MaterialApp widget) use AdwScaffold() as your scaffold, example below

return AdwScaffold(
      start: const [AdwHeaderButton(icon: Icon(Icons.abc))],
      actions: AdwActions().bitsdojo,
      body: const Center(
        child: Text('Welcome to Bitsdojo Window Example!'),
      ),
    );

You should now get something like this:
image

@TDuffinNTU
Copy link

I'll have to make a PR to update the example as I found it was very outdated too!

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

2 participants