Fix desktop and sliver app bar add client

This commit is contained in:
Juan Gilsanz Polo 2024-03-09 13:57:15 +01:00
parent ad6cb92d4b
commit ce8d38958e
2 changed files with 91 additions and 69 deletions

View file

@ -235,9 +235,16 @@ class _ClientScreenState extends State<ClientScreen> {
if (widget.fullScreen == true) {
return Dialog.fullscreen(
child: Scaffold(
appBar: AppBar(
return Material(
child: NestedScrollView(
headerSliverBuilder: (context, innerBoxIsScrolled) => [
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar.large(
pinned: true,
floating: true,
centerTitle: false,
forceElevated: innerBoxIsScrolled,
leading: IconButton(
onPressed: () => Navigator.pop(context),
icon: const Icon(Icons.close)
@ -248,10 +255,19 @@ class _ClientScreenState extends State<ClientScreen> {
: AppLocalizations.of(context)!.addClient
),
actions: actions(),
),
)
)
],
body: SafeArea(
child: ListView(
controller: _scrollController,
top: false,
bottom: true,
child: Builder(
builder: (context) => CustomScrollView(
slivers: [
SliverOverlapInjector(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
),
SliverList.list(
children: [
if (!_nameValid || !_identifiersValid || !_dnsCacheValid) _Errors(
nameValid: _nameValid,
@ -298,8 +314,11 @@ class _ClientScreenState extends State<ClientScreen> {
setBlockedServicesSchedule: (v) => setState(() => _blockedServicesSchedule = v),
),
],
)
],
),
),
)
)
),
);
}

View file

@ -148,11 +148,14 @@ class LogTile extends StatelessWidget {
}
void openAddClient() {
openClientFormModal(
Future.delayed(
const Duration(milliseconds: 0),
() => openClientFormModal(
context: context,
width: MediaQuery.of(context).size.width,
onConfirm: confirmAddClient,
initialData: ClientInitialData(name: "Client ${log.client}", ip: log.client)
)
);
}