libadwaita_nativeshell 0.5.2+1 copy "libadwaita_nativeshell: ^0.5.2+1" to clipboard
libadwaita_nativeshell: ^0.5.2+1 copied to clipboard

A libadwaita package for providing an extension to AdwActions for nativeshell package

example/example.md

Minimal usage #

#pubspec.yaml
dependencies:
  adwaita:
  libadwaita:
  libadwaita_nativeshell:
  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(
        actions: AdwActions().nativeshell(context),
        start: const [
          AdwHeaderButton(
            icon: Icon(Icons.nightlight_round, size: 15),
          ),
        ],
        title: const Text('Nativeshell'),
        body: const Center(
          child: Text('Welcome to NativeShell Example!'),
        ),
      ),
    );
  }
}
0
likes
150
pub points
10%
popularity

Publisher

unverified uploader

A libadwaita package for providing an extension to AdwActions for nativeshell package

Repository (GitHub)
View/report issues

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

flutter, libadwaita_core, nativeshell

More

Packages that depend on libadwaita_nativeshell