Skip to content

Commit

Permalink
add acrylic effect
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidatorCoder2 committed Nov 13, 2021
1 parent 6a537c2 commit f9d5dc6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
9 changes: 8 additions & 1 deletion lib/main.dart
@@ -1,8 +1,15 @@
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:odin/pages/home_page.dart';

void main() {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Window.initialize();
await Window.setEffect(
effect: WindowEffect.acrylic,
color: const Color(0xCC222222),
);
runApp(const MyApp());
doWhenWindowReady(() {
final win = appWindow;
Expand Down
8 changes: 5 additions & 3 deletions lib/pages/home_page.dart
@@ -1,15 +1,16 @@
import 'package:flutter/material.dart';
import 'package:odin/widgets/window_top_bar.dart';

const backgroundStartColor = Color(0xFF121212);
const backgroundEndColor = Color(0xFF202020);
const backgroundStartColor = Color(0x55121212);
const backgroundEndColor = Color(0x55202020);

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

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
body: Container(
decoration: const BoxDecoration(
gradient: RadialGradient(
Expand All @@ -18,8 +19,9 @@ class HomePage extends StatelessWidget {
stops: [0.0, 1.0],
),
),
child: Column(
child: Stack(
children: const [
SizedBox.expand(),
WindowTopBar(),
],
),
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Expand Up @@ -104,6 +104,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_acrylic:
dependency: "direct main"
description:
name: flutter_acrylic
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
flutter_lints:
dependency: "direct dev"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Expand Up @@ -35,6 +35,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
bitsdojo_window: ^0.1.1+1
flutter_acrylic: ^0.1.0

dev_dependencies:
flutter_test:
Expand Down
3 changes: 3 additions & 0 deletions windows/flutter/generated_plugin_registrant.cc
Expand Up @@ -7,8 +7,11 @@
#include "generated_plugin_registrant.h"

#include <bitsdojo_window_windows/bitsdojo_window_plugin.h>
#include <flutter_acrylic/flutter_acrylic_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
BitsdojoWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
FlutterAcrylicPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterAcrylicPlugin"));
}
1 change: 1 addition & 0 deletions windows/flutter/generated_plugins.cmake
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_windows
flutter_acrylic
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down

0 comments on commit f9d5dc6

Please sign in to comment.