Skip to content
Merged

Dev #25

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (keystorePropertiesFile.exists()) {

android {
namespace = "com.sleepingpanda.pulse"
compileSdk = 35
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
Expand All @@ -48,8 +48,8 @@ android {
applicationId = "com.sleepingpanda.pulse"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 21
targetSdk = 35
minSdkVersion flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
Expand Down
2 changes: 1 addition & 1 deletion lib/features/auth/repo/auth_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AuthRepo {
{required String email, required String pwd, required String url}) async {
String userKey = url == umamiUrl ? 'email' : 'username';
var res = await Requests.post(
endpoint: '$url/auth/login',
endpoint: '$url/api/auth/login',
body: {
userKey: email,
'password': pwd,
Expand Down
7 changes: 4 additions & 3 deletions lib/features/auth/screens/sign_in_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ class _SignInScreenState extends State<SignInScreen> {
data: hostUrl,
preIcon: Icons.link_rounded,
hint: 'Self-hosted url',
title: 'Host URL',
title: 'Host Domain',
type: TextInputType.emailAddress,
disabled: hostType == 'Umami Cloud',
validator: (val) {
if (!(val!.startsWith('https://'))) {
return 'The url should start with https://';
if (!(val!.startsWith('https://')) &&
!(val.startsWith('http://'))) {
return 'The url should start with https:// or http://';
}
return null;
},
Expand Down
7 changes: 3 additions & 4 deletions lib/features/sessions/repo/sessions_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:pulse/features/events/models/event.dart';
import 'package:pulse/features/sessions/model/session.dart';
import 'package:pulse/utils/endpoints.dart';
import 'package:pulse/utils/requests.dart';
import 'package:pulse/utils/utils.dart';

class SessionsRepo {
Future<List<Session>> getSessions({
Expand All @@ -19,15 +18,15 @@ class SessionsRepo {
var res = await Requests.get(
useKey: true,
endpoint:
'${Endpoints.websites.replaceAll(umamiUrl, 'https://api.umami.is/v1')}/$id/sessions?startAt=$startAt&endAt=$endAt&pageSize=20&page=${pageNumber ?? 1}');
'${Endpoints.websites.replaceAll(umamiUrl, 'https://api.umami.is/v1').replaceAll('api/', '')}/$id/sessions?startAt=$startAt&endAt=$endAt&pageSize=20&page=${pageNumber ?? 1}');
return Session.toList(res['data']);
}

Future<Session?> getSession(String websiteId, String id) async {
var res = await Requests.get(
useKey: true,
endpoint:
'${Endpoints.websites.replaceAll(umamiUrl, 'https://api.umami.is/v1')}/$websiteId/sessions/$id');
'${Endpoints.websites.replaceAll(umamiUrl, 'https://api.umami.is/v1').replaceAll('api/', '')}/$websiteId/sessions/$id');

return Session.fromJson(res);
}
Expand All @@ -43,7 +42,7 @@ class SessionsRepo {
var res = await Requests.get(
useKey: true,
endpoint:
'${Endpoints.websites.replaceAll(umamiUrl, 'https://api.umami.is/v1')}/$websiteId/sessions/$id/activity?startAt=$startAt&endAt=$endAt');
'${Endpoints.websites.replaceAll(umamiUrl, 'https://api.umami.is/v1').replaceAll('api/', '')}/$websiteId/sessions/$id/activity?startAt=$startAt&endAt=$endAt');
return Event.toList(res);
}
}
6 changes: 3 additions & 3 deletions lib/utils/endpoints.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
late String baseUrl;
String umamiUrl = 'https://cloud.umami.is/api';
String umamiUrl = 'https://cloud.umami.is';

class Endpoints {
static final String authLogin = '$baseUrl/auth/login';
static final String websites = '$baseUrl/websites';
static final String authLogin = '$baseUrl/api/auth/login';
static final String websites = '$baseUrl/api/websites';
}
2 changes: 1 addition & 1 deletion lib/widgets/custom_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CustomTextField extends StatelessWidget {
errorStyle:
kBodyTextStyle.copyWith(fontSize: 10, color: kErrorColor),
contentPadding: EdgeInsets.symmetric(
vertical: 20.0, horizontal: preIcon == null ? 10 : 0.0),
vertical: 15.0, horizontal: preIcon == null ? 10 : 0.0),
prefixStyle: kBodyTextStyle,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "A new Flutter project."
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: 1.0.7+8
version: 1.0.8+9

environment:
sdk: ^3.6.1
Expand Down
Loading