This guide walks you through integrating LibAdwaita, Bitsdojo Window, and related plugins to create a polished, GNOME-native experience for your Flutter desktop application.
Add the following dependencies to your pubspec.yaml
:
dependencies:
adwaita: latest
libadwaita: latest
libadwaita_bitsdojo: latest
desktop_notifications: latest
lucide_icons: latest
Run the command to install them:
flutter pub get
Modify your MaterialApp
widget to apply rounded corners to the home page:
return MaterialApp(
home: ClipRRect(
borderRadius: BorderRadius.circular(15),
child: const HomePage(), // Replace with your actual home widget
),
);
Modify linux/my_application.cc
:
-
Locate the following lines:
gtk_window_set_default_size(window, 1280, 720); gtk_widget_show(GTK_WIDGET(window));
-
Replace them with:
auto bdw = bitsdojo_window_from(window); bdw->setCustomFrame(true); gtk_window_set_default_size(window, 600, 450); // Adjust as needed gtk_widget_show(GTK_WIDGET(window));
-
Save the file and rebuild your project.
Replace Scaffold
with AdwScaffold
for better GNOME integration:
import 'package:flutter/material.dart';
import 'package:adwaita/adwaita.dart';
import 'package:lucide_icons/lucide_icons.dart';
import 'package:libadwaita_bitsdojo/libadwaita_bitsdojo.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AdwaitaTheme(
child: MaterialApp(
home: MyHomePage(),
),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AdwScaffold(
actions: AdwActions().bitsdojo,
start: [
AdwHeaderButton(
icon: const Icon(LucideIcons.rocket, size: 15),
onPressed: () {},
)
],
title: const Text('Bitsdojo Window'),
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [const Text('Welcome to Bitsdojo Window!')],
),
),
);
}
}
To run your Flutter app with LibAdwaita and Bitsdojo Window integration:
flutter run -d linux
This will launch your Flutter app with a GNOME-like UI, custom window decorations, and proper integration with desktop features.
- LibAdwaita provides better GTK theming and widgets for a native GNOME look.
- Bitsdojo Window allows customization of the window frame, making it feel more native.
- Lucide Icons provides a modern icon set, ideal for GNOME apps.
- Desktop Notifications can be used to trigger native system notifications.
This setup ensures that your Flutter application has a polished and well-integrated GNOME experience on Linux desktops.