https://github.com/rwson/adapt
flutter 屏幕适配
https://github.com/rwson/adapt
Last synced: about 1 year ago
JSON representation
flutter 屏幕适配
- Host: GitHub
- URL: https://github.com/rwson/adapt
- Owner: rwson
- License: apache-2.0
- Created: 2019-01-25T04:19:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-29T10:38:29.000Z (over 7 years ago)
- Last Synced: 2025-03-11T03:41:58.636Z (over 1 year ago)
- Language: Dart
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# adapt
flutter屏幕适配插件
## 使用
```yaml
dependencies:
adapt:
git: git://github.com/rwson/adapt.git
```
## 导入
```dart
import 'package/adapt/adapt.dart';
```
## api
#### `static Adapt.init(double number)`
初始化设计稿尺寸, 默认750
#### `static Adapt.onePx()`
用于边框设置
#### `static Adapt.px(double number)`
把设计稿上的像素转换为当前分辨率对应的真实像素,用于设置字号、容器大小等
#### `static Adapt.screenW()`
返回当前横向分辨率
#### `static Adapt.screenH()`
返回当前纵向分辨率