Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Feature/lists (#106)
Browse files Browse the repository at this point in the history
* Add whitelist/blacklist support, fixes #76
  • Loading branch information
sterrenb committed Aug 15, 2020
1 parent 1cfdba6 commit 82d9ab4
Show file tree
Hide file tree
Showing 118 changed files with 3,071 additions and 743 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# Generated files
*.g.dart
*.freezed.dart
*.config.dart
*.iconfig.dart
/coverage

Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@

# FlutterHole #

[![Codemagic build status](https://api.codemagic.io/apps/5c659ea9c49a5000198d45f9/5c659ea9c49a5000198d45f8/status_badge.svg)](https://codemagic.io/apps/5c659ea9c49a5000198d45f9/5c659ea9c49a5000198d45f8/latest_build)
[![Codemagic build status](https://api.codemagic.io/apps/5c659ea9c49a5000198d45f9/5eca30b4261f343c0e2417c4/status_badge.svg)](https://codemagic.io/apps/5c659ea9c49a5000198d45f9/5eca30b4261f343c0e2417c4/latest_build)
[![Coverage Status](https://coveralls.io/repos/github/sterrenburg/flutterhole/badge.svg?branch=master)](https://coveralls.io/github/sterrenburg/flutterhole?branch=master)
[![MIT Licenced](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Platform](https://img.shields.io/badge/Platform-Flutter-yellow.svg)](https://flutter.io)

FlutterHole is a free third party Android application for interacting with your Pi-Hole® server.

> Note: an unstable build for Pihole v5.0 will be available on the Google Play beta channel. If you want to track the progress, take a look at [issue #69](https://github.com/sterrenburg/flutterhole/issues/69).
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=sterrenburg.github.flutterhole)
Expand All @@ -19,10 +17,6 @@ FlutterHole is a free third party Android application for interacting with your
- **Summary overview:** View top clients and the top used domains.
- **Query log:** Inspect & search your Pi-hole queries.

## Roadmap/missing features ##
- **Manage your blacklist & whitelist:** Blocking issues. See [issue #76](https://github.com/sterrenburg/flutterhole/issues/76) for progress.
- **Proxy support:** Coming soon for V5!

## Development ##
FlutterHole is developed using [Android Studio](https://developer.android.com/studio), which offers a complete, integrated IDE experience for Flutter.

Expand Down Expand Up @@ -69,7 +63,7 @@ flutter pub run flutter_launcher_icons:main

#### Generate code ####

To generate `freezed` classes `injectable` injections etc.:
To generate `freezed` classes, `injectable` injections etc.:

```shell script
flutter pub run build_runner build --delete-conflicting-outputs
Expand All @@ -94,6 +88,4 @@ flutter drive --target=test_driver/app.dart
## API ##
This application interacts with the [Pi-hole PHP API](https://discourse.pi-hole.net/t/pi-hole-api/1863).

~~A [new official API](https://github.com/pi-hole/api) is being built in Rust, but has no official release yet. Once the new API documentation becomes available, new cool features can be implemented!~~

A new API is in the works from the Pi-hole team. For progress, check the [pull request on GitHub](https://github.com/pi-hole/FTL/pull/659).
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutterhole"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
Binary file modified assets/icon/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/old_icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logos.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class KStrings {
'https://github.com/sterrenburg/flutterhole/';
static const String githubIssuesUrl =
'https://github.com/sterrenburg/flutterhole/issues/new/choose';
static const String logoDesignerUrl = 'https://mathijssterrenburg.com/';
}

class KIcons {
Expand All @@ -38,6 +39,8 @@ class KIcons {
static const IconData blockedDomains = Icons.close;
static const IconData manyQueriesLive = MaterialIcons.view_stream;
static const IconData manyQueriesLiveOptions = Ionicons.md_options;
static const IconData whitelist = MaterialCommunityIcons.check_circle;
static const IconData blacklist = MaterialCommunityIcons.close_circle;
static const IconData settings = MaterialIcons.settings;
static const IconData preferences = MaterialIcons.format_paint;
static const IconData about = MaterialCommunityIcons.heart;
Expand Down Expand Up @@ -73,6 +76,7 @@ class KIcons {
static const IconData branch = MaterialCommunityIcons.source_branch;
static const IconData color = Icons.brightness_1;

static const IconData add = Icons.add;
static const IconData share = MaterialIcons.share;
static const IconData rate = Icons.star;
static const IconData github = AntDesign.github;
Expand Down
5 changes: 5 additions & 0 deletions lib/core/convert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ DateTime dateTimeFromPiholeString(String key) =>
String piholeStringFromDateTime(DateTime key) =>
'${key.millisecondsSinceEpoch ~/ 1000}';

DateTime dateTimeFromPiholeInt(int key) =>
DateTime.fromMillisecondsSinceEpoch(key * 1000);

int piholeIntFromDateTime(DateTime key) => key.millisecondsSinceEpoch ~/ 1000;

extension DateTimeWithRelative on DateTime {
String get fromNow => Jiffy(this).fromNow();

Expand Down
17 changes: 11 additions & 6 deletions lib/core/debug/bloc_delegate.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import 'package:bloc/bloc.dart';

class _SimpleBlocDelegate extends BlocDelegate {
class _BlocObserver extends BlocObserver {
@override
void onTransition(Bloc bloc, Transition transition) {
super.onTransition(bloc, transition);
print(transition);
void onChange(Cubit cubit, Change change) {
print(change);
super.onChange(cubit, change);
}

@override
void onError(Cubit cubit, Object error, StackTrace stackTrace) {
print('$error, $stackTrace');
super.onError(cubit, error, stackTrace);
}
}

/// Print bloc transitions to stdout.
void enableBlocDelegate() =>
BlocSupervisor.delegate = _SimpleBlocDelegate();
void enableBlocObserver() => Bloc.observer = _BlocObserver();
11 changes: 5 additions & 6 deletions lib/dependency_injection.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:alice/alice.dart';
import 'package:dio/dio.dart';
import 'package:flutterhole/dependency_injection.iconfig.dart';
import 'package:flutterhole/dependency_injection.config.dart';
import 'package:get_it/get_it.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
Expand All @@ -14,7 +14,7 @@ Future<void> configure(String environment) async {
await $initGetIt(getIt, environment: environment);
}

@registerModule
@module
abstract class RegisterProdModule {
@prod
@injectable
Expand All @@ -38,8 +38,7 @@ abstract class RegisterProdModule {
@prod
@singleton
Alice get alice => Alice(
showNotification: false,
darkTheme: true,
);
showNotification: false,
darkTheme: true,
);
}

0 comments on commit 82d9ab4

Please sign in to comment.