Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prongbang/device_detect
Detect android device info, MIUI version, etc.
https://github.com/prongbang/device_detect
detect-miui miui
Last synced: 11 days ago
JSON representation
Detect android device info, MIUI version, etc.
- Host: GitHub
- URL: https://github.com/prongbang/device_detect
- Owner: prongbang
- License: mit
- Created: 2022-03-11T05:17:58.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-11T05:32:41.000Z (almost 3 years ago)
- Last Synced: 2024-11-24T05:12:19.217Z (28 days ago)
- Topics: detect-miui, miui
- Language: Kotlin
- Homepage: https://pub.dev/packages/device_detect
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# device_detect
Detect android device info, MIUI version, etc.
## Getting Started
It is really easy to use!
You should ensure that you add the `device_detect` as a dependency in your flutter project, Supported Android only.```yaml
dependencies:
device_detect: "^1.0.0"
```## Feature
- Detect MIUI
```dart
final result = await DeviceDetect.isMi;
```- Detect by System Property
```dart
final result = await DeviceDetect.hasSystemProperty('ro.miui.ui.version.name');
```## Usage
```dart
import 'package:device_detect/device_detect.dart';
import 'package:flutter/material.dart';class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Plugin example app')),
body: Center(
child: Column(
children: [
FutureBuilder(
future: DeviceDetect.isMi,
builder: (_, snapshot) => Text('MIUI: ${snapshot.data}'),
),
FutureBuilder(
future: DeviceDetect.hasSystemProperty(
'ro.miui.ui.version.name',
),
builder: (_, snapshot) => Text('MIUI: ${snapshot.data}'),
),
],
),
),
),
);
}
}
```