Skip to content
Merged
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
21 changes: 10 additions & 11 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

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) {
Expand All @@ -27,12 +29,8 @@ if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

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

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 36

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -50,7 +48,7 @@ android {
defaultConfig {
applicationId "com.realitymod.prspy"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.compileSdkVersion
targetSdkVersion 36
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -68,12 +66,13 @@ android {
signingConfig signingConfigs.release
}
}
namespace 'com.realitymod.prspy'
}

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="com.realitymod.prspy">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter 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="com.realitymod.prspy">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="PRSPY"
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="com.realitymod.prspy">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.22'
repositories {
google()
mavenCentral()
}

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

allprojects {
repositories {
google()
Expand Down
3 changes: 3 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.nonTransitiveRClass=false
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Wed Jul 09 18:54:26 AMT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.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" // apply true
id "com.android.application" version '8.9.0' apply false
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
}

include ":app"
Binary file added assets/images/faction_flags/chechen90.png
Loading
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/faction_flags/chinsurgent90.png
Loading
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/faction_flags/ru90.png
Loading
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/faction_flags/ww2ger41.png
Loading
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/faction_flags/ww2rus.png
Loading
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/faction_flags/ww2rusearly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 35 additions & 47 deletions lib/models/faction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,53 +28,41 @@ class Faction {
///
factory Faction.fromCode({required String code}) {
code = code.toLowerCase();
late Faction team;
if (code == 'vnnva') {
team = Faction(code: code, name: 'North Vietnamese Army');
} else if (code == 'vnusa' || code == 'usa' || code == 'ww2usa') {
team = Faction(code: code, name: 'United States Army');
} else if (code == 'ch') {
team = Faction(code: code, name: 'Chinese Forces');
} else if (code == 'us' || code == 'vnusmc') {
team = Faction(code: code, name: 'USMC');
} else if (code == 'ru') {
team = Faction(code: code, name: 'Russian Armed Forces');
} else if (code == 'meinsurgent') {
team = Faction(code: code, name: 'Insurgents');
} else if (code == 'gb' || code == 'gb82') {
team = Faction(code: code, name: 'British Armed Forces');
} else if (code == 'mec') {
team = Faction(code: code, name: 'Middle Eastern Coalition');
} else if (code == 'hamas') {
team = Faction(code: code, name: 'Hamas');
} else if (code == 'idf') {
team = Faction(code: code, name: 'Israeli Defence Force');
} else if (code == 'nl') {
team = Faction(code: code, name: 'Dutch Armed Forces');
} else if (code == 'pl') {
team = Faction(code: code, name: 'Polish Armed Forces');
} else if (code == 'ger') {
team = Faction(code: code, name: 'German Forces');
} else if (code == 'chinsurgent') {
team = Faction(code: code, name: 'Militia');
} else if (code == 'cf') {
team = Faction(code: code, name: 'Canadian Forces');
} else if (code == 'taliban') {
team = Faction(code: code, name: 'Taliban');
} else if (code == 'ww2ger') {
team = Faction(code: code, name: 'Wehrmacht');
} else if (code == 'arg82') {
team = Faction(code: code, name: 'Argentine Armed Forces');
} else if (code == 'fsa') {
team = Faction(code: code, name: 'Syrian Rebels');
} else if (code == 'fr') {
team = Faction(code: code, name: 'French Forces');
} else if (code == 'arf') {
return Faction(code: code, name: 'African Resistance Fighters');
} else {
team = Faction(code: code, name: 'Unknown Faction');
}
return team;
const Map<String, String> factionMap = <String, String>{
'vnnva': 'North Vietnamese Army',
'vnusa': 'United States Army',
'usa': 'United States Army',
'ww2usa': 'United States Army',
'ch': 'Chinese Forces',
'us': 'USMC',
'vnusmc': 'USMC',
'ru': 'Russian Armed Forces',
'ru90': 'Russian Armed Forces',
'meinsurgent': 'Insurgents',
'gb': 'British Armed Forces',
'gb82': 'British Armed Forces',
'mec': 'Middle Eastern Coalition',
'hamas': 'Hamas',
'idf': 'Israeli Defence Force',
'nl': 'Dutch Armed Forces',
'pl': 'Polish Armed Forces',
'ger': 'German Forces',
'chinsurgent': 'Militia',
'chinsurgent90': 'Militia',
'cf': 'Canadian Forces',
'taliban': 'Taliban',
'ww2ger': 'Wehrmacht',
'ww2ger41': 'Wehrmacht',
'arg82': 'Argentine Armed Forces',
'fsa': 'Syrian Rebels',
'fr': 'French Forces',
'arf': 'African Resistance Fighters',
'ww2rusearly': 'Red Army',
'ww2rus': 'Red Army',
'chechen90': 'Chechnya',
};
final String name = factionMap[code] ?? 'Unknown Faction';
return Faction(code: code, name: name);
}

///
Expand Down
2 changes: 2 additions & 0 deletions lib/widgets/custom_player_detail_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ class CustomPlayerDetailModal extends StatelessWidget {
label: Text(
isFriend ? 'Remove Friend' : 'Add Friend',
textAlign: TextAlign.center,
style: const TextStyle(color: Colors.white),
),
icon: Icon(
isFriend ? Icons.person_remove : Icons.person_add,
color: Colors.white,
),
style: ElevatedButton.styleFrom(
backgroundColor:
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/custom_player_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class _CustomPlayerListState extends State<CustomPlayerList>
),
],
),
tileColor: isFriend ? Colors.blue.withOpacity(0.2) : null,
tileColor: isFriend ? Colors.blue.withValues(alpha: 0.2) : null,
onTap: () {
if (!player.isAi) {
showModalBottomSheet(
Expand Down
Loading