mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-02 11:16:10 -04:00
profile edit happens without requiring save button
This commit is contained in:
parent
b6a812af87
commit
030f9d9651
19 changed files with 499 additions and 266 deletions
|
@ -31,7 +31,8 @@ class SliderTile extends StatelessWidget {
|
|||
this.startActions = const [],
|
||||
this.onTap,
|
||||
this.onDoubleTap,
|
||||
this.icon,
|
||||
this.leading,
|
||||
this.trailing,
|
||||
super.key});
|
||||
|
||||
final bool disabled;
|
||||
|
@ -41,7 +42,8 @@ class SliderTile extends StatelessWidget {
|
|||
final List<SliderTileAction> startActions;
|
||||
final GestureTapCallback? onTap;
|
||||
final GestureTapCallback? onDoubleTap;
|
||||
final IconData? icon;
|
||||
final Widget? leading;
|
||||
final Widget? trailing;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
|
||||
|
@ -55,11 +57,12 @@ class SliderTile extends StatelessWidget {
|
|||
..add(IterableProperty<SliderTileAction>('endActions', endActions))
|
||||
..add(IterableProperty<SliderTileAction>('startActions', startActions))
|
||||
..add(ObjectFlagProperty<GestureTapCallback?>.has('onTap', onTap))
|
||||
..add(DiagnosticsProperty<IconData?>('icon', icon))
|
||||
..add(DiagnosticsProperty<Widget?>('leading', leading))
|
||||
..add(StringProperty('title', title))
|
||||
..add(StringProperty('subtitle', subtitle))
|
||||
..add(ObjectFlagProperty<GestureTapCallback?>.has(
|
||||
'onDoubleTap', onDoubleTap));
|
||||
'onDoubleTap', onDoubleTap))
|
||||
..add(DiagnosticsProperty<Widget?>('trailing', trailing));
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -156,6 +159,7 @@ class SliderTile extends StatelessWidget {
|
|||
subtitle: subtitle.isNotEmpty ? Text(subtitle) : null,
|
||||
iconColor: textColor,
|
||||
textColor: textColor,
|
||||
leading: icon == null ? null : Icon(icon))))));
|
||||
leading: FittedBox(child: leading),
|
||||
trailing: FittedBox(child: trailing))))));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_sticky_header/flutter_sticky_header.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:quickalert/quickalert.dart';
|
||||
import 'package:sliver_expandable/sliver_expandable.dart';
|
||||
|
||||
|
@ -27,6 +28,38 @@ extension SizeToFixExt on Widget {
|
|||
);
|
||||
}
|
||||
|
||||
extension FocusExt<T> on Widget {
|
||||
Focus focus(
|
||||
{Key? key,
|
||||
FocusNode? focusNode,
|
||||
FocusNode? parentNode,
|
||||
bool autofocus = false,
|
||||
ValueChanged<bool>? onFocusChange,
|
||||
FocusOnKeyEventCallback? onKeyEvent,
|
||||
bool? canRequestFocus,
|
||||
bool? skipTraversal,
|
||||
bool? descendantsAreFocusable,
|
||||
bool? descendantsAreTraversable,
|
||||
bool includeSemantics = true,
|
||||
String? debugLabel}) =>
|
||||
Focus(
|
||||
key: key,
|
||||
focusNode: focusNode,
|
||||
parentNode: parentNode,
|
||||
autofocus: autofocus,
|
||||
onFocusChange: onFocusChange,
|
||||
onKeyEvent: onKeyEvent,
|
||||
canRequestFocus: canRequestFocus,
|
||||
skipTraversal: skipTraversal,
|
||||
descendantsAreFocusable: descendantsAreFocusable,
|
||||
descendantsAreTraversable: descendantsAreTraversable,
|
||||
includeSemantics: includeSemantics,
|
||||
debugLabel: debugLabel,
|
||||
child: this);
|
||||
Focus onFocusChange(void Function(bool) onFocusChange) =>
|
||||
Focus(onFocusChange: onFocusChange, child: this);
|
||||
}
|
||||
|
||||
extension ModalProgressExt on Widget {
|
||||
BlurryModalProgressHUD withModalHUD(BuildContext context, bool isLoading) {
|
||||
final theme = Theme.of(context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue