datetime_setting 1.0.0 copy "datetime_setting: ^1.0.0" to clipboard
datetime_setting: ^1.0.0 copied to clipboard

outdated

Flutter plugin to get information about auto time and auto timezone, open setting if not set to auto.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: FlatButton(
            child: Text('Get Information Or Open Setting'),
            onPressed: () async {
              bool timeAuto = await DatetimeSetting.timeIsAuto();
              bool timezoneAuto = await DatetimeSetting.timeZoneIsAuto();

              print(timeAuto);
              print(timezoneAuto);

              if (!timeAuto || !timezoneAuto) {
                await DatetimeSetting.openSetting();
              }
            },
          ),
        ),
      ),
    );
  }
}
27
likes
30
pub points
93%
popularity

Publisher

verified publisherfuadarradhi.com

Flutter plugin to get information about auto time and auto timezone, open setting if not set to auto.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on datetime_setting