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

PlatformAndroid
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:datetime_setting/datetime_setting.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: TextButton(
            child: const Text('Get Information'),
            onPressed: () async {
              bool timeAuto = await DatetimeSetting.timeIsAuto();
              bool timezoneAuto = await DatetimeSetting.timeZoneIsAuto();
              print(timeAuto);
              print(timezoneAuto);

              if (!timezoneAuto || !timeAuto) {
                DatetimeSetting.openSetting();
              }
            },
          ),
        ),
      ),
    );
  }
}
29
likes
150
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)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on datetime_setting