fget_file 1.0.1 fget_file: ^1.0.1 copied to clipboard
Flutter file selector ,sorted by last accessed time ,supports multiple selection, all file types compatible with Android 10/11 system, examples in the example directory.
import 'package:fget_file/config_model.dart';
import 'package:flutter/material.dart';
import 'package:fget_file/fget_file_page.dart';
import 'package:flutter/services.dart';
void main() {
SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Colors.transparent,statusBarIconBrightness: Brightness.dark),);
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Builder(builder: (context){
return Scaffold(
appBar: AppBar(title: Text("文件筛选"),),
backgroundColor: Colors.white,
body: Padding(
padding: EdgeInsets.all(15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MaterialButton(
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context)=>
FgetFilePage(
configModel: ConfigModel(
types: ["mp4",]
),
callback: (v){
print(v);
},
),
),
);
},
child: Text("-打开文件筛选器-"),
color: Colors.blue,
),
Text("当前筛选的文件:"),
],
),
),
);
})
);
}
}