Tbib Get Timezone Location
Get timezone location from time offset user
this package use for get timezone location from location device and timezone database
Note
Why this package created
created for get timezone from time offset and location because some devices not get timezone form internet so await FlutterTimezone.getLocalTimezone(); not working
ios permission
info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>$(PRODUCT_NAME) uses location to get your timezone.</string>
podfile
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_LOCATION=1',
]
android permission
<!-- Always include this permission -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- Include only if your app benefits from precise location access. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
How use it
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await TbibGetTimezoneLocation().init();
var timezoneName = await TbibGetTimezoneLocation().getTimezones();
log(timezoneName.toString());
......
}
Libraries
- gen/assets.gen
- tbib_get_timezone_location
- Get timezone location from time offest user