Skip to content

Commit

Permalink
Added flutter_lints to the example app
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsdojo committed Jun 9, 2021
1 parent 42010d9 commit 4a6a0da
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 136 deletions.
86 changes: 52 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void main() {
// Add this code below

doWhenWindowReady(() {
final initialSize = Size(600, 450);
const initialSize = Size(600, 450);
appWindow.minSize = initialSize;
appWindow.size = initialSize;
appWindow.alignment = Alignment.center;
Expand All @@ -133,17 +133,18 @@ This will set an initial size and a minimum size for your application window, ce
You can find examples in the `example` folder.

Here is an example that displays this window:

<details>
<summary>Click to expand</summary>

```dart
import 'package:flutter/material.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
doWhenWindowReady(() {
final win = appWindow;
final initialSize = Size(600, 450);
const initialSize = Size(600, 450);
win.minSize = initialSize;
win.size = initialSize;
win.alignment = Alignment.center;
Expand All @@ -155,21 +156,29 @@ void main() {
const borderColor = Color(0xFF805306);

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: WindowBorder(
color: borderColor,
width: 1,
child: Row(children: [LeftSide(), RightSide()]))));
debugShowCheckedModeBanner: false,
home: Scaffold(
body: WindowBorder(
color: borderColor,
width: 1,
child: Row(
children: const [LeftSide(), RightSide()],
),
),
),
);
}
}

const sidebarColor = Color(0xFFF6A00C);

class LeftSide extends StatelessWidget {
const LeftSide({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
Expand All @@ -189,41 +198,45 @@ const backgroundStartColor = Color(0xFFFFD500);
const backgroundEndColor = Color(0xFFF6A00C);

class RightSide extends StatelessWidget {
const RightSide({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [backgroundStartColor, backgroundEndColor],
stops: [0.0, 1.0]),
child: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [backgroundStartColor, backgroundEndColor],
stops: [0.0, 1.0]),
),
child: Column(children: [
WindowTitleBarBox(
child: Row(
children: [Expanded(child: MoveWindow()), const WindowButtons()],
),
child: Column(children: [
WindowTitleBarBox(
child: Row(children: [
Expanded(child: MoveWindow()),
WindowButtons()
])),
])));
)
]),
),
);
}
}

final buttonColors = WindowButtonColors(
iconNormal: Color(0xFF805306),
mouseOver: Color(0xFFF6A00C),
mouseDown: Color(0xFF805306),
iconMouseOver: Color(0xFF805306),
iconMouseDown: Color(0xFFFFD500));
iconNormal: const Color(0xFF805306),
mouseOver: const Color(0xFFF6A00C),
mouseDown: const Color(0xFF805306),
iconMouseOver: const Color(0xFF805306),
iconMouseDown: const Color(0xFFFFD500));

final closeButtonColors = WindowButtonColors(
mouseOver: Color(0xFFD32F2F),
mouseDown: Color(0xFFB71C1C),
iconNormal: Color(0xFF805306),
mouseOver: const Color(0xFFD32F2F),
mouseDown: const Color(0xFFB71C1C),
iconNormal: const Color(0xFF805306),
iconMouseOver: Colors.white);

class WindowButtons extends StatelessWidget {
const WindowButtons({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
Expand All @@ -233,12 +246,17 @@ class WindowButtons extends StatelessWidget {
CloseWindowButton(colors: closeButtonColors),
],
);
}
}
```
</details>

#
# ❤️ **Sponsors - friends helping this package**

I am developing this package in my spare time.
If you want to help so that I can dedicate more time for this, you can become a supporter.
I am developing this package in my spare time and any help is appreciated.

If you want to help you can [become a sponsor](https://github.com/sponsors/bitsdojo).

🙏 Thank you!

Expand Down
85 changes: 51 additions & 34 deletions bitsdojo_window/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void main() {
// Add this code below

doWhenWindowReady(() {
final initialSize = Size(600, 450);
const initialSize = Size(600, 450);
appWindow.minSize = initialSize;
appWindow.size = initialSize;
appWindow.alignment = Alignment.center;
Expand All @@ -133,17 +133,18 @@ This will set an initial size and a minimum size for your application window, ce
You can find examples in the `example` folder.

Here is an example that displays this window:

<details>
<summary>Click to expand</summary>

```dart
import 'package:flutter/material.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
doWhenWindowReady(() {
final win = appWindow;
final initialSize = Size(600, 450);
const initialSize = Size(600, 450);
win.minSize = initialSize;
win.size = initialSize;
win.alignment = Alignment.center;
Expand All @@ -155,21 +156,29 @@ void main() {
const borderColor = Color(0xFF805306);

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: WindowBorder(
color: borderColor,
width: 1,
child: Row(children: [LeftSide(), RightSide()]))));
debugShowCheckedModeBanner: false,
home: Scaffold(
body: WindowBorder(
color: borderColor,
width: 1,
child: Row(
children: const [LeftSide(), RightSide()],
),
),
),
);
}
}

const sidebarColor = Color(0xFFF6A00C);

class LeftSide extends StatelessWidget {
const LeftSide({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
Expand All @@ -189,41 +198,45 @@ const backgroundStartColor = Color(0xFFFFD500);
const backgroundEndColor = Color(0xFFF6A00C);

class RightSide extends StatelessWidget {
const RightSide({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [backgroundStartColor, backgroundEndColor],
stops: [0.0, 1.0]),
child: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [backgroundStartColor, backgroundEndColor],
stops: [0.0, 1.0]),
),
child: Column(children: [
WindowTitleBarBox(
child: Row(
children: [Expanded(child: MoveWindow()), const WindowButtons()],
),
child: Column(children: [
WindowTitleBarBox(
child: Row(children: [
Expanded(child: MoveWindow()),
WindowButtons()
])),
])));
)
]),
),
);
}
}

final buttonColors = WindowButtonColors(
iconNormal: Color(0xFF805306),
mouseOver: Color(0xFFF6A00C),
mouseDown: Color(0xFF805306),
iconMouseOver: Color(0xFF805306),
iconMouseDown: Color(0xFFFFD500));
iconNormal: const Color(0xFF805306),
mouseOver: const Color(0xFFF6A00C),
mouseDown: const Color(0xFF805306),
iconMouseOver: const Color(0xFF805306),
iconMouseDown: const Color(0xFFFFD500));

final closeButtonColors = WindowButtonColors(
mouseOver: Color(0xFFD32F2F),
mouseDown: Color(0xFFB71C1C),
iconNormal: Color(0xFF805306),
mouseOver: const Color(0xFFD32F2F),
mouseDown: const Color(0xFFB71C1C),
iconNormal: const Color(0xFF805306),
iconMouseOver: Colors.white);

class WindowButtons extends StatelessWidget {
const WindowButtons({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
Expand All @@ -233,12 +246,16 @@ class WindowButtons extends StatelessWidget {
CloseWindowButton(colors: closeButtonColors),
],
);
}
}
```
</details>

#
# ❤️ **Sponsors - friends helping this package**

I am developing this package in my spare time.
If you want to help so that I can dedicate more time for this, you can become a supporter.
I am developing this package in my spare time and any help is appreciated.
If you want to help you can [become a sponsor](https://github.com/sponsors/bitsdojo).

🙏 Thank you!

Expand Down
Loading

0 comments on commit 4a6a0da

Please sign in to comment.