moxxy_native/example/lib/main.dart

53 lines
1.5 KiB
Dart
Raw Normal View History

2023-09-07 16:51:22 +00:00
import 'package:flutter/material.dart';
import 'package:moxxy_native/moxxy_native.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: ListView(
children: [
TextButton(
onPressed: () async {
final result = await MoxxyPickerApi()
.pickFiles(FilePickerType.image, false);
2023-09-07 16:51:22 +00:00
// ignore: avoid_print
print('User picked: $result');
},
child: const Text('Photo picker'),
),
TextButton(
onPressed: () async {
final result = await MoxxyPickerApi()
.pickFiles(FilePickerType.imageAndVideo, true);
2023-09-07 16:51:22 +00:00
// ignore: avoid_print
print('User picked: $result');
},
child: const Text('Photo/Video multi-picker'),
),
TextButton(
onPressed: () async {
final result = await MoxxyPickerApi()
.pickFiles(FilePickerType.generic, true);
2023-09-07 16:51:22 +00:00
// ignore: avoid_print
print('User picked: $result');
},
child: const Text('Generic multi-picker'),
),
],
),
),
);
}
}