diff --git a/lib/controllers/model_controller.dart b/lib/controllers/model_controller.dart index a6abaaa..4766312 100644 --- a/lib/controllers/model_controller.dart +++ b/lib/controllers/model_controller.dart @@ -504,7 +504,7 @@ class ModelController extends GetxController { _manager.addCustomModel(model); - final sizeStr = sizeGb > 0 ? ' (${sizeGb} GB)' : ''; + final sizeStr = sizeGb > 0 ? ' ($sizeGb GB)' : ''; Get.snackbar('Model Added', '$name$sizeStr added to your library!', snackPosition: SnackPosition.BOTTOM); } diff --git a/lib/screens/api_endpoints_screen.dart b/lib/screens/api_endpoints_screen.dart index 5de8b84..dfe29d8 100644 --- a/lib/screens/api_endpoints_screen.dart +++ b/lib/screens/api_endpoints_screen.dart @@ -76,9 +76,9 @@ class _ApiEndpointsScreenState extends State { Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( - color: running ? AppColors.green.withOpacity(0.1) : AppColors.red.withOpacity(0.1), + color: running ? AppColors.green.withValues(alpha: 0.1) : AppColors.red.withValues(alpha: 0.1), border: Border.all( - color: running ? AppColors.green.withOpacity(0.3) : AppColors.red.withOpacity(0.3), + color: running ? AppColors.green.withValues(alpha: 0.3) : AppColors.red.withValues(alpha: 0.3), ), borderRadius: BorderRadius.circular(12), ), @@ -201,7 +201,7 @@ class _ApiEndpointsScreenState extends State { Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( - color: methodColor.withOpacity(0.15), + color: methodColor.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(6), ), child: Text( diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index c6be4b2..d6cf0f8 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -358,7 +358,7 @@ class _HomeScreenState extends State { onDestinationSelected: (i) => setState(() => _mobileTabIndex = i), backgroundColor: Colors.transparent, elevation: 0, - indicatorColor: AppColors.accent.withOpacity(0.15), + indicatorColor: AppColors.accent.withValues(alpha: 0.15), labelBehavior: NavigationDestinationLabelBehavior.alwaysShow, height: 64, destinations: [ @@ -655,9 +655,9 @@ class _HomeScreenState extends State { height: 32, decoration: BoxDecoration( color: isActive - ? AppColors.green.withOpacity(0.15) + ? AppColors.green.withValues(alpha: 0.15) : isLoading - ? AppColors.orange.withOpacity(0.15) + ? AppColors.orange.withValues(alpha: 0.15) : context.bgHover, borderRadius: BorderRadius.circular(8), ), @@ -815,7 +815,7 @@ class _HomeScreenState extends State { ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - color: context.bgHover.withOpacity(0.5), + color: context.bgHover.withValues(alpha: 0.5), ), child: Row( mainAxisSize: MainAxisSize.min, @@ -1045,7 +1045,7 @@ class _HomeScreenState extends State { borderRadius: BorderRadius.circular(24), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(context.isDark ? 0.15 : 0.04), + color: Colors.black.withValues(alpha: context.isDark ? 0.15 : 0.04), blurRadius: 8, offset: const Offset(0, 2), ), diff --git a/lib/screens/model_library_screen.dart b/lib/screens/model_library_screen.dart index b07be71..80d1e00 100644 --- a/lib/screens/model_library_screen.dart +++ b/lib/screens/model_library_screen.dart @@ -122,7 +122,6 @@ class _ModelLibraryBodyState extends State<_ModelLibraryBody> { filtered = allCatalog.where((m) => m.isCustom).toList(); break; case _Filter.all: - default: filtered = allCatalog; } @@ -527,7 +526,7 @@ class _ImportButton extends StatelessWidget { width: 40, height: 40, decoration: BoxDecoration( - color: color.withOpacity(0.15), + color: color.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(10), ), child: Icon(icon, color: color, size: 20), @@ -563,7 +562,7 @@ class _ImportButton extends StatelessWidget { labelText: 'Model Name', labelStyle: TextStyle(color: context.textD, fontSize: 13), hintText: 'e.g. Mistral 7B Uncensored', - hintStyle: TextStyle(color: context.textD.withOpacity(0.5)), + hintStyle: TextStyle(color: context.textD.withValues(alpha: 0.5)), filled: true, fillColor: context.bgInput, border: OutlineInputBorder( @@ -589,7 +588,7 @@ class _ImportButton extends StatelessWidget { labelText: 'Download URL', labelStyle: TextStyle(color: context.textD, fontSize: 13), hintText: 'https://huggingface.co/.../model.gguf', - hintStyle: TextStyle(color: context.textD.withOpacity(0.5)), + hintStyle: TextStyle(color: context.textD.withValues(alpha: 0.5)), filled: true, fillColor: context.bgInput, border: OutlineInputBorder( diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 3918ebf..1190638 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -391,8 +391,8 @@ class _SettingsBody extends StatelessWidget { margin: const EdgeInsets.only(top: 4, bottom: 8), padding: const EdgeInsets.all(8), decoration: BoxDecoration( - color: AppColors.orange.withOpacity(0.1), - border: Border.all(color: AppColors.orange.withOpacity(0.3)), + color: AppColors.orange.withValues(alpha: 0.1), + border: Border.all(color: AppColors.orange.withValues(alpha: 0.3)), borderRadius: BorderRadius.circular(8), ), child: Row( diff --git a/lib/services/llm_service.dart b/lib/services/llm_service.dart index 84f8596..d4209a9 100644 --- a/lib/services/llm_service.dart +++ b/lib/services/llm_service.dart @@ -1,6 +1,5 @@ import 'dart:async'; import 'dart:io'; -import 'package:flutter/foundation.dart'; import 'package:get/get.dart'; import 'package:llamadart/llamadart.dart'; import 'package:path/path.dart' as p; diff --git a/lib/widgets/chat_bubble.dart b/lib/widgets/chat_bubble.dart index b573d7b..9220f01 100644 --- a/lib/widgets/chat_bubble.dart +++ b/lib/widgets/chat_bubble.dart @@ -86,8 +86,8 @@ class ChatBubble extends StatelessWidget { fontSize: 13, color: const Color(0xFFE6EDF3), backgroundColor: context.isDark - ? Colors.white.withOpacity(0.08) - : Colors.black.withOpacity(0.06), + ? Colors.white.withValues(alpha: 0.08) + : Colors.black.withValues(alpha: 0.06), ), codeblockDecoration: BoxDecoration( color: const Color(0xFF1E1E2E), @@ -95,7 +95,7 @@ class ChatBubble extends StatelessWidget { ), codeblockPadding: const EdgeInsets.all(14), blockquoteDecoration: BoxDecoration( - color: AppColors.accent.withOpacity(0.08), + color: AppColors.accent.withValues(alpha: 0.08), border: const Border( left: BorderSide(color: AppColors.accent, width: 3), ), diff --git a/lib/widgets/model_card.dart b/lib/widgets/model_card.dart index 00822fb..2bbc953 100644 --- a/lib/widgets/model_card.dart +++ b/lib/widgets/model_card.dart @@ -46,15 +46,15 @@ class ModelCard extends StatelessWidget { return Container( margin: const EdgeInsets.only(bottom: 12), decoration: BoxDecoration( - color: isLoaded ? AppColors.accent.withOpacity(0.05) : context.bgPanel, + color: isLoaded ? AppColors.accent.withValues(alpha: 0.05) : context.bgPanel, borderRadius: BorderRadius.circular(12), border: Border.all( color: isLoaded - ? AppColors.accent.withOpacity(0.5) + ? AppColors.accent.withValues(alpha: 0.5) : isLoadingModel - ? AppColors.orange.withOpacity(0.5) + ? AppColors.orange.withValues(alpha: 0.5) : isCurrentlyDownloading - ? AppColors.orange.withOpacity(0.4) + ? AppColors.orange.withValues(alpha: 0.4) : context.border, ), ), @@ -177,7 +177,7 @@ class ModelCard extends StatelessWidget { Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), decoration: BoxDecoration( - color: AppColors.orange.withOpacity(0.15), + color: AppColors.orange.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(6), ), child: Text( @@ -249,7 +249,7 @@ class ModelCard extends StatelessWidget { Container( padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), decoration: BoxDecoration( - color: AppColors.accent.withOpacity(0.1), + color: AppColors.accent.withValues(alpha: 0.1), borderRadius: BorderRadius.circular(4), ), child: Text( @@ -373,7 +373,7 @@ class ModelCard extends StatelessWidget { Tooltip( message: 'Unload model from memory', child: Material( - color: AppColors.orange.withOpacity(0.12), + color: AppColors.orange.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(8), child: InkWell( onTap: onUnload, @@ -399,8 +399,8 @@ class ModelCard extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), decoration: BoxDecoration( color: isUncensored - ? AppColors.uncensored.withOpacity(0.15) - : AppColors.standard.withOpacity(0.15), + ? AppColors.uncensored.withValues(alpha: 0.15) + : AppColors.standard.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(4), ), child: Text( @@ -419,7 +419,7 @@ class ModelCard extends StatelessWidget { return Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), decoration: BoxDecoration( - color: AppColors.accent.withOpacity(0.15), + color: AppColors.accent.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(4), ), child: Text( @@ -437,7 +437,7 @@ class ModelCard extends StatelessWidget { return Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), decoration: BoxDecoration( - color: color.withOpacity(0.15), + color: color.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(4), ), child: Row(