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() ?? '';
|
final plainText = _actionController?.document.toPlainText().trim() ?? '';
|
||||||
if (plainText.isEmpty) {
|
if (plainText.isEmpty) {
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
showWarningSnackBar(context, 'Please enter some action taken text first');
|
||||||
const SnackBar(
|
|
||||||
content: Text('Please enter some action taken text first'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3829,15 +3825,11 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
showSuccessSnackBar(context, 'Action taken improved successfully');
|
||||||
const SnackBar(content: Text('Action taken improved successfully')),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
ScaffoldMessenger.of(
|
showErrorSnackBar(context, 'Error: $e');
|
||||||
context,
|
|
||||||
).showSnackBar(SnackBar(content: Text('Error: $e')));
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../services/ai_service.dart';
|
import '../services/ai_service.dart';
|
||||||
|
import '../utils/snackbar.dart';
|
||||||
|
|
||||||
typedef TextUpdateCallback = void Function(String updatedText);
|
typedef TextUpdateCallback = void Function(String updatedText);
|
||||||
typedef ProcessingStateCallback = void Function(bool isProcessing);
|
typedef ProcessingStateCallback = void Function(bool isProcessing);
|
||||||
|
|
@ -52,9 +53,7 @@ class _GeminiButtonState extends State<GeminiButton> {
|
||||||
final text = widget.textController.text.trim();
|
final text = widget.textController.text.trim();
|
||||||
if (text.isEmpty) {
|
if (text.isEmpty) {
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
showWarningSnackBar(context, 'Please enter some text first');
|
||||||
const SnackBar(content: Text('Please enter some text first')),
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,14 +77,10 @@ class _GeminiButtonState extends State<GeminiButton> {
|
||||||
widget.textController.text = trimmed;
|
widget.textController.text = trimmed;
|
||||||
widget.onTextUpdated(trimmed);
|
widget.onTextUpdated(trimmed);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
showSuccessSnackBar(context, 'Text improved successfully');
|
||||||
const SnackBar(content: Text('Text improved successfully')),
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
ScaffoldMessenger.of(
|
showErrorSnackBar(context, 'Error: $e');
|
||||||
context,
|
|
||||||
).showSnackBar(SnackBar(content: Text('Error: $e')));
|
|
||||||
} finally {
|
} finally {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user