window_manager 0.1.4 window_manager: ^0.1.4 copied to clipboard
This plugin allows Flutter desktop apps to resizing and repositioning the window.
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:window_manager/window_manager.dart';
import './pages/home.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await windowManager.ensureInitialized();
// Use it only after calling `hiddenWindowAtLaunch`
windowManager.waitUntilReadyToShow().then((_) async {
// await windowManager.setAsFrameless();
await windowManager.setSize(Size(800, 600));
await windowManager.show();
});
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primaryColor: Color(0xff416ff4),
canvasColor: Colors.white,
scaffoldBackgroundColor: Color(0xffF7F9FB),
dividerColor: Colors.grey.withOpacity(0.3),
),
builder: BotToastInit(),
navigatorObservers: [BotToastNavigatorObserver()],
home: HomePage(),
);
}
}