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();
              }
            },
          ),
        ),
      ),
    );
  }
}
29
likes
30
points
6.93k
downloads

Publisher

verified publisherfuadarradhi.com

Weekly Downloads

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

Repository (GitHub)

License

unknown (license)

Dependencies

flutter

More

Packages that depend on datetime_setting