explorer 1.2.0 copy "explorer: ^1.2.0" to clipboard
explorer: ^1.2.0 copied to clipboard

outdated

Universal explorer UI for navigate files, ftp, etc. Support custom providers and any platforms c:

example/lib/main.dart

import 'dart:io';

import 'package:explorer/explorer_io.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

import 'package:explorer/explorer.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final Directory appDocDir = await getApplicationDocumentsDirectory();
  runApp(MyApp(appDocDir: appDocDir));
}

class MyApp extends StatefulWidget {
  const MyApp({
    this.appDocDir,
    Key key,
  }) : super(key: key);

  final Directory appDocDir;

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  ExplorerController _controller;
  @override
  void initState() {
    _controller = ExplorerController(
      navigator: IoNavigatorExplorer(
        entryPath: widget.appDocDir.path,
      ),
      filePressed: (file) {
        if (file.size > 200000) {
          final snackBar =
              SnackBar(content: Text('Can\'t open files with size > 200kb'));

          // Find the Scaffold in the widget tree and use it to show a SnackBar.
          ScaffoldMessenger.of(context).showSnackBar(snackBar);
          return;
        }
      },
    );

    super.initState();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) => MaterialApp(
        localizationsDelegates: [
          ExplorerLocalizationsDelegate(),
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
        ],
        supportedLocales: [
          const Locale('en', ''),
          const Locale('ru', ''),
        ],
        home: Scaffold(
          body: Explorer(
            controller: _controller,
            builder: (_) => [
              ExplorerToolbar(),
              ExplorerActionView(),
              ExplorerFilesGridView(),
            ],
          ),
        ),
      );
}
44
likes
0
points
45
downloads

Publisher

verified publisherserge.software

Weekly Downloads

Universal explorer UI for navigate files, ftp, etc. Support custom providers and any platforms c:

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

auto_animated, flutter, flutter_breadcrumb, flutter_localizations, intl, io, meta, path, sliver_tools, universal_platform

More

Packages that depend on explorer