Coder Social home page Coder Social logo

biner88 / get_settings Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 153 KB

Toolbox, some useful methods, not commonly used but indispensable

License: BSD 3-Clause "New" or "Revised" License

Java 30.38% Ruby 6.01% Swift 38.50% Objective-C 1.87% Dart 23.24%

get_settings's Introduction

Get Settings

pub package

Toolbox, some useful methods, not commonly used but indispensable

Support

Method IOS Support Android Support
getPlatformVersion
isiOSAppOnMac
getUserAgent
isRotationOn
getCPUType
isPad
ipodToPath
contentToPath

Usage

import 'package:get_settings/getsettings.dart';
final setting = GetSettings();

Uri to file

Use on_audio_query to obtain the uri of the audio file. This method can obtain the absolute path of the file.

  • content:// to filepath , app cache dir, Android Only.
  • ipod-library to filepath, app document dir, IOS Only.

Android: ...

Future<String> ipodPath = await setting.ipodToPath('ipod-library://item/item.mp3?id=6894390456987001162'); 
print(ipodPath); 

Future<String> contentPath = await setting.contentToPath('content://media/external/audio/media/1000000346'); 
print(ipodpath); 

Rotation On

Android Only

setting.onListenSettings((rotation) {
  print(rotation);
}, (onError) {
  print('error:$onError');
});
Future<bool?> isRotationOn =await setting.isRotationOn();

Platform Version

Future<String?> getPlatformVersion =await setting.getPlatformVersion();
print(getPlatformVersion);

iOS App On Mac

Particularly useful for detecting whether an app is running on macOS, IOS Only

Future<bool?> isiOSAppOnMac =await setting.isiOSAppOnMac();
print(isiOSAppOnMac);

User Agent

webview UserAgent

Future<String?> getUserAgent =await setting.getUserAgent();
print(getUserAgent);

CPU type

IOS Only

Future<String?> getCPUType =await setting.getCPUType();
print(getCPUType);
//ARM,ARM64,X86,X86_64

get_settings's People

Contributors

biner88 avatar kdhfred avatar

Stargazers

Wu Tingfeng avatar

Watchers

 avatar

Forkers

kdhfred

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.