Skip to content

Commit

Permalink
hide the api token
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonIT committed Nov 7, 2019
1 parent c27394c commit ba36050
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 45 deletions.
75 changes: 34 additions & 41 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,38 +111,39 @@ class _TimeTrackerState extends State<TimeTracker> {
int appLaunches = prefs.getInt("appLaunches") ?? 0;
if (appLaunches > 4) {
Future.delayed(
const Duration(seconds: 10),
() => showCupertinoDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: const Text("Dir gefällt der TimeTracker?"),
content: const Text("Dann zeig es mir!"),
actions: [
CupertinoDialogAction(
isDefaultAction: true,
child: const Text("Ich lasse ein Bewertung da ⭐"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop("Rate");
AppReview.writeReview;
},
),
CupertinoDialogAction(
child: const Text("Ich kaufe dir etwas 🛒"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop("Buy");
_tabController.index = 3;
},
),
CupertinoDialogAction(
child: const Text("Alles erledigt 🎉"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop("Cancel");
prefs.setInt("appLaunches", -1);
},
),
],
),
));
const Duration(seconds: 10),
() => showCupertinoDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: const Text("Dir gefällt der TimeTracker?"),
content: const Text("Dann zeig es mir!"),
actions: [
CupertinoDialogAction(
isDefaultAction: true,
child: const Text("Ich lasse ein Bewertung da ⭐"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop("Rate");
AppReview.writeReview;
},
),
CupertinoDialogAction(
child: const Text("Ich kaufe dir etwas 🛒"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop("Buy");
_tabController.index = 3;
},
),
CupertinoDialogAction(
child: const Text("Alles erledigt 🎉"),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop("Cancel");
prefs.setInt("appLaunches", -1);
},
),
],
),
),
);
} else if (appLaunches > -1) {
prefs.setInt("appLaunches", ++appLaunches);
}
Expand Down Expand Up @@ -675,15 +676,7 @@ class _TimeTrackerState extends State<TimeTracker> {
),
),
),
CSControl(
"API Schlüssel",
Text(
api.authToken,
style: const TextStyle(
color: CupertinoColors.black,
),
),
),
CSSecret("API Schlüssel", api.authToken),
CSButton(CSButtonType.DESTRUCTIVE, "Abmelden", () {
Navigator.of(context, rootNavigator: true)
.pushReplacement(CupertinoPageRoute(builder: (BuildContext context) => CredentialsPage()))
Expand Down
8 changes: 5 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ packages:
flutter_cupertino_settings:
dependency: "direct main"
description:
name: flutter_cupertino_settings
url: "https://pub.dartlang.org"
source: hosted
path: "."
ref: secret
resolved-ref: f3ad342c6cac3a91fea3bf6c8ef5a5fa707e5d7c
url: "https://github.com/SimonIT/flutter_cupertino_settings.git"
source: git
version: "0.2.0"
flutter_easyrefresh:
dependency: "direct main"
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ dependencies:
flutter_typeahead: ^1.7.0
flutter_easyrefresh: ^2.0.4
html_unescape: ^1.0.1+3
flutter_cupertino_settings: ^0.2.0
flutter_cupertino_settings:
git:
url: https://github.com/SimonIT/flutter_cupertino_settings.git
ref: secret
url_launcher: ^5.2.2
in_app_purchase: ^0.2.2+2
app_review: ^1.0.0
Expand Down

0 comments on commit ba36050

Please sign in to comment.