flutter_fullscreen

Last updated:

0 purchases

flutter_fullscreen Image
flutter_fullscreen Images
Add to Cart

Description:

flutter fullscreen

A simple package which allows setting fullscreen mode on all platforms in flutter.
Features #
Allows setting full-screen mode on the following platforms:

Web
Linux
macOS
Windows
Android
IOS

Getting started #
Install #
Add to your pubspec.yaml file:
dependencies:
flutter_fullscreen: ^1.0.1
copied to clipboard
Usage #
Initialization #
import 'package:flutter_fullscreen/flutter_fullscreen.dart';

void main() async {
// ensure these two lines are added to main
WidgetsFlutterBinding.ensureInitialized();
await FullScreen.ensureInitialized();

runApp(const MyApp());
}
copied to clipboard
Setting fullscreen #
// enable fullscreen
FullScreen.setFullScreen(true);

// exit fullscreen
FullScreen.setFullScreen(false);
copied to clipboard
Listening to fullscreen status #
import 'package:flutter/material.dart';
import 'package:flutter/src/services/system_chrome.dart';
import 'package:flutter_fullscreen/flutter_fullscreen.dart';

class Page extends StatefulWidget {
const Page({super.key});

@override
State<Page> createState() => _PageState();
}

class _PageState extends State<Page> with FullScreenListener {
bool isFullScreen = FullScreen.isFullScreen;

@override
void initState() {
FullScreen.addListener(this);
super.initState();
}

@override
void dispose() {
FullScreen.removeListener(this);
super.dispose();
}

@override
void onFullScreenChanged(bool enabled, SystemUiMode? systemUiMode) {
setState(() {
isFullScreen = enabled;
});
}
}

copied to clipboard
Please see the example for more detailed usage.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.