Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default close button #510

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: ice License 1.0

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:ion/app/components/card/info_card.dart';
import 'package:ion/app/components/screen_offset/screen_bottom_offset.dart';
import 'package:ion/app/extensions/build_context.dart';
Expand All @@ -23,7 +22,7 @@ class IdentityInfo extends StatelessWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.common_information),
actions: [NavigationCloseButton(onPressed: () => context.pop())],
actions: const [NavigationCloseButton()],
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0.s),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class RecoverUserSuccessPage extends StatelessWidget {
body: AuthScrollContainer(
showBackButton: false,
actions: [
NavigationCloseButton(
onPressed: onLogin,
),
NavigationCloseButton(onPressed: onLogin),
],
title: context.i18n.two_fa_title,
description: context.i18n.two_fa_desc,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// SPDX-License-Identifier: ice License 1.0

import 'package:ion/app/features/chat/model/channel_data.c.dart';
import 'package:ion/app/features/chat/model/chat_type.dart';
import 'package:ion/app/features/chat/model/entities/private_direct_message_data.c.dart';
import 'package:ion/app/features/chat/model/group.c.dart';
import 'package:ion/app/features/chat/model/message_author.c.dart';
import 'package:ion/app/features/chat/providers/mock.dart';
import 'package:ion/app/services/database/conversation_db_service.c.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand Down Expand Up @@ -44,19 +41,11 @@ class Conversations extends _$Conversations {

void addChannelConversation(ChannelData channelData) {
update((currentData) {
final newConversation = RecentChatDataModel(
MessageAuthor(
name: channelData.name,
imageUrl: 'https://x.com/ice_blockchain/photo',
isApproved: true,
),
1,
TextRecentChatMessage(
'The channel has been created',
DateTime.now(),
),
channelData.id,
type: ChatType.channel,
final newConversation = PrivateDirectMessageEntity(
id: 'id',
pubkey: 'pubKey',
createdAt: DateTime.now(),
data: const PrivateDirectMessageData(content: [], media: {}),
);
final newData = [
newConversation,
Expand All @@ -68,19 +57,11 @@ class Conversations extends _$Conversations {

void addGroupConversation(Group group) {
update((currentData) {
final newConversation = RecentChatDataModel(
MessageAuthor(
name: group.name,
imageUrl: 'https://x.com/ice_blockchain/photo',
isApproved: true,
),
1,
TextRecentChatMessage(
'The group has been created',
DateTime.now(),
),
group.id,
type: ChatType.group,
final newConversation = PrivateDirectMessageEntity(
id: group.id,
pubkey: 'pubKey',
createdAt: DateTime.now(),
data: const PrivateDirectMessageData(content: [], media: {}),
);
final newData = [
newConversation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ class SelectableUserList extends HookConsumerWidget {
primary: false,
flexibleSpace: NavigationAppBar.modal(
showBackButton: false,
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
title: Text(title),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ class TypeSelectionModal<T extends SelectableType> extends HookConsumerWidget {
children: [
NavigationAppBar.modal(
showBackButton: false,
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
title: Text(title),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: ice License 1.0

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:ion/app/components/screen_offset/screen_side_offset.dart';
import 'package:ion/app/extensions/extensions.dart';
Expand All @@ -23,7 +22,7 @@ class ChatLearnMoreModal extends ConsumerWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.common_information),
actions: [NavigationCloseButton(onPressed: () => context.pop())],
actions: const [NavigationCloseButton()],
),
ScreenSideOffset.medium(
child: Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:ion/app/components/controllers/hooks/use_text_editing_with_highlights_controller.dart';
import 'package:ion/app/components/screen_offset/screen_bottom_offset.dart';
Expand Down Expand Up @@ -49,7 +48,7 @@ class NewChannelModal extends HookConsumerWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.channel_create_title),
actions: [NavigationCloseButton(onPressed: () => context.pop())],
actions: const [NavigationCloseButton()],
),
SizedBox(
height: 30.0.s,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: ice License 1.0

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:ion/app/components/button/button.dart';
import 'package:ion/app/components/inputs/search_input/search_input.dart';
Expand Down Expand Up @@ -30,7 +29,7 @@ class NewChatModal extends HookConsumerWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.new_chat_modal_title),
actions: [NavigationCloseButton(onPressed: () => context.pop())],
actions: const [NavigationCloseButton()],
),
SizedBox(height: 9.0.s),
Expanded(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ class CreateGroupModal extends HookConsumerWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.group_create_title),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
SizedBox(height: 27.0.s),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ class GroupTypeSelectionModal extends HookConsumerWidget {
children: [
NavigationAppBar.modal(
showBackButton: false,
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
title: Text(context.i18n.group_create_type_title),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:ion/app/components/button/button.dart';
import 'package:ion/app/components/read_more_text/read_more_text.dart';
Expand Down Expand Up @@ -48,7 +47,7 @@ class DAppDetailsModal extends HookConsumerWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(app.title),
actions: [NavigationCloseButton(onPressed: context.pop)],
actions: const [NavigationCloseButton()],
),
Flexible(
child: ScreenSideOffset.small(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RepostOptionsModal extends HookConsumerWidget {
NavigationAppBar.modal(
showBackButton: false,
title: Text(context.i18n.feed_repost_type),
actions: [NavigationCloseButton(onPressed: context.pop)],
actions: const [NavigationCloseButton()],
),
SizedBox(height: 6.0.s),
ScreenSideOffset.small(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ScheduleModal extends HookWidget {
children: [
NavigationAppBar.modal(
title: Text(context.i18n.schedule_modal_nav_title),
actions: [NavigationCloseButton(onPressed: () => context.pop())],
actions: const [NavigationCloseButton()],
onBackPress: () => context.pop(),
),
Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ class AuthenticatorSetupCodeConfirmPage extends HookConsumerWidget {
SliverAppBar(
primary: false,
flexibleSpace: NavigationAppBar.modal(
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
automaticallyImplyLeading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ class AuthenticatorSetupInstructionsPage extends HookConsumerWidget {
SliverAppBar(
primary: false,
flexibleSpace: NavigationAppBar.modal(
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
automaticallyImplyLeading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ class AuthenticatorSetupOptionsPage extends StatelessWidget {
SliverAppBar(
primary: false,
flexibleSpace: NavigationAppBar.modal(
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
automaticallyImplyLeading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ class SecureAccountErrorAlert extends ConsumerWidget {
children: [
NavigationAppBar.modal(
title: Text(locale.protect_account_header_security),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
SizedBox(height: 16.0.s),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ class BackupOptionsPage extends ConsumerWidget {
children: [
NavigationAppBar.modal(
title: Text(locale.protect_account_header_security),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
SizedBox(height: 16.0.s),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ class _NavBar extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return NavigationAppBar.modal(
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ class DeleteTwoFAStepScaffold extends ConsumerWidget {
AppBar(
primary: false,
flexibleSpace: NavigationAppBar.modal(
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
toolbarHeight: NavigationAppBar.modalHeaderHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ class EmailSetupPage extends ConsumerWidget {
primary: false,
flexibleSpace: NavigationAppBar.modal(
showBackButton: step != EmailSetupSteps.success,
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
toolbarHeight: NavigationAppBar.modalHeaderHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ class SelectCountryPage extends HookConsumerWidget {
children: [
NavigationAppBar.modal(
title: Text(context.i18n.select_countries_nav_title),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
Expanded(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ class PhoneSetupPage extends ConsumerWidget {
primary: false,
flexibleSpace: NavigationAppBar.modal(
showBackButton: step != PhoneSetupSteps.success,
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
toolbarHeight: NavigationAppBar.modalHeaderHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ class SecureAccountModal extends ConsumerWidget {
children: [
NavigationAppBar.modal(
title: Text(locale.protect_account_header_security),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
SizedBox(height: 16.0.s),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ class SecureAccountOptionsPage extends HookConsumerWidget {
children: [
NavigationAppBar.modal(
title: Text(locale.protect_account_header_security),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
SizedBox(height: 36.0.s),
Expand Down
6 changes: 2 additions & 4 deletions lib/app/features/settings/views/privacy_settings_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ class PrivacySettingsModal extends HookWidget {
children: [
NavigationAppBar.modal(
title: Text(context.i18n.settings_privacy),
actions: [
NavigationCloseButton(
onPressed: Navigator.of(context, rootNavigator: true).pop,
),
actions: const [
NavigationCloseButton(),
],
),
ScreenSideOffset.small(
Expand Down
Loading