pub.dev explorer
An app to explore and bookmark packages hosted on pub.dev.
Packages are shown in descending order starting from the most recently updated one
on platforms other than the web.
About this app
This is a sample app using the following packages created by the same author.
The app shows an example of how those packages are combined. The author himself, however, is
still examining and considering how they are made good use of to make the app more maintainable
and easier to evolve, so the current app design is not necessarily the best.
- pot
- An easy and safe DI solution.
- This is a little similar to providers of pkg:riverpod in that the instance is assigned
to a global variable and can be accessed from anywhere, but different in that a Pot is
just a service locator with only a few handy features but with no complexity.
- grab
- A package to control rebuilds of a widget based on updates of a
Listenable
such as
ChangeNotifier
andValueNotifier
. - Usage is similar to
watch()
andselect()
of pkg:provider used onBuildContext
,
but Grab does not depend on the widget tree. - Take it as an extension method version of
ValueListenableBuilder
with filtering.
- A package to control rebuilds of a widget based on updates of a
- async_phase_notifier
- A variant of
ValueNotifier
very similar to AsyncNotifier of pkg:riverpod. AsyncPhase
has one more phase “initial”, which AsyncValue of Riverpod does not have.AsyncPhaseNotifier
provides a way to listen to errors, and there is alsoAsyncErrorListener
that is a widget with an error handler, convenient for imperatively showing a message
(e.g. showing a SnackBar) or for logging.
- A variant of
- custom_text
- A highly customisable text widget that decorates strings and enables tap / long-press /
hover actions flexibly based on regular expression patterns. - Such decorations and actions are available even in text editing with
CustomTextEditingController
,
although the controller is not used in this app.
- A highly customisable text widget that decorates strings and enables tap / long-press /
How to run
If you change some classes from which code is generated, run the command below to generate
updated code.
$ flutter pub run build_runner build -d
This project already contains the code generated by build_runner, so if you haven’t changed
anything, the above command is unnecessary.
To start the app, just run flutter run
, with additional options if necessary.
Mock data for the web
The pub.dev API is not available on the web unfortunately, so mock data preset in the app
is used instead. The data contains the packages by the author and 150 most popular packages.
Mock data on other platforms
To use the data on other platforms, pass the USE_MOCK
environment variable as below:
flutter run --dart-define=USE_MOCK=true