agent-flutter 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-flutter",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Portable Flutter skill/rule pack initializer for multiple AI IDEs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -205,20 +205,16 @@ run_fvm() {
205
205
  ensure_fvm() {
206
206
  append_path_once "$HOME/.pub-cache/bin"
207
207
 
208
- if discover_working_fvm; then
209
- return
208
+ if ! discover_working_fvm; then
209
+ ensure_dart
210
210
  fi
211
211
 
212
- ensure_dart
213
-
214
- if discover_working_fvm; then
215
- return
212
+ if ! discover_working_fvm; then
213
+ echo "Installing FVM..."
214
+ dart pub global activate fvm >/dev/null
215
+ append_path_once "$HOME/.pub-cache/bin"
216
216
  fi
217
217
 
218
- echo "Installing FVM..."
219
- dart pub global activate fvm >/dev/null
220
- append_path_once "$HOME/.pub-cache/bin"
221
-
222
218
  if ! discover_working_fvm; then
223
219
  echo "Error: FVM installation failed or fvm is not runnable." >&2
224
220
  exit 1
@@ -873,7 +869,10 @@ EOF
873
869
 
874
870
  cat >lib/src/enums/toast_type.dart <<'EOF'
875
871
  import 'package:flutter/material.dart';
872
+ import 'package:get/get.dart';
876
873
 
874
+ import '../extensions/int_extensions.dart';
875
+ import '../locale/locale_key.dart';
877
876
  import '../utils/app_colors.dart';
878
877
 
879
878
  enum ToastType {
@@ -882,6 +881,31 @@ enum ToastType {
882
881
 
883
882
  final Color color;
884
883
  const ToastType(this.color);
884
+
885
+ Widget get icon {
886
+ IconData icon;
887
+ switch (this) {
888
+ case ToastType.success:
889
+ icon = Icons.check_circle_rounded;
890
+ break;
891
+ case ToastType.error:
892
+ icon = Icons.error_rounded;
893
+ }
894
+
895
+ return Padding(
896
+ padding: 20.paddingLeft,
897
+ child: Icon(icon, size: 40, color: color),
898
+ );
899
+ }
900
+
901
+ Widget get title {
902
+ switch (this) {
903
+ case ToastType.success:
904
+ return Text(LocaleKey.success.tr, style: TextStyle(color: color));
905
+ case ToastType.error:
906
+ return Text(LocaleKey.error.tr, style: TextStyle(color: color));
907
+ }
908
+ }
885
909
  }
886
910
  EOF
887
911
 
@@ -1014,6 +1038,8 @@ class LocaleKey {
1014
1038
 
1015
1039
  static const String homeTitle = 'home_title';
1016
1040
  static const String loginSessionExpires = 'loginSessionExpires';
1041
+ static const String success = 'success';
1042
+ static const String error = 'error';
1017
1043
  static const String ok = 'ok';
1018
1044
  static const String cancel = 'cancel';
1019
1045
  static const String widgetCancel = 'widgetCancel';
@@ -1027,6 +1053,8 @@ import 'locale_key.dart';
1027
1053
  final Map<String, String> enUs = <String, String>{
1028
1054
  LocaleKey.homeTitle: 'Home',
1029
1055
  LocaleKey.loginSessionExpires: 'Login session expires!',
1056
+ LocaleKey.success: 'Success',
1057
+ LocaleKey.error: 'Error',
1030
1058
  LocaleKey.ok: 'OK',
1031
1059
  LocaleKey.cancel: 'Cancel',
1032
1060
  LocaleKey.widgetCancel: 'Cancel',
@@ -1040,6 +1068,8 @@ import 'locale_key.dart';
1040
1068
  final Map<String, String> jaJp = <String, String>{
1041
1069
  LocaleKey.homeTitle: 'ホーム',
1042
1070
  LocaleKey.loginSessionExpires: 'ログインセッションが期限切れです!',
1071
+ LocaleKey.success: '成功',
1072
+ LocaleKey.error: 'エラー',
1043
1073
  LocaleKey.ok: 'OK',
1044
1074
  LocaleKey.cancel: 'キャンセル',
1045
1075
  LocaleKey.widgetCancel: 'キャンセル',