A framework for building convergent cross-platform Nextcloud clients using Flutter.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

part of '../neon_files.dart';
3 years ago
class FilesMainPage extends StatefulWidget {
const FilesMainPage({
super.key,
});
@override
State<FilesMainPage> createState() => _FilesMainPageState();
}
class _FilesMainPageState extends State<FilesMainPage> {
late FilesBloc bloc;
3 years ago
@override
void initState() {
super.initState();
bloc = NeonProvider.of<FilesBloc>(context);
3 years ago
bloc.errors.listen((final error) {
NeonError.showSnackbar(context, error);
3 years ago
});
}
@override
Widget build(final BuildContext context) => Scaffold(
body: FilesBrowserView(
bloc: bloc.browser,
filesBloc: bloc,
),
floatingActionButton: FloatingActionButton(
onPressed: () async {
await showDialog<void>(
context: context,
builder: (final context) => FilesChooseCreateDialog(
bloc: bloc,
basePath: bloc.browser.uri.value,
),
);
},
tooltip: FilesLocalizations.of(context).uploadFiles,
child: const Icon(Icons.add),
),
3 years ago
);
}