搜索插件、代码仓与 APP 分类

插件详情v1.0.3

fullscreen

这是一个 Flutter 插件,可轻松在 Flutter 应用中启用全屏模式。它实现了 Android 平台的三种全屏模式。

近 30 天下载
139
喜欢数
48
Pub 分数
70

安装插件

flutter pub add fullscreen

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

全屏包是一个 Flutter 插件,可简化在 Android 应用程序中启用全屏模式。它支持三种 Android 全屏模式:沉浸式、沉浸式粘性以及全屏。专为希望在应用使用过程中移除系统 UI 元素以提升用户体验的开发者设计,该插件提供了一个简单的 API 来切换全屏,无需复杂的原生代码。该插件与 Flutter 的平台通道无缝集成,非常适合媒体播放器、游戏或任何需要沉浸式界面的应用。目前专注于 Android,未指定 iOS 支持。

适合场景

  • 媒体播放应用程序
  • 游戏界面
  • 沉浸式阅读体验
  • 全屏自助服务模式
  • 演示应用程序

主要特点

  • 支持 Android 的三种全屏模式
  • 简单的 API 集成
  • 无需原生代码
  • 针对沉浸式体验优化
  • 轻量且专注

适合对象

  • 仅限 Android 的需要全屏的应用
  • 开发者避免原生平台代码
  • 需要全屏沉浸的应用
  • 游戏和媒体应用开发者
  • 面向用户界面的移动应用

使用建议

  • 仅限 Android 平台
  • 无 iOS 支持
  • 需要 Android SDK 21+
  • 可能影响可访问性功能
  • 全屏行为因设备制造商而异

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

fullscreen

Introduction

This is a flutter plugin that makes it easy to enable fullscreen in flutter application. The implements the three fullscreen modes of the android platform and those for iOS.

Summary

Some content is best experienced fullscreen, like videos, games, image galleries, books, and slides in a presentation. This page shows how you can engage users more deeply with content in fullscreen and protect users from exiting the app accidentally.

You might be tempted to enable fullscreen mode just to maximize screen space for your app. But be mindful of how often users jump in and out of apps to check notifications, do impromptu searches, and more. Using fullscreen causes users to lose easy access to system navigation, so you should use fullscreen mode only when the benefit to the user experience goes beyond simply receiving a little extra space (such as to avoid accidental exits during a game or delivering a valuable immersive exerience for images, videos, and books).

Fullscreen options

Android offers three options to making your app fullscreen: Lean Back, Immersive, and Immersive Sticky. In all three approaches, the system bars are hidden and your activity continues to receive all touch events. The difference between them is how the user can bring the system bars back into view.

FullScreenMode.LEANBACK

The lean back mode is for fullscreen experiences in which users won't be interacting heavily with the screen, such as while watching a video.

When users want to bring back the system bars, they simply tap the screen anywhere.

FullScreenMode.EMERSIVE

The immersive mode is intended for apps in which the user will be heavily interacting with the screen. Examples are games, viewing images in a gallery, or reading paginated content, like a book or slides in a presentation.

When users need to bring back the system bars, they swipe from any edge where a system bar is hidden. By requiring this more deliberate gesture, the user's engagement with your app won't be interrupted by accidental touches and swipes.

FullScreenMode.EMERSIVE_STICKY

n the regular immersive mode, any time a user swipes from an edge, the system takes care of revealing the system bars—your app won't even be aware that the gesture occurred. So if the user might actually need to swipe from the edge of the screen as part of the primary app experience—such as when playing a game that requires lots of swiping or using a drawing app—you should instead enable the "sticky" immersive mode.

While in sticky immersive mode, if the user swipes from an edge with a system bar, system bars appear but they're semi-transparent, and the touch gesture is passed to your app so it can also respond to the gesture.

For example, in a drawing app that uses this approach, if the user wants to draw a line that begins at the very edge of the screen, swiping from the edge reveals the system bars and also starts drawing a line that begins at the very edge. The bars automatically disappear after a few seconds of no interaction or as soon as the user touches or gestures anywhere outside the system bars.

Installation

Add the following statement in your pubspec.yaml file in the dependencies section.

dependencies:
    flutter:
        sdk: flutter
    fullscreen: <latest-version>


How to use

Import the package

import 'package:fullscreen/fullscreen.dart';

To enable fullscreen mode with Sticky emersive, pass the fullscreen mode (FullScreenMode.EMERSIVE_STICKY)as an argument the the enterFullScreen method of the FullScreen class.

    // To enter FullScreenMode.EMERSIVE_STICKY, 
    await FullScreen.enterFullScreen(FullScreenMode.EMERSIVE_STICKY);

To exit fullscreen, call the exitFullScreen method of the FullScreen class

    // To exit fullscreen mode
    await FullScreen.exitFullScreen();

Getting Started with flutter?

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。