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

PlatformAndroid

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();
              }
            },
          ),
        ),
      ),
    );
  }
}
26
likes
130
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

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on datetime_setting