started grade streak

This commit is contained in:
Kima
2024-05-13 22:35:20 +02:00
parent 93dd275969
commit 540e4d2812
6 changed files with 84 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'package:image_crop/image_crop.dart';
import 'package:image_picker/image_picker.dart';
import 'package:provider/provider.dart';
@@ -27,6 +28,8 @@ class ImageNoteEditor extends StatefulWidget {
}
class _ImageNoteEditorState extends State<ImageNoteEditor> {
final _title = TextEditingController();
final cropKey = GlobalKey<CropState>();
File? _file;
File? _sample;
@@ -135,7 +138,8 @@ class _ImageNoteEditorState extends State<ImageNoteEditor> {
selfNotes.add(SelfNote.fromJson({
'id': const Uuid().v4(),
'content': base64Image,
'note_type': 'image'
'note_type': 'image',
'title': _title.text,
}));
await Provider.of<DatabaseProvider>(context, listen: false)
@@ -171,6 +175,37 @@ class _ImageNoteEditorState extends State<ImageNoteEditor> {
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
child: _sample == null ? openImageWidget() : cropImageWidget(),
),
Padding(
padding:
const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
child: TextField(
controller: _title,
onEditingComplete: () async {},
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.grey, width: 1.5),
borderRadius: BorderRadius.circular(12.0),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.grey, width: 1.5),
borderRadius: BorderRadius.circular(12.0),
),
contentPadding: const EdgeInsets.symmetric(horizontal: 12.0),
hintText: 'title'.i18n,
suffixIcon: IconButton(
icon: const Icon(
FeatherIcons.x,
color: Colors.grey,
),
onPressed: () {
setState(() {
_title.text = '';
});
},
),
),
),
),
// if (widget.u.picture != "")
// TextButton(
// child: Text(

View File

@@ -19,6 +19,7 @@ extension SettingsLocalization on String {
"select_image": "to select an image",
"new_image": "New Image",
"image_note": "Image",
"title": "Image title...",
},
"hu_hu": {
"notes": "Füzet",
@@ -36,6 +37,7 @@ extension SettingsLocalization on String {
"select_image": "kép kiválasztásához",
"new_image": "Új kép",
"image_note": "Kép",
"title": "Kép címe...",
},
"de_de": {
"notes": "Broschüre",
@@ -53,6 +55,7 @@ extension SettingsLocalization on String {
"select_image": "um ein Bild auszuwählen",
"new_image": "Neues Bild",
"image_note": "Bild",
"title": "Bildtitel...",
},
};