bitsdojo / bitsdojo_window

A Flutter package that makes it easy to customize and work with your Flutter desktop app window.
http://www.youtube.com/watch?v=bee2AHQpGK4
MIT License
815 stars 229 forks source link

AppBar support already available #113

Open j0chn1 opened 3 years ago

j0chn1 commented 3 years ago

Hey, I wanted to use an AppBar to display my apps name. So I created one and added your WindowBorder to the body. It ended up having the AppBar above the windowbuttons. image

So I just tried to put your WindowBorder to the appbar.

Scaffold(
            appBar: AppBar(flexibleSpace: getWindowBorder(context, true)),
            body: theme)

That works pretty good. image

Additionally it fixed an endless exception throwing of my MultiSplitView. Maybe you want to add that to your README.

stibay commented 3 years ago

Works pretty nice. Can also wrap it in MoveWindow in flexibleSpace to make the whole AppBar draggable. Can't drag the window under the tile text though.

j0chn1 commented 3 years ago

Me neither, I mentioned it in https://github.com/bitsdojo/bitsdojo_window/issues/91

stibay commented 3 years ago

Figgured out a workaround, proabably easier way to do this. Pretty new to flutter. Tried to get it to work using the Stack widget with MoveWindow but didn't get that to work so I just looked at the code in MoveWindow and just copied it to the title in the AppBar 😄

 title: GestureDetector(
            behavior: HitTestBehavior.translucent,
            onPanStart: (details) {
              appWindow.startDragging();
            },
            onDoubleTap: () => appWindow.maximizeOrRestore(),
            child: Text(widget.title)),
      ),