Used awesome snackbar and fixed gemini_ico.png not found
This commit is contained in:
parent
c123c09233
commit
81bc618eee
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 83 KiB |
|
|
@ -3763,11 +3763,7 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
|
|||
final plainText = _actionController?.document.toPlainText().trim() ?? '';
|
||||
if (plainText.isEmpty) {
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Please enter some action taken text first'),
|
||||
),
|
||||
);
|
||||
showWarningSnackBar(context, 'Please enter some action taken text first');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3829,15 +3825,11 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
|
|||
}
|
||||
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Action taken improved successfully')),
|
||||
);
|
||||
showSuccessSnackBar(context, 'Action taken improved successfully');
|
||||
}
|
||||
} catch (e) {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Error: $e')));
|
||||
showErrorSnackBar(context, 'Error: $e');
|
||||
}
|
||||
} finally {
|
||||
if (mounted) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import '../services/ai_service.dart';
|
||||
import '../utils/snackbar.dart';
|
||||
|
||||
typedef TextUpdateCallback = void Function(String updatedText);
|
||||
typedef ProcessingStateCallback = void Function(bool isProcessing);
|
||||
|
|
@ -52,9 +53,7 @@ class _GeminiButtonState extends State<GeminiButton> {
|
|||
final text = widget.textController.text.trim();
|
||||
if (text.isEmpty) {
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Please enter some text first')),
|
||||
);
|
||||
showWarningSnackBar(context, 'Please enter some text first');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -78,14 +77,10 @@ class _GeminiButtonState extends State<GeminiButton> {
|
|||
widget.textController.text = trimmed;
|
||||
widget.onTextUpdated(trimmed);
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Text improved successfully')),
|
||||
);
|
||||
showSuccessSnackBar(context, 'Text improved successfully');
|
||||
} catch (e) {
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('Error: $e')));
|
||||
showErrorSnackBar(context, 'Error: $e');
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user