bar 1.0.0 copy "bar: ^1.0.0" to clipboard
bar: ^1.0.0 copied to clipboard

Title bars

Features #

  • Title bar for desktop applications

Usage #

import 'package:window_manager/window_manager.dart';
import 'package:bar/bar.dart';

class MyApplication extends StatelessWidget {
  const MyApplication({super.key});
  
  @override
  Widget build(BuildContext context) => Column(
    children: [
      TitleBar(
          title: Text("My App"),
          leading: Icon(Icons.menu),
          surfaceColor: Colors.white,
          color: Colors.black,
          theme: PlatformTheme.mac,
          onMaximize: () => windowManager.maximize(),
          onClose: () => windowManager.close(),
          onStartDragging: () => windowManager.startDragging(),
          onUnMaximize: () => windowManager.unMaximize(),
          isMaximized: () => windowManager.isMaximized(),
      ),
      Expanded(
        child: MaterialApp(),
      ),
    ],
  );
}