Comments (9)
I have received an email showing that you have posted the following comment:
Interesting, I just updated my macOS, rebooted and now everything works. You can delete this issue, not sure what caused it.
It doesn’t show up here for some reason, but I’ll just close this issue for now.
from flutter_acrylic.
@Adrian-Samoticha no, it still happens, I might have ran it in debug mode when I rebooted or there's some kind of probabilistic nature to it. For now I switched to window_manager
from flutter_acrylic.
Do you get the same issue when running the example project?
from flutter_acrylic.
Interesting, the example works. I played around a bit, and found one example that works and that doesn't work. If I remove the Stack
from SidebarFrame
, the app freezes in release mode. This is the working example in release mode:
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter_acrylic_example/widgets/sidebar_frame/sidebar_frame.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Window.initialize();
if (Platform.isWindows) {
await Window.hideWindowControls();
}
runApp(MyApp());
if (Platform.isWindows) {
doWhenWindowReady(() {
appWindow
..minSize = Size(640, 360)
..size = Size(720, 540)
..alignment = Alignment.center
..show();
});
}
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
splashFactory: InkRipple.splashFactory,
),
darkTheme: ThemeData.dark().copyWith(
splashFactory: InkRipple.splashFactory,
),
themeMode: ThemeMode.dark,
home: MyAppBody(),
);
}
}
class MyAppBody extends StatefulWidget {
MyAppBody({Key? key}) : super(key: key);
@override
MyAppBodyState createState() => MyAppBodyState();
}
class MyAppBodyState extends State<MyAppBody> {
WindowEffect effect = WindowEffect.transparent;
Color color = Platform.isWindows ? Color(0xCC222222) : Colors.transparent;
MacOSBlurViewState macOSBlurViewState =
MacOSBlurViewState.followsWindowActiveState;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
// The [TitlebarSafeArea] widget is required when running on macOS and
// enabling the full-size content view using
// [Window.setFullSizeContentView]. It ensures that its child is not covered
// by the macOS title bar.
return TitlebarSafeArea(
child: SidebarFrame(
macOSBlurViewState: macOSBlurViewState,
sidebar: SizedBox.expand(
child: Scaffold(),
),
child: Stack(
children: [Text("yo")],
),
),
);
}
}
This is the broken example in release mode, I only changed the child of the SidebarFrame
. I assume this is unintended behavior?
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter_acrylic_example/widgets/sidebar_frame/sidebar_frame.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Window.initialize();
if (Platform.isWindows) {
await Window.hideWindowControls();
}
runApp(MyApp());
if (Platform.isWindows) {
doWhenWindowReady(() {
appWindow
..minSize = Size(640, 360)
..size = Size(720, 540)
..alignment = Alignment.center
..show();
});
}
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
splashFactory: InkRipple.splashFactory,
),
darkTheme: ThemeData.dark().copyWith(
splashFactory: InkRipple.splashFactory,
),
themeMode: ThemeMode.dark,
home: MyAppBody(),
);
}
}
class MyAppBody extends StatefulWidget {
MyAppBody({Key? key}) : super(key: key);
@override
MyAppBodyState createState() => MyAppBodyState();
}
class MyAppBodyState extends State<MyAppBody> {
WindowEffect effect = WindowEffect.transparent;
Color color = Platform.isWindows ? Color(0xCC222222) : Colors.transparent;
MacOSBlurViewState macOSBlurViewState =
MacOSBlurViewState.followsWindowActiveState;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
// The [TitlebarSafeArea] widget is required when running on macOS and
// enabling the full-size content view using
// [Window.setFullSizeContentView]. It ensures that its child is not covered
// by the macOS title bar.
return TitlebarSafeArea(
child: SidebarFrame(
macOSBlurViewState: macOSBlurViewState,
sidebar: SizedBox.expand(
child: Scaffold(),
),
child: Text("yo"),
),
);
}
}
from flutter_acrylic.
Both of your examples as well as the example project freeze in release mode on my machine. Interestingly, the same thing happens in Flutter 3.7.0, which rules out a breaking change in Flutter. I genuinely have no idea what is causing the issue and will need to investigate further.
from flutter_acrylic.
When running it in release via Xcode like this:
and then running it through Xcode, it magically starts working correctly, even when running it via flutter run --release
afterward.
I genuinely have no idea why this is the case.
EDIT: I did see some errors appear on my console, though, so maybe I should check if those are related to the problem.
from flutter_acrylic.
I'm trying to figure it out as well, I don't know anything about Swift, but I can replicate in Xcode by running the broken Flutter build executable in Xcode's debugger, so first flutter build macos
and then Xcode > Debug > Debug Executable
. The only error being shown to me is caused by bitsdojo_window_macos, if I remove bitsdojo and rebuild it won't print anything. The code freezes when adding the flutterViewController
to MacOSWindowUtilsViewController
.
from flutter_acrylic.
flutter_acrylic 1.1.2 no longer needs you to edit any Swift files. You should be able to just set your build configuration to “Release” in Xcode and run it there (at least that worked for me).
from flutter_acrylic.
Yes, when I run it in Xcode it works for me as well. Debugging the broken Flutter build at least gives some insight on what's happening
from flutter_acrylic.
Related Issues (20)
- how to split tile bar half translucent and half not?
- windows10 aero effect color adjustment
- It doesn't open HOT 3
- expose aera transparent ratio API on windows10
- macOS broken HOT 10
- Usage of `macos_window_utils` broken in 1.1.1 HOT 6
- [Question] is there any way for customize unfocused window color of Window Effects like mica/acrylic/tabbed?
- windows11 acrylic effect changed
- Upgrade to macos_window_utils 1.1.2
- Replace the deprecated `backgroundColor` with `colorScheme.background` in `/example/lib/widgets/macos_action_menu/description_display.dart`
- Setup linting and fix linter errors
- Improve macos_window_utils import
- hideTitle takes no effect HOT 3
- Facing error after upgrading to 1.1.2 HOT 12
- Not working on macOS 12.3.1 (21E258) and flutter 3.7.11 HOT 8
- Not work after importing flutter_easyloading HOT 2
- flutter_acrylic.Window.hideWindowControls() not support on linux HOT 1
- Not Working on Android ,
- Tint colour does not work on Mac OS when using WindowEffect.acrylic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_acrylic.