Коммит 4c2bb5ee создал по автору Красавин Никита Сергеевич's avatar Красавин Никита Сергеевич
Просмотр файлов

Merge branch 'create-plugin' into 'master'

[feature] Create file_selector_aurora

See merge request oss/flutter/flutter-community-plugins/file_selector_aurora!1
владельцы e5c00d7a bf7e9340
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
/pubspec.lock
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Aurora generated
/aurora/flutter
# Authors
* Daniil Girenko, <a.fedchenko@omp.ru>
* Developer, 2024
* Maintainer, 2024
* Alexander Syrykh
* Developer, 2024
* Nikita Krasavin, <n.krasavin@omp.ru>
* Product owner, 2024
* Maintainer, 2024
* Reviewer, 2024
* Vitaly Zarubin, <v.zarubin@omp.ru>
* Reviewer, 2024
* Egor Popov, <e.popov@omp.ru>
* Reviewer, 2024
* Oksana Torosyan, <o.torosyan@omp.ru>
* Designer, 2024
# file_selector_aurora
The Aurora implementation of [`file_selector`](https://pub.dev/packages/file_selector).
## Usage
This package is not an _endorsed_ implementation of `file_selector`.
Therefore, you have to include `file_selector_aurora` alongside `file_selector` as dependencies in your `pubspec.yaml` file.
> Supports only OS Aurora 5+!
**pubspec.yaml**
```yaml
dependencies:
file_selector: ^1.0.3
file_selector_aurora:
git:
url: https://gitlab.com/omprussia/flutter/flutter-plugins.git
ref: file_selector_aurora-0.0.1
path: packages/file_selector/file_selector_aurora
```
***.desktop**
```desktop
Permissions=UserDirs
```
***.dart**
```dart
Because file_selector_aurora works through Navigator, the plugin needs context to work.
Use FileSelectorAuroraKeyContainer.navigatorKey to set the key and put it to MaterialApp
import 'package:file_selector_aurora/file_selector_aurora.dart';
final navigatorKey = GlobalKey<NavigatorState>();
void main() {
// Set FileSelectorAuroraKeyContainer.navigatorKey
FileSelectorAuroraKeyContainer.navigatorKey = navigatorKey;
runApp(const MyApp());
}
...
Widget build(BuildContext context) {
// Put navigatorKey to MaterialApp
return MaterialApp(
navigatorKey: navigatorKey,
);
}
...
import 'package:file_selector/file_selector.dart';
Future<void> _openImageFile(BuildContext context) async {
const XTypeGroup typeGroup = XTypeGroup(
extensions: <String>['jpg', 'png'],
);
final XFile? file = await openFile(acceptedTypeGroups: <XTypeGroup>[typeGroup]);
print(file?.name);
}
# SPDX-FileCopyrightText: Copyright 2024 Open Mobile Platform LLC <community@omp.ru>
# SPDX-License-Identifier: BSD-3-Clause
include: package:flutter_lints/flutter.yaml
analyzer:
exclude:
- "build/**"
- "file_manager/**"
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать