add permissions check to example project
add permission check to example project add permission check to example project
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="app.polyvox.filament_example">
|
package="app.polyvox.filament_example">
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<application
|
<application
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:label="polyvox_filament_example"
|
android:label="polyvox_filament_example"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
import 'package:polyvox_filament/filament_controller.dart';
|
import 'package:polyvox_filament/filament_controller.dart';
|
||||||
import 'package:polyvox_filament/animations/bone_animation_data.dart';
|
import 'package:polyvox_filament/animations/bone_animation_data.dart';
|
||||||
@@ -311,7 +312,10 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
|||||||
? EdgeInsets.all(50)
|
? EdgeInsets.all(50)
|
||||||
: EdgeInsets.zero;
|
: EdgeInsets.zero;
|
||||||
});
|
});
|
||||||
}, "resize")
|
}, "resize"),
|
||||||
|
_item(() async {
|
||||||
|
await Permission.microphone.request();
|
||||||
|
}, "request permissions (tests inactive->resume)")
|
||||||
]);
|
]);
|
||||||
if (_animations != null) {
|
if (_animations != null) {
|
||||||
children.addAll(_animations!.map((a) => _item(() {
|
children.addAll(_animations!.map((a) => _item(() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ dependencies:
|
|||||||
path_provider:
|
path_provider:
|
||||||
polyvox_filament:
|
polyvox_filament:
|
||||||
path: ../
|
path: ../
|
||||||
|
permission_handler:
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user