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

outdated

Flutter package with general functions, get environment, get device, get network status, etc.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:paulonia_utils/paulonia_utils.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      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: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            FutureBuilder(
              future: PUtils.checkNetwork(),
              builder: (context, snap){
                if(snap.connectionState == ConnectionState.waiting){
                  return CircularProgressIndicator();
                }
                if(snap.data) Text("There is Internet");
                return Text("There isn't Internet");
              }
            ),
            SizedBox(height: 40),
            PUtils.isOnRelease() ? Text("App is in Release") : Text("App is not in Release"),
            SizedBox(height: 40),
            PUtils.isOnTest() ? Text("App is in Test") : Text("App is not in Test"),
            SizedBox(height: 40),
            PUtils.isOnWeb() ? Text("App is running in Web") : Text("App is not running in Web"),
            SizedBox(height: 40),
            FutureBuilder(
              future: PUtils.supportsAppleSignIn(),
              builder: (context, snap){
                if(snap.connectionState == ConnectionState.waiting){
                  return CircularProgressIndicator();
                }
                if(snap.data) return Text("The device supports Apple SignIn");
                return Text("The device not support Apple SignIn");
              },
            ),

          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: (){
          setState(() {});
        },
      ),
    );
  }
}
6
likes
0
pub points
16%
popularity

Publisher

verified publisherpaulonia.dev

Flutter package with general functions, get environment, get device, get network status, etc.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

connectivity, device_info, flutter

More

Packages that depend on paulonia_utils