mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-26 10:33:15 +03:00
Add alternativeTitle
to AppPage
and change border radius
This commit is contained in:
parent
ad54c18205
commit
c3c70029a9
@ -53,7 +53,7 @@ class ActionListItem extends StatelessWidget {
|
||||
// };
|
||||
|
||||
return ListTile(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(48)),
|
||||
title: Text(title),
|
||||
subtitle: subtitle != null ? Text(subtitle!) : null,
|
||||
leading: Opacity(
|
||||
|
@ -77,7 +77,7 @@ class _AppListItemState<T> extends ConsumerState<AppListItem> {
|
||||
item: widget.item,
|
||||
child: InkWell(
|
||||
focusNode: _focusNode,
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
borderRadius: BorderRadius.circular(48),
|
||||
onSecondaryTapDown: buildPopupActions == null
|
||||
? null
|
||||
: (details) {
|
||||
|
@ -41,6 +41,7 @@ final _mainContentGlobalKey = GlobalKey();
|
||||
|
||||
class AppPage extends StatefulWidget {
|
||||
final String? title;
|
||||
final String? alternativeTitle;
|
||||
final String? footnote;
|
||||
final Widget Function(BuildContext context, bool expanded) builder;
|
||||
final Widget Function(BuildContext context)? detailViewBuilder;
|
||||
@ -58,6 +59,7 @@ class AppPage extends StatefulWidget {
|
||||
const AppPage(
|
||||
{super.key,
|
||||
this.title,
|
||||
this.alternativeTitle,
|
||||
this.footnote,
|
||||
required this.builder,
|
||||
this.centered = false,
|
||||
@ -215,31 +217,38 @@ class _AppPageState extends State<AppPage> {
|
||||
AnimatedOpacity(
|
||||
opacity: !_isSliverTitleScrolledUnder ? 1 : 0,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.spaceBetween,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 2.0,
|
||||
runSpacing: 8.0,
|
||||
children: [
|
||||
Text(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
key: _sliverTitleGlobalKey,
|
||||
widget.title!,
|
||||
widget.alternativeTitle ?? widget.title!,
|
||||
style: Theme.of(context).textTheme.displaySmall!.copyWith(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
.withOpacity(0.9),
|
||||
color: widget.alternativeTitle != null
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurfaceVariant
|
||||
.withOpacity(0.4)
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
.withOpacity(0.9),
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (widget.capabilities != null)
|
||||
Wrap(
|
||||
spacing: 4.0,
|
||||
runSpacing: 8.0,
|
||||
children: [
|
||||
...widget.capabilities!.map((c) => CapabilityBadge(c))
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
if (widget.capabilities != null &&
|
||||
widget.alternativeTitle == null)
|
||||
Wrap(
|
||||
spacing: 4.0,
|
||||
runSpacing: 8.0,
|
||||
children: [
|
||||
...widget.capabilities!.map((c) => CapabilityBadge(c))
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
@ -267,7 +276,7 @@ class _AppPageState extends State<AppPage> {
|
||||
child: AnimatedOpacity(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
opacity: _isSliverTitleScrolledUnder ? 1 : 0,
|
||||
child: Text(widget.title!),
|
||||
child: Text(widget.alternativeTitle ?? widget.title!),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -144,6 +144,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
|
||||
.select((value) => value?.length));
|
||||
final hasFeature = ref.watch(featureProvider);
|
||||
final hasActions = hasFeature(features.actions);
|
||||
final searchText = searchController.text;
|
||||
|
||||
Future<void> onFileDropped(File file) async {
|
||||
final qrScanner = ref.read(qrScannerProvider);
|
||||
@ -262,6 +263,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
|
||||
},
|
||||
builder: (context) => AppPage(
|
||||
title: l10n.s_accounts,
|
||||
alternativeTitle: searchText != '' ? 'Results for "$searchText"' : null,
|
||||
capabilities: const [Capability.oath],
|
||||
keyActionsBuilder: hasActions
|
||||
? (context) => oathBuildActions(
|
||||
@ -381,7 +383,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
|
||||
?.copyWith(fontSize: textTheme.titleSmall?.fontSize),
|
||||
decoration: AppInputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
borderRadius: BorderRadius.circular(48),
|
||||
borderSide: BorderSide(
|
||||
width: 0,
|
||||
style: searchFocus.hasFocus
|
||||
|
Loading…
Reference in New Issue
Block a user