is_app_windowed 0.1.0 copy "is_app_windowed: ^0.1.0" to clipboard
is_app_windowed: ^0.1.0 copied to clipboard

This package is for checking if the App is running in windowed mode.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:is_app_windowed/is_app_windowed.dart';

void main() {
  runApp(IsAppWindowedProvider(child: const MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    final isAppWindowed = IsAppWindowed.of(context);
    return Scaffold(
      appBar: AppBar(
        leadingWidth: isAppWindowed ? 56 * 2 : null,
        leading: Align(
          alignment: isAppWindowed
              ? Alignment.centerRight
              : Alignment.centerLeft,
          child: IconButton(onPressed: () {}, icon: Icon(Icons.menu)),
        ),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Swipe from center top of the iPad to enter windowed mode.',
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
160
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

This package is for checking if the App is running in windowed mode.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on is_app_windowed