Skip to content

Commit

Permalink
chore(adaptivetextfield): added min sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kounex committed Mar 15, 2024
1 parent 9e6c4b9 commit 18a443a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Users/kounex/.vscode/extensions/redhat.java-1.24.0-darwin-arm64/jre/17.0.8.1-macosx-aarch64
java.home=/opt/homebrew/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
Expand Down
6 changes: 4 additions & 2 deletions lib/shared/general/base/adaptive_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class CustomValidationTextEditingController extends TextEditingController {

CustomValidationTextEditingController({
this.check,
String? text,
}) : super(text: text);
super.text,
});

bool get isValid {
this.submit();
Expand Down Expand Up @@ -62,6 +62,7 @@ class BaseAdaptiveTextField extends StatefulWidget {
final void Function(String text)? onChanged;

const BaseAdaptiveTextField({
super.key,
Key? key,
required this.controller,
this.placeholder,
Expand Down Expand Up @@ -160,6 +161,7 @@ class BaseAdaptiveTextFieldState extends State<BaseAdaptiveTextField> {
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
switch (this.widget.platform ?? Theme.of(context).platform) {
TargetPlatform.iOS || TargetPlatform.macOS => CupertinoTextField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ class DashboardContentStreaming extends StatelessWidget {
const ResizeableScenePreview(
resizeable: false,
),
const SizedBox(height: 12.0),
const SceneButtons(
size: 64,
mode: SceneButtonsMode.horizontalScroll,
),
const SizedBox(height: 12.0),
const Flexible(
child: StreamChat(
usernameRowExpandable: true,
Expand Down
28 changes: 16 additions & 12 deletions lib/views/dashboard/widgets/scenes/scene_buttons/scene_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,22 @@ class SceneButtons extends StatelessWidget {
children: sceneButtons,
),
SceneButtonsMode.horizontalScroll => SizedBox(
height: this.size,
child: Scrollbar(
scrollbarOrientation: ScrollbarOrientation.bottom,
thumbVisibility: true,
trackVisibility: true,
child: ListView.separated(
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.only(left: 12.0),
itemCount: sceneButtons.length,
itemBuilder: (context, index) => sceneButtons[index],
separatorBuilder: (context, index) =>
const SizedBox(width: 12.0),
height: this.size + 24.0,
child: MediaQuery.removePadding(
removeBottom: true,
context: context,
child: Scrollbar(
scrollbarOrientation: ScrollbarOrientation.bottom,
thumbVisibility: true,
trackVisibility: true,
child: ListView.separated(
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.all(12.0),
itemCount: sceneButtons.length,
itemBuilder: (context, index) => sceneButtons[index],
separatorBuilder: (context, index) =>
const SizedBox(width: 12.0),
),
),
),
),
Expand Down

0 comments on commit 18a443a

Please sign in to comment.