Skip to content

Commit

Permalink
Merge pull request #553 from danemadsen/main
Browse files Browse the repository at this point in the history
Small ui changes
  • Loading branch information
danemadsen authored May 12, 2024
2 parents 9d6376b + bb86e39 commit 36ca59d
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 40 deletions.
5 changes: 5 additions & 0 deletions lib/static/utilities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ class Utilities {

return File(path)..writeAsBytesSync(buffer);
}

static String capitalizeFirst(String word) {
if (word.isEmpty) return word;
return word[0].toUpperCase() + word.substring(1).toLowerCase();
}
}
33 changes: 10 additions & 23 deletions lib/ui/mobile/pages/character/character_customization_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:maid/providers/character.dart';
import 'package:maid/static/utilities.dart';
import 'package:maid/ui/mobile/pages/character/character_browser_page.dart';
import 'package:maid/ui/mobile/widgets/appbars/generic_app_bar.dart';
import 'package:maid/ui/mobile/widgets/dialogs.dart';
Expand Down Expand Up @@ -244,28 +245,14 @@ class _CharacterCustomizationPageState extends State<CharacterCustomizationPage>
endIndent: 10,
color: Theme.of(context).colorScheme.primary,
),
ListTile(
title: Row(
children: [
const Expanded(
child: Text("Name"),
),
Expanded(
flex: 2,
child: TextField(
cursorColor:
Theme.of(context).colorScheme.secondary,
decoration: const InputDecoration(
labelText: "Name",
),
controller: nameController,
onChanged: (value) {
character.name = value;
},
),
),
],
),
TextFieldListTile(
headingText: 'Name',
labelText: 'Name',
controller: nameController,
onChanged: (value) {
character.name = value;
},
multiline: false,
),
TextFieldListTile(
headingText: 'Description',
Expand Down Expand Up @@ -427,7 +414,7 @@ class _CharacterCustomizationPageState extends State<CharacterCustomizationPage>
for (int i = 0; i < character.examples.length; i++)
TextFieldListTile(
headingText:
'${character.examples[i]["role"]} content',
'${Utilities.capitalizeFirst(character.examples[i]["role"])} Content',
labelText: character.examples[i]["role"],
controller: exampleControllers[i],
onChanged: (value) {
Expand Down
29 changes: 12 additions & 17 deletions lib/ui/mobile/widgets/tiles/text_field_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,20 @@ class TextFieldListTile extends StatelessWidget{
@override
Widget build(BuildContext context) {
return ListTile(
title: Row(
title: Column(
children: [
Expanded(
child: Text(headingText),
),
Expanded(
flex: 2,
child: TextField(
keyboardType: multiline ? TextInputType.multiline : TextInputType.text,
maxLines: multiline ? null : 1,
cursorColor: Theme.of(context).colorScheme.secondary,
controller: controller ?? TextEditingController(text: initialValue),
decoration: InputDecoration(
labelText: labelText,
),
onSubmitted: onSubmitted,
onChanged: onChanged,
Text(headingText),
TextField(
keyboardType: multiline ? TextInputType.multiline : TextInputType.text,
maxLines: multiline ? null : 1,
cursorColor: Theme.of(context).colorScheme.secondary,
controller: controller ?? TextEditingController(text: initialValue),
decoration: InputDecoration(
labelText: labelText,
),
),
onSubmitted: onSubmitted,
onChanged: onChanged,
)
],
),
);
Expand Down
135 changes: 135 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
version: "67.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
version: "6.4.1"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -33,6 +49,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
build:
dependency: transitive
description:
name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb
url: "https://pub.dev"
source: hosted
version: "8.9.2"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -65,6 +105,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
code_builder:
dependency: transitive
description:
name: code_builder
sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37
url: "https://pub.dev"
source: hosted
version: "4.10.0"
collection:
dependency: transitive
description:
Expand Down Expand Up @@ -121,6 +169,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "9.0.1"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
url: "https://pub.dev"
source: hosted
version: "2.3.6"
dbus:
dependency: transitive
description:
Expand Down Expand Up @@ -206,6 +262,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_driver:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_launcher_icons:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -256,6 +317,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.4.1"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
get_it:
dependency: transitive
description:
Expand All @@ -264,6 +330,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.7.0"
glob:
dependency: transitive
description:
name: glob
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
globbing:
dependency: transitive
description:
Expand Down Expand Up @@ -304,6 +378,11 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.7"
integration_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
Expand Down Expand Up @@ -416,6 +495,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0"
logging:
dependency: transitive
description:
name: logging
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
maid_llm:
dependency: "direct main"
description:
Expand Down Expand Up @@ -462,6 +549,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.0.3+1"
mockito:
dependency: "direct dev"
description:
name: mockito
sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917"
url: "https://pub.dev"
source: hosted
version: "5.4.4"
msix:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -662,6 +757,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.8.0"
process:
dependency: transitive
description:
name: process
sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32"
url: "https://pub.dev"
source: hosted
version: "5.0.2"
provider:
dependency: "direct main"
description:
Expand Down Expand Up @@ -747,6 +850,14 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832"
url: "https://pub.dev"
source: hosted
version: "1.5.0"
source_span:
dependency: transitive
description:
Expand Down Expand Up @@ -787,6 +898,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
sync_http:
dependency: transitive
description:
name: sync_http
sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
system_info2:
dependency: "direct main"
description:
Expand Down Expand Up @@ -907,6 +1026,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "13.0.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
Expand All @@ -915,6 +1042,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.5.1"
webdriver:
dependency: transitive
description:
name: webdriver
sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
win32:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ dev_dependencies:
msix: ^3.9.1
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
flutter_launcher_icons: ^0.13.1
mockito: ^5.4.4

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
Expand Down

0 comments on commit 36ca59d

Please sign in to comment.