패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.2.0

snap_layouts

플러그인은 원본 Windows 11 스탭 레이아웃 기능을 구현할 수 있는 간단한 창 레이아웃 버튼을 제공합니다.

Windows
30일 다운로드
5.2만
좋아요
1
Pub 점수
160

패키지 설치

flutter pub add snap_layouts

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

snap_layouts 패키지는 윈도우에서 Flutter 애플리케이션에 원격으로 Windows 11 스크랩 레이아웃 기능을 구현할 수 있게 해주며, 사용자에게 익숙하고 효율적인 창 관리 경험을 제공합니다. 이 패키지는 스냅 레이아웃을 트리거하는 간단한 버튼 인터페이스를 제공하여 창을 미리 정의된 구성으로 빠르게 정렬할 수 있도록 합니다. 복잡한 코드 없이 창 위치를 간소화함으로써 생산성을 향상시킵니다. 이 패키지는 Windows 데스크톱 앱 전용으로 설계되었으며, Flutter의 데스크톱 플랫폼과 원활하게 통합됩니다.

사용 사례

  • Windows 11 스타일의 창 스냅 기능 구현
  • 빠른 창 배치를 통한 사용자 생산성 향상
  • Windows에서 데스크톱 앱의 사용성 향상
  • Flutter 앱에서 반응형 창 레이아웃 만들기
  • 네이티브와 유사한 창 관리 기능 활성화

주요 기능

  • 간단한 레이아웃 버튼 통합
  • Windows 11 스크랩 레이아웃 지원
  • 네이티브 Windows 창 관리
  • 필요한 최소 설정
  • 데스크톱 중심의 디자인

적합한 대상

  • 윈도우 데스크톱 플러터 개발자
  • 고급 창 관리가 필요한 앱
  • 윈도우 11 사용자를 대상으로 하는 개발자
  • 생산성 중심의 데스크톱 애플리케이션
  • 네이티브 윈도우 UX를 찾는 사용자

고려 사항

  • Windows 플랫폼에 한정
  • Windows 11 이상이 필요합니다
  • Linux 또는 macOS는 지원되지 않습니다
  • 네이티브 Windows API에 의존합니다
  • 완전한 기능을 위해 추가 구성이 필요할 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

snap_layouts

pub version

This plugin provides a simple window layout button, SnapLayoutsButton, which can implement the native Windows 11 Snap Layouts feature.


English | 简体中文


Supported Platforms

Linux macOS Windows iOS Android
❌ ❌ ✔️ ❌ ❌

Features

  • Native Windows 11-style Snap Layouts button
  • Default Windows 11-style window title bar
  • Integration with the window_manager plugin
  • Full customization support

Quick Start

Installation
flutter 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
Usage

You can directly check the example.

SnapLayoutsButton

Place 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()),
        ),
      ),
    );
  }
}
SnapLayoutsCaption

Place 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(() {});
  }
}

References

  • https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/ui/apply-snap-layout-menu
  • https://github.com/luoluoqixi/flutter_windows11_snap_layouts_examples.git
  • https://github.com/grassator/win32-window-custom-titlebar
  • https://github.com/leanflutter/window_manager

License

MIT

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.

순위