Files
hash-wallet/lib/new-ui/widgets/modal_page_wrapper.dart
T
tuxsudoandGitHub 3815fc30c6 New Settings (#3065)
* Update display_settings_page.dart

* Update settings_choices_cell.dart

* Update settings_theme_choice.dart

* Convert display_settings_page.dart to NewListSection

* Cleanup [skip ci]

* Minor

* Minor [skip ci]

* Add SizedBox to scroll view

* Upgrade receive_top_bar.dart with gradient and optional child content

* Adjust animations

* Add modal_page_wrapper.dart

* Add option to hide AppBar for BasePage [skip ci]

* New settings all final (#3067)

* Conflict

* ModalPageWrapper improved abstraction

* display_settings_page.dart minor update

* connection_sync_page.dart redesign

* Conflict

* manage_nodes_page.dart initial redesign

* other settings initial

* Conflict

* add optional subtitle to standard_list.dart

* add connection_sync_view_model.dart

* Add missing images

* Conflict

* Update list item widgets

* Conflict

* Conflict

* Conflict

* minor updates

* Conflict

* Fixes + move Mweb to privacy page

* Conflict

* Remove observer from modal_page_wrapper.dart

* Conflict

* Conflict

* Refactor settings_page.dart with suggestions

* Suggestion fixes

* Conflicts + fix About page

* Fix sync bar conflict

* Update Connections page title [skip ci]

* Trigger CI

* Fix Lightning and Payjoin log export

* Update MWEB node page

* Add FeatureFlag to AutomaticNodeSwitching

* Fix address text on privacy_page.dart

* Move WalletConnect from connection_sync_page.dart to settings_page.dart

* Add WalletConnect icon

* Fix settings icons

* Make text strings use S.of(context) and fix About string in settings_page.dart

* Display settings page fixes

* modal_page_wrapper.dart minor suggestions

* Missingimage

* Add spacing to list_item_selector_widget.dart

* Fix error on manage_nodes_page.dart
2026-03-14 14:15:42 +01:00

89 lines
3.3 KiB
Dart

import 'package:cake_wallet/new-ui/widgets/modal_header.dart';
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
void nothing(){}
class ModalPageWrapper extends StatelessWidget {
ModalPageWrapper(
{super.key,
required this.content,
required this.topBar,
this.header,
this.bottomContent,
this.horizontalPadding = 18.0,
this.verticalPadding = 72.0}) {
}
final Widget content;
final Widget? bottomContent;
final ModalTopBar topBar;
final ModalHeader? header;
final double horizontalPadding;
final double verticalPadding;
@override
Widget build(BuildContext context) {
const gradientSize = 84;
return Container(
color: Theme.of(context).colorScheme.surface,
child: Scaffold(
resizeToAvoidBottomInset: true,
body: Stack(
alignment: Alignment.topCenter,
children: [
Positioned.fill(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: horizontalPadding),
child: CustomScrollView(
controller: ModalScrollController.of(context),
physics: ClampingScrollPhysics(),
slivers: [
SliverToBoxAdapter(child: SizedBox(height: verticalPadding)),
if (header != null) ...[
SliverToBoxAdapter(child: header),
SliverToBoxAdapter(child: SizedBox(height: 20)),
],
SliverSafeArea(sliver: SliverToBoxAdapter(child: content)),
SliverToBoxAdapter(child: SizedBox(height: verticalPadding)),
],
)
)),
if (bottomContent != null)
Positioned(
bottom: 12,
left: horizontalPadding,
right: horizontalPadding,
child: SafeArea(child: bottomContent!),
),
Container(
height: (MediaQuery.of(context).padding.top + gradientSize),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: <Color>[
Theme.of(context).colorScheme.surface.withAlpha(5),
Theme.of(context).colorScheme.surface.withAlpha(25),
Theme.of(context).colorScheme.surface.withAlpha(50),
Theme.of(context).colorScheme.surface.withAlpha(100),
Theme.of(context).colorScheme.surface.withAlpha(150),
Theme.of(context).colorScheme.surface.withAlpha(200),
Theme.of(context).colorScheme.surface.withAlpha(235),
Theme.of(context).colorScheme.surface.withAlpha(255),
Theme.of(context).colorScheme.surface.withAlpha(255),
Theme.of(context).colorScheme.surface.withAlpha(255),
],
),
),
),
topBar,
],
),
),
);
}
}