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
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
.dart_tool/
.packages
build/
release/
*.apk
*.aab
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock

Expand All @@ -28,12 +31,8 @@ doc/api/
lib/firebase_options.dart
*.exe
android/app/google-services.json
.idea/caches/deviceStreaming.xml
.idea/caches/deviceStreaming.xml
.idea/deviceManager.xml
.idea/caches/
firebase.json
.idea/deviceManager.xml
android/.kotlin/sessions/kotlin-compiler-11069125661880765564.salive
.idea/caches/deviceStreaming.xml
.idea/deviceManager.xml
android/.kotlin/
/.tmp.driveupload
16 changes: 11 additions & 5 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,23 @@ android {

signingConfigs {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String
if (keystorePropertiesFile.exists()) {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String
}
}
}
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.getByName("release")
signingConfig = if (keystorePropertiesFile.exists()) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")
}
}
debug {
signingConfig = signingConfigs.getByName("debug")
Expand Down
4 changes: 2 additions & 2 deletions assets/additional_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"type": "link",
"collection": "appdocs",
"name": "Application's Google Store page",
"value": "https://play.google.com/store/apps/details?id=page.puzzak.geminilocal"
"value": "https://play.google.com/store/apps/details?id=page.puzzak.paios"
},
{
"type": "link",
"collection": "appdocs",
"name": "Developer's Website",
"value": "https://puzzak.page"
}
]
]
2 changes: 0 additions & 2 deletions lib/engine.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:convert';

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -636,7 +635,6 @@ class AIEngine with md.ChangeNotifier {
status = "Sending prompt...";
notifyListeners();

final int runTokens = chatData.chats.containsKey(currentChat) && chatData.chats[currentChat].containsKey("chatTokens") ? chatData.chats[currentChat]["chatTokens"] : tokens;
double runTemperature = chatData.chats.containsKey(currentChat) && chatData.chats[currentChat].containsKey("chatTemperature") ? chatData.chats[currentChat]["chatTemperature"] : temperature;

final stream = gemini.generateTextEvents(
Expand Down
10 changes: 5 additions & 5 deletions lib/pages/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class ChatPage extends StatefulWidget {
}

class ChatPageState extends State<ChatPage> {
text tWid = text();
@override
final TextBlocks textBlocks = TextBlocks();

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -104,7 +104,7 @@ class ChatPageState extends State<ChatPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: tWid.chatlog(
children: textBlocks.chatlog(
conversation: [
{
"user": "User",
Expand Down Expand Up @@ -136,7 +136,7 @@ class ChatPageState extends State<ChatPage> {
lastUser: ""
),
),
text.infoShort(
TextBlocks.infoShort(
title: engine.dict.value("welcome"),
context: context,
subtitle: "",
Expand All @@ -146,7 +146,7 @@ class ChatPageState extends State<ChatPage> {
)
: Column(
children: [
...tWid.chatlog(
...textBlocks.chatlog(
conversation: engine.context,
context: context,
aiChunk: engine.responseText,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class ChatsPageState extends State<ChatsPage> {
}).toList().whereNot((crd) => crd == null).cast<Widget>(),
]
),
text.info(
TextBlocks.info(
title: engine.isLoading?engine.dict.value("still_generating"):engine.dict.value(engine.chats.isEmpty?"no_chats":"chats_desc").replaceAll("%chatnum%", engine.chats.length.toString()),
subtitle: engine.chats.isEmpty?engine.dict.value("new_chat"):"",
action: engine.chats.isNotEmpty?(){}:engine.isLoading?(){}:(){
Expand Down Expand Up @@ -303,4 +303,4 @@ class ChatsPageState extends State<ChatsPage> {
)
);
}
}
}
12 changes: 7 additions & 5 deletions lib/pages/intro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class IntroPageState extends State<IntroPage> {
]),
if(engine.modelDownloadLog.isNotEmpty)
if(engine.modelDownloadLog[engine.modelDownloadLog.length-1]["info"] == "downloading_model")
text.infoShort(
TextBlocks.infoShort(
title: engine.dict.value("welcome_gtfo"),
subtitle: "",
action: () {},
Expand Down Expand Up @@ -257,9 +257,11 @@ class IntroPageState extends State<IntroPage> {
title: language["origin"],
subtitle: language["name"] == language["origin"] ? "" : language["name"],
action: () async {
final navigator = Navigator.of(dialogContext);
await engine.dict.saveLanguage(language["id"]);
if (!mounted) return;
setState(() {});
Navigator.of(dialogContext).pop();
navigator.pop();
}
);
}).toList().cast<Widget>()
Expand Down Expand Up @@ -303,7 +305,7 @@ class IntroPageState extends State<IntroPage> {
SizedBox(height: 20,),
if(engine.modelDownloadLog.isNotEmpty)
if(engine.modelDownloadLog[engine.modelDownloadLog.length-1]["status"] == "Download")
text.info(
TextBlocks.info(
title: engine.dict.value("welcome_download").replaceAll("%size%", convertSize(engine.usualModelSize, false)),
subtitle: "",
action: () {},
Expand All @@ -312,7 +314,7 @@ class IntroPageState extends State<IntroPage> {

if(engine.modelDownloadLog.isNotEmpty)
if(!(engine.modelDownloadLog[engine.modelDownloadLog.length-1]["status"] == "Download"))
text.info(
TextBlocks.info(
title: engine.modelInfo["version"] == null
? engine.dict.value("welcome_unavailable")
: engine.modelInfo["version"] == "Unknown"
Expand Down Expand Up @@ -343,4 +345,4 @@ class IntroPageState extends State<IntroPage> {
);
});
}
}
}
10 changes: 5 additions & 5 deletions lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import 'package:geminilocal/pages/settings/prompts.dart';
import 'package:geminilocal/pages/settings/resources.dart';
import 'package:geminilocal/storage/file_access_service.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../engine.dart';
import 'support/elements.dart';
import 'package:intl/intl.dart';
import 'package:geminilocal/pages/settings/model.dart';


Expand Down Expand Up @@ -91,9 +89,11 @@ class SettingsPageState extends State<SettingsPage> {
title: language["origin"],
subtitle: language["name"] == language["origin"] ? "" : language["name"],
action: () async {
final navigator = Navigator.of(dialogContext);
await engine.dict.saveLanguage(language["id"]);
if (!mounted) return;
setState(() {});
Navigator.of(dialogContext).pop();
navigator.pop();
}
);
}).toList().cast<Widget>()
Expand Down Expand Up @@ -212,7 +212,7 @@ class SettingsPageState extends State<SettingsPage> {
}
),
]),
text.info(
TextBlocks.info(
title: engine.dict.value("prompt_dir_desc"),
context: context,
subtitle: "",
Expand All @@ -230,4 +230,4 @@ class SettingsPageState extends State<SettingsPage> {
)
);
}
}
}
4 changes: 2 additions & 2 deletions lib/pages/settings/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class ChatSettingsPageState extends State<ChatSettingsPage> {
value: engine.chats[engine.currentChat]?["shareLocale"] ?? engine.shareLocale
),
]),
text.info(
TextBlocks.info(
title: engine.dict.value("chat_settings_desc"),
subtitle: engine.dict.value("chat_settings_subtitle"),
action: (){
Expand All @@ -355,4 +355,4 @@ class ChatSettingsPageState extends State<ChatSettingsPage> {
),
);
}
}
}
4 changes: 2 additions & 2 deletions lib/pages/settings/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ModelSettingsContextState extends State<ModelSettingsContext> {
data: engine.testPrompt.split("replaceme")[1],
),
),
text.info(
TextBlocks.info(
title: engine.dict.value("instructions_desc"),
context: context,
subtitle: engine.dict.value("recommend_changes_gh"),
Expand All @@ -115,4 +115,4 @@ class ModelSettingsContextState extends State<ModelSettingsContext> {
)
);
}
}
}
8 changes: 2 additions & 6 deletions lib/pages/settings/logs.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';
import '../../engine.dart';
import '../settings.dart';
import '../support/elements.dart';


Expand Down Expand Up @@ -105,7 +101,7 @@ class LogsPageState extends State<LogsPage> {
);
}).toList().reversed.toList(),
),
text.info(
TextBlocks.info(
title: engine.dict.value(engine.analytics?"logs_info_analytics":"logs_info_local"),
subtitle: "",
action: (){},
Expand All @@ -122,4 +118,4 @@ class LogsPageState extends State<LogsPage> {
),
);
}
}
}
4 changes: 2 additions & 2 deletions lib/pages/settings/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ModelSettingsState extends State<ModelSettings> {
value: engine.shareLocale
),
]),
text.info(
TextBlocks.info(
title: engine.dict.value("welcome_available"),
context: context,
subtitle: "",
Expand All @@ -119,4 +119,4 @@ class ModelSettingsState extends State<ModelSettings> {
)
);
}
}
}
2 changes: 1 addition & 1 deletion lib/pages/settings/prompt_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class PromptEditorPageState extends State<PromptEditorPage> {
},
)
),
text.infoShort(
TextBlocks.infoShort(
title: engine.dict.value("prompt_md_desc"),
subtitle: engine.dict.value("prompt_md_docs_link"),
action: () async {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings/prompt_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class PromptViewerPageState extends State<PromptViewerPage> {
),
if ((description != null && description.isNotEmpty) && (author != null && author.isNotEmpty) && updatedStr.isNotEmpty) ...[
SliverToBoxAdapter(
child: text.info(
child: TextBlocks.info(
title: "$description\n${engine.dict.value("by_author").replaceAll("%author%", author)}\n${engine.dict.value("prompt_last_updated")}: $updatedStr",
context: context,
subtitle: "",
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings/prompts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class PromptsPageState extends State<PromptsPage> {
}
)
]),
text.infoShort(
TextBlocks.infoShort(
title: engine.dict.value("prompt_manager_info"),
subtitle: "",
action: () {},
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/settings/resources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SettingsResourcesState extends State<SettingsResources> {
);
}).toList(),
),
text.info(
TextBlocks.info(
title: engine.dict.value("settings_info").replaceAll("%year%", DateFormat('yyyy').format(DateTime.now())),
context: context,
subtitle: engine.dict.value("gh_repo"),
Expand All @@ -96,4 +96,4 @@ class SettingsResourcesState extends State<SettingsResources> {
)
);
}
}
}
8 changes: 4 additions & 4 deletions lib/pages/support/elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ class Category {



class text {
class TextBlocks {
static Widget info({
required String title,
required String subtitle,
Expand Down Expand Up @@ -781,8 +781,8 @@ class text {
}
}
if(line["user"] == "Gemini"){
String AIMessage = line["message"];
if(!(AIMessage == aiChunk) && !(AIMessage == "")) {
String aiMessage = line["message"];
if(!(aiMessage == aiChunk) && !(aiMessage == "")) {
splits.add(
Row(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down Expand Up @@ -813,7 +813,7 @@ class text {
);
},
selectable: true,
data: AIMessage,
data: aiMessage,
),
),
),
Expand Down
Loading