snap_layouts
एक प्लगइन एक सरल विंडो लेआउट बटन प्रदान करता है जो मूल Windows 11 स्नैप लेआउट फीचर को लागू कर सकता है।
एक प्लगइन एक सरल विंडो लेआउट बटन प्रदान करता है जो मूल Windows 11 स्नैप लेआउट फीचर को लागू कर सकता है।
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This plugin provides a simple window layout button, SnapLayoutsButton, which can implement the native Windows 11 Snap Layouts feature.
English | 简体中文
| Linux | macOS | Windows | iOS | Android |
|---|---|---|---|---|
| ❌ | ❌ | ✔️ | ❌ | ❌ |
window_manager pluginflutter pub add snap_layouts
flutter pub add window_manager
Or add the following to your pubspec.yaml:
dependencies:
snap_layouts: ^0.2.0
window_manager: ^0.5.0
You can directly check the example.
SnapLayoutsButtonPlace the button on your page.
import 'package:flutter/material.dart';
import 'package:snap_layouts/snap_layouts.dart';
import 'package:window_manager/window_manager.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await windowManager.ensureInitialized();
WindowOptions windowOptions = WindowOptions(
// Ensure this option
titleBarStyle: TitleBarStyle.hidden,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
});
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox(width: 46, height: 32, child: SnapLayoutsButton()),
),
),
);
}
}
SnapLayoutsCaptionPlace the title bar on your page.
import 'package:flutter/material.dart';
import 'package:snap_layouts/snap_layouts.dart';
import 'package:window_manager/window_manager.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await windowManager.ensureInitialized();
WindowOptions windowOptions = WindowOptions(
// Ensure this option
titleBarStyle: TitleBarStyle.hidden,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
});
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> with WindowListener {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(kWindowCaptionHeight),
child: SnapLayoutsCaption(
title: Text('snap_layouts_example'),
actions: [
WindowCaptionAction(
icon: Icon(Icons.favorite_outline),
onPressed: () {},
),
],
),
),
body: Center(child: Text('Snap Layouts Example')),
),
);
}
@override
void onWindowMaximize() {
setState(() {});
}
@override
void onWindowUnmaximize() {
setState(() {});
}
}
निर्भरता सूची 4 आइटम
{"sdk":"flutter"}^2.0.2^0.5.0^6.0.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗