iphone_has_notch 0.0.2 copy "iphone_has_notch: ^0.0.2" to clipboard
iphone_has_notch: ^0.0.2 copied to clipboard

outdated

Returns true if the phone is iPhone and it has notch, returns false otherwise.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Text(
              'This phone is iPhone and it has notch',
              style: TextStyle(fontSize: 16, color: Colors.black),
            ),
            Text(
              '${IphoneHasNotch.hasNotch}',
              style: TextStyle(fontSize: 30, color: Colors.blue[800]),
            ),
          ],
        ),
      ),
    );
  }
}
16
likes
40
pub points
87%
popularity

Publisher

verified publisherawaik.pro

Returns true if the phone is iPhone and it has notch, returns false otherwise.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on iphone_has_notch