drishya_picker 2.0.0 drishya_picker: ^2.0.0 copied to clipboard
Assets picker which is inspired by messenger camera and gallery.
import 'package:example/collapsable_gallery.dart';
import 'package:example/fullscreen_gallery.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
///
// ignore: use_key_in_widget_constructors
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: _Home(),
);
}
}
class _Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: _PickerDemo(),
);
}
}
class _PickerDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Drishya Picker')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () {
Navigator.push<void>(
context,
MaterialPageRoute(
builder: (context) => const FullscreenGallery(),
),
);
},
style: TextButton.styleFrom(
foregroundColor: Colors.white,
backgroundColor: Colors.green,
),
child: const Text('Full screen mode'),
),
const SizedBox(height: 20.0),
TextButton(
onPressed: () {
Navigator.push<void>(
context,
MaterialPageRoute(
builder: (context) => const CollapsableGallery(),
),
);
},
style: TextButton.styleFrom(
foregroundColor: Colors.white,
backgroundColor: Colors.green,
),
child: const Text('Collapsable mode'),
),
const SizedBox(height: 20.0),
],
),
),
);
}
}