Skip to content

Commit

Permalink
redesign UI and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshu.creator.dev committed May 18, 2024
1 parent 9912f98 commit 8e760cb
Show file tree
Hide file tree
Showing 24 changed files with 210 additions and 318 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: Delta-latest-windows.zip
filename: Delta-2.2.${{ github.run_number }}-windows.zip
directory: build/windows/x64/runner/Release
- name: Push to Releases
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/*,build/windows/x64/runner/Release/Delta-latest-windows.zip"
artifacts: "build/app/outputs/flutter-apk/*,build/windows/x64/runner/Release/Delta-2.2.${{ github.run_number }}-windows.zip"
tag: v2.2.${{ github.run_number }}
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 0 additions & 14 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@
];
idx.previews = {
previews = {
web = {
command = [
"flutter"
"run"
"--machine"
"-d"
"web-server"
"--web-hostname"
"0.0.0.0"
"--web-port"
"$PORT"
];
manager = "flutter";
};
android = {
command = [
"flutter"
Expand Down
29 changes: 7 additions & 22 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
channel: stable
revision: "87b652410dbf20003c437ab6512118622d95770f"
channel: "beta"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
create_revision: 87b652410dbf20003c437ab6512118622d95770f
base_revision: 87b652410dbf20003c437ab6512118622d95770f
- platform: android
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: ios
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: linux
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: macos
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: web
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: windows
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
create_revision: 87b652410dbf20003c437ab6512118622d95770f
base_revision: 87b652410dbf20003c437ab6512118622d95770f

# User provided section

Expand Down
74 changes: 27 additions & 47 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,78 +1,58 @@
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 localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
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')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = "1"
}

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

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



android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion
buildToolsVersion "23.0.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}
namespace = "tech.p7u.delta"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.pv.delta"
applicationId "tech.p7u.delta"
// 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 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}



buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.material:material:1.7.0'

source = "../.."
}
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pv.delta">
package="tech.p7u.delta">
<!-- 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.
-->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<queries>
<intent>
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pv.delta">
package="tech.p7u.delta">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
6 changes: 0 additions & 6 deletions android/app/src/main/kotlin/com/soms/answerit/MainActivity.kt

This file was deleted.

5 changes: 5 additions & 0 deletions android/app/src/main/kotlin/tech/p7u/delta/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package tech.p7u.delta

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pv.delta">
package="tech.p7u.delta">
<!-- 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
18 changes: 2 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
buildscript {
ext.kotlin_version = '1.8.22'

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()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-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 "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion lib/basics/credits_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CreditsScreen extends StatelessWidget {
OutlinedButton(
onPressed: () {
Share.share(
'check out all new app solves all questions answer with the help of AI. https://github.com/codebyps/delta/releases',
'check out all new app solves all questions answer with the help of AI. https://github.com/priyanshuverma-dev/delta/releases',
subject: 'Delta App',
);
},
Expand Down
17 changes: 10 additions & 7 deletions lib/features/Chat/server/services.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore_for_file: avoid_print

import 'package:delta/utils/Failure.dart';
import 'package:delta/utils/failure.dart';
import 'package:delta/utils/type_defs.dart';
import 'package:flutter_gemini/flutter_gemini.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand All @@ -16,21 +16,24 @@ class GPTServices {
const GPTServices({required Gemini gemini}) : _gemini = gemini;

FutureEither<String?> fetchChatAns({
required prompt,
required String prompt,
}) async {

try {
final response = await _gemini.text(prompt);
return right(response?.output);
_gemini
.streamGenerateContent(prompt)
.listen((value) {})
.onError((e) {});
// return right(response.first.toString());
return right("");
} on GeminiException catch (err) {
print('catch error ->${err.message}');
return left(
Failure(
err.message.toString(),
err.hashCode,
err.statusCode ?? 00,
),
);
} catch (e) {
} catch (e) {
print('catch error ->$e');
return left(
Failure(
Expand Down
Loading

0 comments on commit 8e760cb

Please sign in to comment.