mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 05:13:41 +00:00
fix(ui): refine narrow layouts and enable tab swipes
This commit is contained in:
1 parent
e47a20a1bd
commit
c703c52cbc
17 files changed
+624
-182
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../theme/app_design_tokens.dart';
|
||||
import '../theme/app_palette.dart';
|
||||
|
||||
/// A labelled control whose caller chooses the layout for the available width.
|
||||
class AppFormRow extends StatelessWidget {
|
||||
const AppFormRow({super.key, required this.label, required this.child, this.direction = Axis.horizontal});
|
||||
|
||||
final String label;
|
||||
final Widget child;
|
||||
final Axis direction;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final title = Text(
|
||||
label,
|
||||
style: TextStyle(color: AppPalette.of(context).textPrimary, fontSize: 13, fontWeight: FontWeight.w500),
|
||||
);
|
||||
if (direction == Axis.vertical) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
title,
|
||||
const SizedBox(height: AppDesignTokens.space8),
|
||||
SizedBox(width: double.infinity, child: child),
|
||||
],
|
||||
);
|
||||
}
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 104,
|
||||
child: Padding(padding: const EdgeInsets.only(top: 10), child: title),
|
||||
),
|
||||
const SizedBox(width: AppDesignTokens.space12),
|
||||
Expanded(child: child),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user