Skip to content

Commit

Permalink
fix lock, textform
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonavichus committed Feb 23, 2023
1 parent c643758 commit e0f57b6
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 50 deletions.
2 changes: 0 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
android:showWhenLocked="true"
android:turnScreenOn="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
Expand Down
8 changes: 4 additions & 4 deletions lib/app/widgets/task_type_cu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class _TaskTypeCuState extends State<TaskTypeCu> {
),
),
MyTextForm(
textEditingController: service.titleEdit.value,
hintText: 'name'.tr,
controller: service.titleEdit.value,
labelText: 'name'.tr,
type: TextInputType.text,
icon: const Icon(Iconsax.edit_2),
validator: (value) {
Expand All @@ -125,8 +125,8 @@ class _TaskTypeCuState extends State<TaskTypeCu> {
},
),
MyTextForm(
textEditingController: service.descEdit.value,
hintText: 'description'.tr,
controller: service.descEdit.value,
labelText: 'description'.tr,
type: TextInputType.text,
icon: const Icon(Iconsax.note_text),
),
Expand Down
1 change: 1 addition & 0 deletions lib/app/widgets/task_type_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class _TaskTypeListState extends State<TaskTypeList> {
? Colors.white
: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 18,
),
),
),
Expand Down
32 changes: 26 additions & 6 deletions lib/app/widgets/text_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import 'package:get/get.dart';
class MyTextForm extends StatelessWidget {
const MyTextForm({
super.key,
required this.hintText,
required this.labelText,
required this.type,
required this.icon,
required this.textEditingController,
required this.controller,
this.onTap,
this.readOnly = false,
this.validator,
this.iconButton,
});
final String hintText;
final String labelText;
final TextInputType type;
final Icon icon;
final IconButton? iconButton;
final TextEditingController textEditingController;
final TextEditingController controller;
final Function()? onTap;
final String? Function(String?)? validator;
final bool readOnly;
Expand All @@ -27,9 +27,29 @@ class MyTextForm extends StatelessWidget {
return Padding(
padding: const EdgeInsets.only(left: 10, right: 10, top: 10),
child: TextFormField(
contextMenuBuilder:
(BuildContext context, EditableTextState editableTextState) {
return AdaptiveTextSelectionToolbar(
anchors: editableTextState.contextMenuAnchors,
children: editableTextState.contextMenuButtonItems
.map((ContextMenuButtonItem buttonItem) {
return MaterialButton(
textColor: Colors.white,
onPressed: buttonItem.onPressed,
padding: const EdgeInsets.all(10.0),
child: Text(
AdaptiveTextSelectionToolbar.getButtonLabel(
context,
buttonItem,
),
),
);
}).toList(),
);
},
readOnly: readOnly,
onTap: readOnly == true ? onTap : null,
controller: textEditingController,
controller: controller,
keyboardType: type,
style: context.theme.textTheme.titleMedium,
decoration: InputDecoration(
Expand All @@ -48,7 +68,7 @@ class MyTextForm extends StatelessWidget {
color: context.theme.disabledColor,
),
),
labelText: hintText,
labelText: labelText,
labelStyle: context.theme.textTheme.labelLarge?.copyWith(
color: Colors.grey,
),
Expand Down
12 changes: 6 additions & 6 deletions lib/app/widgets/todos_ce.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class _TodosCeState extends State<TodosCe> {
)
: Container(),
MyTextForm(
textEditingController: service.titleEdit.value,
hintText: 'name'.tr,
controller: service.titleEdit.value,
labelText: 'name'.tr,
type: TextInputType.text,
icon: const Icon(Iconsax.edit_2),
validator: (value) {
Expand All @@ -219,8 +219,8 @@ class _TodosCeState extends State<TodosCe> {
},
),
MyTextForm(
textEditingController: service.descEdit.value,
hintText: 'description'.tr,
controller: service.descEdit.value,
labelText: 'description'.tr,
type: TextInputType.text,
icon: const Icon(Iconsax.note_text),
),
Expand All @@ -230,8 +230,8 @@ class _TodosCeState extends State<TodosCe> {
flex: 5,
child: MyTextForm(
readOnly: true,
textEditingController: service.timeEdit.value,
hintText: 'timeComlete'.tr,
controller: service.timeEdit.value,
labelText: 'timeComlete'.tr,
type: TextInputType.datetime,
icon: const Icon(Iconsax.clock),
iconButton: IconButton(
Expand Down
1 change: 1 addition & 0 deletions lib/app/widgets/todos_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class _TodosListState extends State<TodosList> {
style: context.theme.textTheme.titleMedium?.copyWith(
color: Get.isDarkMode ? Colors.white : Colors.black,
fontWeight: FontWeight.w600,
fontSize: 18,
),
),
],
Expand Down
51 changes: 25 additions & 26 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "569ddca58d535e601dd1584afa117710abc999d036c0cd2c51777fb257df78e8"
sha256: e440ac42679dfc04bbbefb58ed225c994bc7e07fccc8a68ec7d3631a127e5da9
url: "https://pub.dev"
source: hosted
version: "53.0.0"
version: "54.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "10927c4b7c7c88b1adbca278c3d5531db92e2f4b4abf04e2919a800af965f3f5"
sha256: "2c2e3721ee9fb36de92faa060f3480c81b23e904352b087e5c64224b1a044427"
url: "https://pub.dev"
source: hosted
version: "5.5.0"
version: "5.6.0"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -362,10 +362,10 @@ packages:
dependency: transitive
description:
name: flutter_local_notifications_linux
sha256: "8f6c1611e0c4a88a382691a97bb3c3feb24cc0c0b54152b8b5fb7ffb837f7fbf"
sha256: ccb08b93703aeedb58856e5637450bf3ffec899adb66dc325630b68994734b89
url: "https://pub.dev"
source: hosted
version: "3.0.0"
version: "3.0.0+1"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -411,12 +411,11 @@ packages:
flutter_typeahead:
dependency: "direct main"
description:
path: "."
ref: master
resolved-ref: "52994f5d497084f38e38ce98b510416174767083"
url: "https://github.com/ivofernandes/flutter_typeahead.git"
source: git
version: "4.3.5"
name: flutter_typeahead
sha256: "3f7509bc1d43e245e0bfdc180f206508bc5ab0e0d84ce1b891cb0e4176b7802f"
url: "https://pub.dev"
source: hosted
version: "4.3.6"
flutter_web_plugins:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -618,50 +617,50 @@ packages:
dependency: "direct main"
description:
name: path_provider
sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95
sha256: "04890b994ee89bfa80bf3080bfec40d5a92c5c7a785ebb02c13084a099d2b6f9"
url: "https://pub.dev"
source: hosted
version: "2.0.12"
version: "2.0.13"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e
sha256: "7623b7d4be0f0f7d9a8b5ee6879fc13e4522d4c875ab86801dee4af32b54b83e"
url: "https://pub.dev"
source: hosted
version: "2.0.22"
version: "2.0.23"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74"
sha256: eec003594f19fe2456ea965ae36b3fc967bc5005f508890aafe31fa75e41d972
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: "2e32f1640f07caef0d3cb993680f181c79e54a3827b997d5ee221490d131fbd9"
sha256: "525ad5e07622d19447ad740b1ed5070031f7a5437f44355ae915ff56e986429a"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
version: "2.1.9"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76
sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec"
url: "https://pub.dev"
source: hosted
version: "2.0.5"
version: "2.0.6"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c
sha256: "642ddf65fde5404f83267e8459ddb4556316d3ee6d511ed193357e25caa3632d"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.4"
petitparser:
dependency: transitive
description:
Expand All @@ -682,10 +681,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a
sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.4"
pointycastle:
dependency: transitive
description:
Expand Down
9 changes: 3 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.

publish_to: 'none'

version: 1.3.0+20
version: 1.3.1+21

environment:
sdk: ">=2.19.2 <3.0.0"
Expand All @@ -18,12 +18,9 @@ dependencies:
intl: ^0.17.0
swipe: ^0.0.1
iconsax: ^0.0.8
path_provider: ^2.0.12
path_provider: ^2.0.13
table_calendar: ^3.0.8
flutter_typeahead:
git:
url: https://github.com/ivofernandes/flutter_typeahead.git
ref: master
flutter_typeahead: ^4.3.6
isar_flutter_libs: ^3.0.5
flex_color_picker: ^3.1.0
flutter_easyloading: ^3.0.5
Expand Down

0 comments on commit e0f57b6

Please sign in to comment.