diff --git a/packages/messenger/lib/main.dart b/packages/messenger/lib/main.dart index b3c3c22..9ac810a 100644 --- a/packages/messenger/lib/main.dart +++ b/packages/messenger/lib/main.dart @@ -4,6 +4,10 @@ import 'package:flutter/material.dart'; // apps import 'package:messenger/src/apps/apps.dart'; -void main() { +// configurations +import 'package:messenger/src/configurations/configurations.dart'; + +Future main() async { + await configureUrlStrategy(); runApp(const MessengerApp()); } diff --git a/packages/messenger/lib/src/configurations/configurations.dart b/packages/messenger/lib/src/configurations/configurations.dart new file mode 100644 index 0000000..dc9bcfa --- /dev/null +++ b/packages/messenger/lib/src/configurations/configurations.dart @@ -0,0 +1 @@ +export 'configure_url_strategy.dart'; diff --git a/packages/messenger/lib/src/configurations/configure_url_strategy.dart b/packages/messenger/lib/src/configurations/configure_url_strategy.dart new file mode 100644 index 0000000..91d33c7 --- /dev/null +++ b/packages/messenger/lib/src/configurations/configure_url_strategy.dart @@ -0,0 +1,6 @@ +// flutter +import 'package:flutter_web_plugins/url_strategy.dart'; + +Future configureUrlStrategy() async { + usePathUrlStrategy(); +} diff --git a/packages/messenger/lib/src/presentations/pages/chats_page/chats_page_view.dart b/packages/messenger/lib/src/presentations/pages/chats_page/chats_page_view.dart index 171564d..47869b5 100644 --- a/packages/messenger/lib/src/presentations/pages/chats_page/chats_page_view.dart +++ b/packages/messenger/lib/src/presentations/pages/chats_page/chats_page_view.dart @@ -141,7 +141,7 @@ class ChatsPageView extends StatelessWidget { padding: const EdgeInsets.only(bottom: 12.0), child: InkWell( // TODO: Replace with real chat ID - onTap: () => context.push( + onTap: () => context.go( RoutePath.chat.replaceAll(':chatId', '123'), ), child: buildChatsListItem( diff --git a/packages/messenger/lib/src/presentations/pages/profile_account_page/profile_account_page_view.dart b/packages/messenger/lib/src/presentations/pages/profile_account_page/profile_account_page_view.dart index 1e57821..113fc42 100644 --- a/packages/messenger/lib/src/presentations/pages/profile_account_page/profile_account_page_view.dart +++ b/packages/messenger/lib/src/presentations/pages/profile_account_page/profile_account_page_view.dart @@ -178,7 +178,7 @@ class ProfileAccountPageView extends StatelessWidget { Widget buildSaveButton() { return Builder(builder: (BuildContext context) { return InkWell( - onTap: () => context.push(RoutePath.contacts), + onTap: () => context.go(RoutePath.contacts), child: Container( width: 327.0, height: 52.0, diff --git a/packages/messenger/lib/src/presentations/pages/verification_phone_number_page/verification_phone_number_page_view.dart b/packages/messenger/lib/src/presentations/pages/verification_phone_number_page/verification_phone_number_page_view.dart index 86d4f06..bbe9ec4 100644 --- a/packages/messenger/lib/src/presentations/pages/verification_phone_number_page/verification_phone_number_page_view.dart +++ b/packages/messenger/lib/src/presentations/pages/verification_phone_number_page/verification_phone_number_page_view.dart @@ -188,7 +188,7 @@ class VerificationPhoneNumberPageView extends StatelessWidget { Widget buildContinueButton() { return Builder(builder: (BuildContext context) { return InkWell( - onTap: () => context.push(RoutePath.walkthroughVerificationPinNumber), + onTap: () => context.go(RoutePath.walkthroughVerificationPinNumber), child: Container( width: 327.0, height: 52.0, diff --git a/packages/messenger/lib/src/presentations/pages/verification_pin_number_page/verification_pin_number_page_view.dart b/packages/messenger/lib/src/presentations/pages/verification_pin_number_page/verification_pin_number_page_view.dart index 7e7c7db..fad04c1 100644 --- a/packages/messenger/lib/src/presentations/pages/verification_pin_number_page/verification_pin_number_page_view.dart +++ b/packages/messenger/lib/src/presentations/pages/verification_pin_number_page/verification_pin_number_page_view.dart @@ -329,7 +329,7 @@ class VerificationPinNumberPageView extends StatelessWidget { return Builder(builder: (BuildContext context) { return InkWell( // TODO: Replace with real resend action - onTap: () => context.push(RoutePath.walkthroughProfileAccount), + onTap: () => context.go(RoutePath.walkthroughProfileAccount), child: Container( width: 327.0, height: 52.0, diff --git a/packages/messenger/lib/src/presentations/pages/walkthrough_page/walkthrough_page_view.dart b/packages/messenger/lib/src/presentations/pages/walkthrough_page/walkthrough_page_view.dart index 6f6e616..27b0c19 100644 --- a/packages/messenger/lib/src/presentations/pages/walkthrough_page/walkthrough_page_view.dart +++ b/packages/messenger/lib/src/presentations/pages/walkthrough_page/walkthrough_page_view.dart @@ -94,7 +94,7 @@ class WalkthroughPageView extends StatelessWidget { Widget buildStartMessagingButton() { return Builder(builder: (BuildContext context) { return InkWell( - onTap: () => context.push(RoutePath.walkthroughVerificationPhoneNumber), + onTap: () => context.go(RoutePath.walkthroughVerificationPhoneNumber), child: Container( width: 327.0, height: 52.0, diff --git a/packages/messenger/lib/src/presentations/widgets/default_bottom_navigation_bar.dart b/packages/messenger/lib/src/presentations/widgets/default_bottom_navigation_bar.dart index d1a53df..aecfa95 100644 --- a/packages/messenger/lib/src/presentations/widgets/default_bottom_navigation_bar.dart +++ b/packages/messenger/lib/src/presentations/widgets/default_bottom_navigation_bar.dart @@ -39,13 +39,13 @@ class DefaultBottomNavigationBar extends StatelessWidget { onTap: (int index) { switch (index) { case 0: - context.push(RoutePath.contacts); + context.go(RoutePath.contacts); break; case 1: - context.push(RoutePath.chats); + context.go(RoutePath.chats); break; case 2: - context.push(RoutePath.more); + context.go(RoutePath.more); break; default: break;