libadwaita_nativeshell 0.5.0 copy "libadwaita_nativeshell: ^0.5.0" to clipboard
libadwaita_nativeshell: ^0.5.0 copied to clipboard

outdated

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

example/example.md

Minimal usage #

#pubspec.yaml
dependencies:
  adwaita:
  libadwaita:
  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(
          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
0
pub points
10%
popularity

Publisher

unverified uploader

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, libadwaita_core, nativeshell

More

Packages that depend on libadwaita_nativeshell