Skip to content

Commit

Permalink
opt.: update api
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed Jun 4, 2024
1 parent be52756 commit d131e06
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 38 deletions.
2 changes: 1 addition & 1 deletion lib/data/res/url.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ abstract final class Urls {
static const openaiRestoreDoc = '$repoBase/blob/main/doc/openai_restore.md';

static const backendBase = 'https://cdn.lolli.tech/gptbox/';
static const appUpdateCfg = '$backendBase/update.json';
static const appUpdateCfg = '$backendBase/update2.json';
}
65 changes: 36 additions & 29 deletions lib/view/page/home/bottom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,44 +36,24 @@ class _HomeBottom extends StatelessWidget {
onPressed: () {
_switchChat(_newChat().id);
_historyRN.build();
if (_curPage.value == HomePageEnum.history) {
_switchPage(HomePageEnum.chat);
}
},
icon: const Icon(MingCute.add_fill, size: 17),
tooltip: l10n.newChat,
),
// IconButton(
// onPressed: () => _onTapRenameChat(_curChatId, context),
// icon: const Icon(Icons.edit, size: 19),
// tooltip: l10n.rename,
// ),
IconButton(
onPressed: () => _onTapRenameChat(_curChatId, context),
icon: const Icon(Icons.edit, size: 19),
tooltip: l10n.rename,
),
// IconButton(
// onPressed: () => _onTapDeleteChat(_curChatId, context),
// icon: const Icon(Icons.delete, size: 19),
// tooltip: l10n.delete,
// ),
ListenableBuilder(
listenable: _filePicked,
builder: (_, __) {
return ListenableBuilder(
listenable: _chatType,
builder: (_, __) {
return switch (_chatType.value) {
ChatType.text || ChatType.img => Badge(
isLabelVisible: _filePicked.value != null,
child: IconButton(
onPressed: () => _onTapImgPick(context),
icon: const Icon(Icons.photo, size: 19),
),
),
// ChatType.audio => const IconButton(
// onPressed: _onTapAudioPick,
// icon: Icon(Icons.mic, size: 19),
// ),
_ => UIs.placeholder,
};
},
);
},
),
_buildFileBtn(context),
const Spacer(),
// _buildTokenCount(),
UIs.width7,
Expand All @@ -91,6 +71,33 @@ class _HomeBottom extends StatelessWidget {
);
}

Widget _buildFileBtn(BuildContext context) {
return ListenableBuilder(
listenable: _filePicked,
builder: (_, __) {
return ListenableBuilder(
listenable: _chatType,
builder: (_, __) {
return switch (_chatType.value) {
ChatType.text || ChatType.img => Badge(
isLabelVisible: _filePicked.value != null,
child: IconButton(
onPressed: () => _onTapImgPick(context),
icon: const Icon(Icons.image, size: 19),
),
),
// ChatType.audio => const IconButton(
// onPressed: _onTapAudioPick,
// icon: Icon(Icons.mic, size: 19),
// ),
_ => UIs.placeholder,
};
},
);
},
);
}

Widget _buildTextField(BuildContext context) {
return Input(
controller: _inputCtrl,
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,16 @@ packages:
path: "."
ref: "v1.0.13"
resolved-ref: baded8103bd046806929b8d6547d5bce38060b06
url: "https://github.com/lollipopkit/fl_build.git"
url: "https://github.com/lppcg/fl_build.git"
source: git
version: "1.0.0"
fl_lib:
dependency: "direct main"
description:
path: "."
ref: "v1.0.28"
resolved-ref: "391a9bf38c6971700bac9037dd9d5cc8698fc6fe"
url: "https://github.com/lollipopkit/fl_lib"
ref: "v1.0.31"
resolved-ref: f6322c5c2fad5230d1a882e79d52d1a0d246b8f4
url: "https://github.com/lppcg/fl_lib"
source: git
version: "0.0.1"
flutter:
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: gpt_box
description: "A third-party GPT Client for OpenAI API on all platforms."
description: "A third-party GPT Client for OpenAI API."
publish_to: 'none'
version: 1.0.0+1

Expand Down Expand Up @@ -28,8 +28,8 @@ dependencies:
audioplayers: ^6.0.0
fl_lib:
git:
url: https://github.com/lollipopkit/fl_lib
ref: v1.0.28
url: https://github.com/lppcg/fl_lib
ref: v1.0.31
# path: ../fl_lib
extended_image: ^8.2.1
app_links: ^6.1.1
Expand All @@ -43,7 +43,7 @@ dev_dependencies:
flutter_native_splash: ^2.3.9
fl_build:
git:
url: https://github.com/lollipopkit/fl_build.git
url: https://github.com/lppcg/fl_build.git
ref: v1.0.13
# path: ../fl_build

Expand Down

0 comments on commit d131e06

Please sign in to comment.