Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ app.*.map.json
/android/app/release

packages/*/pubspec.lock

# Generated by flutter gen-l10n
/lib/l10n/S*.dart
51 changes: 14 additions & 37 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,41 +1,22 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 32 // flutter.compileSdkVersion
namespace 'io.github.pd4d10.gittouch'
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

sourceSets {
Expand All @@ -47,10 +28,10 @@ android {
applicationId "io.github.pd4d10.gittouch"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 19 // flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
minSdk flutter.minSdkVersion
targetSdk flutter.targetSdkVersion
versionCode flutter.versionCode
versionName flutter.versionName
}

buildTypes {
Expand All @@ -65,7 +46,3 @@ android {
flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.pd4d10.gittouch">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.pd4d10.gittouch">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="GitTouch"
android:name="${applicationName}"
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.pd4d10.gittouch">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
15 changes: 1 addition & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand All @@ -26,6 +13,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.newDsl=false
android.builtInKotlin=false
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "9.1.0" apply false
id "org.jetbrains.kotlin.android" version "2.4.0" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/theme.dart';
import 'package:git_touch/router.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/home.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/notification.dart';
Expand All @@ -26,7 +26,7 @@ import 'package:git_touch/screens/gt_user.dart';
import 'package:git_touch/screens/login.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:github/github.dart';
import 'package:launch_review/launch_review.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:pub_semver/pub_semver.dart';
Expand Down Expand Up @@ -62,7 +62,7 @@ class _HomeState extends State<Home> {
if (res == true) {
if (Platform.isIOS) {
// go to app store
LaunchReview.launch(writeReview: false);
InAppReview.instance.openStoreListing(appStoreId: '1452042346');
} else {
context.pushUrl(latest.htmlUrl!);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
"description": "no. of commits to a branch",
"placeholders": {
"count": {
"type": "String"
"type": "int"
}
}
},
Expand Down Expand Up @@ -657,7 +657,7 @@
"@editedPages": {
"description": "edited pages",
"placeholders": {
"pageAction": {
"pageNames": {
"type": "String"
}
}
Expand Down Expand Up @@ -841,7 +841,7 @@
"description": "no. of files changed",
"placeholders": {
"count": {
"type": "String"
"type": "int"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions lib/models/auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'package:gql_http_link/gql_http_link.dart';
import 'package:http/http.dart' as http;
import 'package:nanoid/nanoid.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uni_links/uni_links.dart';
import 'package:app_links/app_links.dart';
// import 'package:in_app_review/in_app_review.dart';
import 'package:universal_io/io.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -607,7 +607,7 @@ class AuthModel with ChangeNotifier {

Future<void> init() async {
// Listen scheme
_sub = uriLinkStream.listen(_onSchemeDetected, onError: (err) {
_sub = AppLinks().uriLinkStream.listen(_onSchemeDetected, onError: (err) {
Fimber.e('getUriLinksStream failed', ex: err);
});

Expand Down
70 changes: 55 additions & 15 deletions lib/models/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:antd_mobile/antd_mobile.dart';
import 'package:fimber/fimber.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/action_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
Expand Down Expand Up @@ -276,23 +276,63 @@ class ThemeModel with ChangeNotifier {
}

showActions(BuildContext context, List<ActionItem> actionItems) async {
await AntActionSheet.show(
// Same layout as AntActionSheet.show, plus a bottom SafeArea: with
// targetSdk 35+ the app is drawn edge-to-edge, and without it the last
// action sits under the gesture navigation bar.
await AntPopup.show(
context: context,
extra: const Text('Actions'),
actions: [
for (final item in actionItems)
AntActionSheetAction(
text: Text(
item.text!,
style: TextStyle(
color: item.danger ? AntTheme.of(context).colorDanger : null),
closeOnMaskClick: true,
builder: (popupContext) {
final theme = AntTheme.of(popupContext);
return ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
child: Container(
color: theme.colorBackground,
child: SafeArea(
top: false,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 18),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: 1, color: theme.colorBorder),
),
),
child: Center(
child: DefaultTextStyle(
style: TextStyle(
color: theme.colorWeak, fontSize: theme.fontSize7),
child: const Text('Actions'),
),
),
),
for (final item in actionItems)
AntActionSheetItem(
action: AntActionSheetAction(
text: Text(
item.text!,
style: TextStyle(
color: item.danger ? theme.colorDanger : null),
),
onClick: () {
item.onTap?.call(context);
},
key: null,
),
),
],
),
),
onClick: () {
item.onTap?.call(context);
},
key: null,
),
],
);
},
);
}
}
2 changes: 1 addition & 1 deletion lib/screens/bb_commits.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
import 'package:git_touch/scaffolds/list_stateful.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_explore.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
import 'package:git_touch/scaffolds/list_stateful.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_issue_comment.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/scaffolds/common.dart';
import 'package:git_touch/utils/utils.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_issue_form.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
import 'package:git_touch/scaffolds/common.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_issues.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_pulls.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
import 'package:git_touch/scaffolds/list_stateful.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:antd_mobile/antd_mobile.dart';
import 'package:filesize/filesize.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_teams.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/S.dart';
import 'package:git_touch/l10n/S.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/bitbucket.dart';
import 'package:git_touch/scaffolds/list_stateful.dart';
Expand Down
Loading