get_safe_insets 0.0.1 copy "get_safe_insets: ^0.0.1" to clipboard
get_safe_insets: ^0.0.1 copied to clipboard

PlatformAndroid

A plugin to get safe insets on Android

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:get_safe_insets/get_safe_insets.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  EdgeInsets? _safeInsets;

  @override
  void initState() {
    super.initState();
    _loadSafeInsets();
  }

  void _loadSafeInsets() async {
    final safeInsets = await getSafeInsets();
    setState(() => _safeInsets = safeInsets);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Safe insets: $_safeInsets\n'),
        ),
      ),
    );
  }
}
0
likes
120
pub points
1%
popularity

Publisher

unverified uploader

A plugin to get safe insets on Android

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on get_safe_insets