libadwaita 1.0.2 copy "libadwaita: ^1.0.2" to clipboard
libadwaita: ^1.0.2 copied to clipboard

outdated

Libadwaita's widgets for Flutter. Following Gnome HIG and available on all platforms.

example/example.md

Examples for libadwaita flutter package #

Demo App #

Here is a demo app made with libadwaita package.

Minimal libadwaita_bitsdojo usage #

#pubspec.yaml
dependencies:
  adwaita:
  libadwaita:
  libadwaita_bitsdojo:
// main.dart

import 'package:adwaita/adwaita.dart';
import 'package:flutter/material.dart';
import 'package:libadwaita/libadwaita.dart';
import 'package:libadwaita_bitsdojo/libadwaita_bitsdojo.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: AdwaitaThemeData.light(),
      darkTheme: AdwaitaThemeData.dark(),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AdwScaffold(
      headerbar: (_) => AdwHeaderBar.bitsdojo(
        appWindow: appWindow,
        start: const [
          AdwHeaderButton(
            icon: Icon(Icons.nightlight_round, size: 15),
          ),
        ],
        title: const Text('Bitsdojo Window'),
      ),
      body: const Center(
        child: Text('Welcome to Bitsdojo Window Example!'),
      ),
    );
  }
}

Minimal nativeshell usage #

#pubspec.yaml
dependencies:
  adwaita:
  libadwaita:
  nativeshell:
// main.dart

import 'package:adwaita/adwaita.dart';
import 'package:flutter/material.dart';
import 'package:libadwaita/libadwaita.dart';
import 'package:nativeshell/nativeshell.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: AdwaitaThemeData.light(),
      darkTheme: AdwaitaThemeData.dark(),
      home: WindowWidget(
        onCreateState: (dynamic _) {
          WindowState? state;
          return state ??= MainWindowState();
        },
      ),
    );
  }
}

class MainWindowState extends WindowState {
  @override
  Future<void> initializeWindow(Size contentSize) async {
    await window.setStyle(WindowStyle(frame: WindowFrame.noTitle));
    await window.show();
  }

  @override
  WindowSizingMode get windowSizingMode =>
      WindowSizingMode.atLeastIntrinsicSize;

  @override
  Widget build(BuildContext context) {
    return WindowLayoutProbe(
      child: AdwScaffold(
        headerbar: (_) => AdwHeaderBar.nativeshell(
          window: window,
          start: const [
            AdwHeaderButton(
              icon: Icon(Icons.nightlight_round, size: 15),
            ),
          ],
          title: const Text('Nativeshell'),
        ),
        body: const Center(
          child: Text('Welcome to NativeShell Example!'),
        ),
      ),
    );
  }
}

Minimal window_decorations usage #

#pubspec.yaml
dependencies:
  adwaita:
  libadwaita:
  window_decorations:
// main.dart

import 'package:adwaita/adwaita.dart';
import 'package:flutter/material.dart';
import 'package:libadwaita/libadwaita.dart';
import 'package:window_decorations/window_decorations.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: AdwaitaThemeData.light(),
      darkTheme: AdwaitaThemeData.dark(),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AdwScaffold(
      headerbar: (_) => AdwHeaderBar(
        windowDecor: windowDecor,
        onClose: () {},
        onMaximize: () {},
        onMinimize: () {},
        start: const [
          AdwHeaderButton(
            icon: Icon(Icons.nightlight_round, size: 15),
          ),
        ],
        title: const Text('Window Decorations'),
      ),
      body: const Center(
        child: Text('Welcome to Window Decorations Example!'),
      ),
    );
  }
}
79
likes
0
pub points
71%
popularity

Publisher

verified publisherprateeksu.blogspot.com

Libadwaita's widgets for Flutter. Following Gnome HIG and available on all platforms.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dbus, flutter, flutter_svg, gsettings, package_info_plus, popover_gtk, url_launcher

More

Packages that depend on libadwaita