Merge pull request #454 from DenserMeerkat/resolve-issue-mobile

Fix UI inconsistencies in mobile
This commit is contained in:
Ashita Prasad
2024-08-25 21:30:06 +05:30
committed by GitHub
5 changed files with 42 additions and 39 deletions

View File

@ -29,7 +29,6 @@ class NavbarButton extends ConsumerWidget {
final mobileScaffoldKeyNotifier = final mobileScaffoldKeyNotifier =
ref.watch(mobileScaffoldKeyStateProvider.notifier); ref.watch(mobileScaffoldKeyStateProvider.notifier);
final bool isSelected = railIdx == buttonIdx; final bool isSelected = railIdx == buttonIdx;
final Size size = isCompact ? const Size(56, 32) : const Size(65, 32);
var onPress = isSelected var onPress = isSelected
? null ? null
: () { : () {
@ -49,20 +48,20 @@ class NavbarButton extends ConsumerWidget {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
TextButton( SizedBox(
style: isSelected height: isCompact ? 36 : 36,
? TextButton.styleFrom( child: TextButton(
fixedSize: size, style: TextButton.styleFrom(
backgroundColor: padding: EdgeInsets.zero,
Theme.of(context).colorScheme.secondaryContainer, backgroundColor: isSelected
) ? Theme.of(context).colorScheme.secondaryContainer
: TextButton.styleFrom( : null,
fixedSize: size, ),
), onPressed: onPress,
onPressed: onPress, child: Icon(
child: Icon( isSelected ? selectedIcon : icon,
isSelected ? selectedIcon : icon, color: Theme.of(context).colorScheme.onSurfaceVariant,
color: Theme.of(context).colorScheme.onSurfaceVariant, ),
), ),
), ),
showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(), showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(),

View File

@ -106,6 +106,9 @@ class EnvironmentTriggerFieldState extends State<EnvironmentTriggerField> {
onChanged: widget.onChanged, onChanged: widget.onChanged,
onSubmitted: widget.onFieldSubmitted, onSubmitted: widget.onFieldSubmitted,
specialTextSpanBuilder: EnvRegExpSpanBuilder(), specialTextSpanBuilder: EnvRegExpSpanBuilder(),
onTapOutside: (event) {
focusNode.unfocus();
},
); );
}, },
); );

View File

@ -129,33 +129,34 @@ class Grabber extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!isOnDesktopAndWeb) {
return const SizedBox.shrink();
}
final ColorScheme colorScheme = Theme.of(context).colorScheme; final ColorScheme colorScheme = Theme.of(context).colorScheme;
return GestureDetector( final handle = Container(
onVerticalDragUpdate: onVerticalDragUpdate, width: double.infinity,
child: Container( decoration: BoxDecoration(
width: double.infinity, color: colorScheme.surfaceContainerLow,
decoration: BoxDecoration( borderRadius: const BorderRadius.only(
color: colorScheme.surfaceContainerLow, topLeft: Radius.circular(16), topRight: Radius.circular(16)),
borderRadius: const BorderRadius.only( ),
topLeft: Radius.circular(16), topRight: Radius.circular(16)), child: Align(
), alignment: Alignment.topCenter,
child: Align( child: Container(
alignment: Alignment.topCenter, margin: kPv10,
child: Container( width: 80.0,
margin: kPv10, height: 6.0,
width: 80.0, decoration: BoxDecoration(
height: 6.0, color: colorScheme.surfaceContainerHighest,
decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.0),
color: colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8.0),
),
), ),
), ),
), ),
); );
if (!isOnDesktopAndWeb) {
return handle;
}
return GestureDetector(
onVerticalDragUpdate: onVerticalDragUpdate,
child: handle,
);
} }
} }

View File

@ -21,7 +21,7 @@ class HistoryURLCard extends StatelessWidget {
return LayoutBuilder(builder: (context, constraints) { return LayoutBuilder(builder: (context, constraints) {
final isCompact = constraints.maxWidth <= kMinWindowSize.width; final isCompact = constraints.maxWidth <= kMinWindowSize.width;
final isExpanded = constraints.maxWidth >= kMediumWindowWidth; final isExpanded = constraints.maxWidth >= kMediumWindowWidth - 8;
return Card( return Card(
color: kColorTransparent, color: kColorTransparent,
surfaceTintColor: kColorTransparent, surfaceTintColor: kColorTransparent,

View File

@ -37,7 +37,7 @@ class FilledButtonGroup extends StatelessWidget {
} }
} }
return ClipRRect( return ClipRRect(
borderRadius: kBorderRadius20, borderRadius: BorderRadius.circular(88),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: buttonsWithSpacers, children: buttonsWithSpacers,