|
| 1 | +import 'package:bitsdojo_window/bitsdojo_window.dart'; |
| 2 | +import 'package:flutter/material.dart'; |
| 3 | + |
| 4 | +const sidebarColor = Color(0xFFF6A00C); |
| 5 | + |
| 6 | +class LeftSide extends StatelessWidget { |
| 7 | + @override |
| 8 | + Widget build(BuildContext context) { |
| 9 | + return SizedBox( |
| 10 | + width: 200, |
| 11 | + child: Container( |
| 12 | + color: sidebarColor, |
| 13 | + child: Column( |
| 14 | + children: [ |
| 15 | + WindowTitleBarBox(child: MoveWindow()), |
| 16 | + Expanded(child: Container()) |
| 17 | + ], |
| 18 | + ))); |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +const backgroundStartColor = Color(0xFFFFD500); |
| 23 | +const backgroundEndColor = Color(0xFFF6A00C); |
| 24 | + |
| 25 | +class RightSide extends StatelessWidget { |
| 26 | + @override |
| 27 | + Widget build(BuildContext context) { |
| 28 | + return Expanded( |
| 29 | + child: Container( |
| 30 | + decoration: BoxDecoration( |
| 31 | + gradient: LinearGradient( |
| 32 | + begin: Alignment.topCenter, |
| 33 | + end: Alignment.bottomCenter, |
| 34 | + colors: [backgroundStartColor, backgroundEndColor], |
| 35 | + stops: [0.0, 1.0]), |
| 36 | + ), |
| 37 | + child: Column(children: [ |
| 38 | + WindowTitleBarBox( |
| 39 | + child: Row(children: [ |
| 40 | + Expanded(child: MoveWindow()), |
| 41 | + WindowButtons() |
| 42 | + ])), |
| 43 | + ]))); |
| 44 | + } |
| 45 | +} |
| 46 | + |
| 47 | +class WindowButtons extends StatelessWidget { |
| 48 | + @override |
| 49 | + Widget build(BuildContext context) { |
| 50 | + final buttonColors = WindowButtonColors( |
| 51 | + iconNormal: Theme.of(context).brightness == Brightness.dark |
| 52 | + ? Colors.white |
| 53 | + : Colors.black, |
| 54 | + mouseOver: Theme.of(context).brightness == Brightness.dark |
| 55 | + ? Colors.white |
| 56 | + : Colors.grey.shade300, |
| 57 | + mouseDown: Theme.of(context).brightness == Brightness.dark |
| 58 | + ? Colors.white |
| 59 | + : Colors.grey.shade400, |
| 60 | + iconMouseOver: Theme.of(context).brightness == Brightness.dark |
| 61 | + ? Colors.white |
| 62 | + : Colors.black, |
| 63 | + iconMouseDown: Theme.of(context).brightness == Brightness.dark |
| 64 | + ? Colors.white |
| 65 | + : Colors.black); |
| 66 | + |
| 67 | + final closeButtonColors = WindowButtonColors( |
| 68 | + mouseOver: Color(0xFFD32F2F), |
| 69 | + mouseDown: Color(0xFFB71C1C), |
| 70 | + iconNormal: Theme.of(context).brightness == Brightness.dark |
| 71 | + ? Colors.white |
| 72 | + : Colors.black, |
| 73 | + iconMouseOver: Colors.white); |
| 74 | + return Row( |
| 75 | + children: [ |
| 76 | + MinimizeWindowButton(colors: buttonColors), |
| 77 | + MaximizeWindowButton(colors: buttonColors), |
| 78 | + CloseWindowButton(colors: closeButtonColors), |
| 79 | + ], |
| 80 | + ); |
| 81 | + } |
| 82 | +} |
0 commit comments