Skip to content

Commit

Permalink
GS-8665 - swipe hamburger (#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgonred authored and github-actions[bot] committed May 4, 2023
1 parent 16bc313 commit 445fc9d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/workflows/reusable-deploy-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
vesdkLicenseVideoAndroid: ${{ secrets.VESDK_LICENSE_VIDEO_ANDROID_BASE64 }}
pesdkLicenseIos: ${{ secrets.PESDK_LICENSE_IOS_BASE64 }}
pesdkLicenseAndroid: ${{ secrets.PESDK_LICENSE_ANDROID_BASE64 }}
ENVIRONMENT_CONFIG_PRODUCTION: ${{ secrets.ENVIRONMENT_CONFIG_PRODUCTION }}

- name: Deploy to firebase
if: ${{ !inputs.disable_deploy }}
Expand Down
16 changes: 13 additions & 3 deletions lib/features/main/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:picnic_app/navigation/utils/root_navigator_observer.dart';
import 'package:picnic_app/ui/widgets/bottom_navigation/picnic_bottom_navigation.dart';
import 'package:picnic_app/ui/widgets/bottom_navigation/picnic_nav_item.dart';

//ignore: max
class MainPage extends StatefulWidget with HasPresenter<MainPresenter> {
const MainPage({
required this.presenter,
Expand Down Expand Up @@ -117,9 +118,12 @@ class _MainPageState extends State<MainPage> with PresenterStateMixin<MainViewMo
bottom: 0,
child: SizedBox(
width: screenWidth * _circlesSideMenuWidthPercentage,
child: CirclesSideMenuPage(
initialParams: CirclesSideMenuInitialParams(
onCircleSideMenuAction: presenter.onCircleSideMenuAction,
child: GestureDetector(
onHorizontalDragEnd: handleHorizontalDragEnd,
child: CirclesSideMenuPage(
initialParams: CirclesSideMenuInitialParams(
onCircleSideMenuAction: presenter.onCircleSideMenuAction,
),
),
),
),
Expand All @@ -131,4 +135,10 @@ class _MainPageState extends State<MainPage> with PresenterStateMixin<MainViewMo
),
);
}

Future<void> handleHorizontalDragEnd(DragEndDetails dragDetails) async {
if (dragDetails.velocity.pixelsPerSecond.dx < 1) {
presenter.onCirclesSideMenuToggled();
}
}
}
72 changes: 37 additions & 35 deletions lib/features/posts/post_details/post_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,41 +48,43 @@ class _PostDetailsPageState extends State<PostDetailsPage>
sigmaY: _blur,
);

return Scaffold(
resizeToAvoidBottomInset: false,
appBar: PicnicAppBar(
height: _appBarHeight,
backButtonBackdropFilter: state.isTransparent ? _buttonBackdropFilter : null,
backButtonColor: state.isTransparent ? _whiteColorWithOpacity : null,
backButtonIconColor: state.isTransparent ? _whiteColor : null,
actions: [
if (state.showOptions)
PicnicContainerIconButton(
iconPath: Assets.images.moreCircle.path,
onTap: presenter.onUserTap,
iconTintColor: state.isTransparent ? _whiteColor : null,
buttonColor: state.isTransparent ? _whiteColorWithOpacity : null,
backdropFilter: state.isTransparent ? _buttonBackdropFilter : null,
),
],
),
extendBodyBehindAppBar: true,
body: stateObserver(
buildWhen: (prev, current) => prev.isLoading != current.isLoading || prev.post != current.post,
builder: (context, state) {
if (state.isLoading) {
return const Center(child: PicnicLoadingIndicator());
}
return PostListItem(
onReport: (_) => presenter.onTapReportPost(),
post: state.post,
reportId: state.reportId,
postDetailsMode: state.mode,
overlaySize: PostOverlaySize.minimized,
onPostUpdated: presenter.onPostUpdated,
showTimestamp: true,
);
},
return stateObserver(
builder: (context, state) => Scaffold(
resizeToAvoidBottomInset: false,
appBar: PicnicAppBar(
height: _appBarHeight,
backButtonBackdropFilter: state.isTransparent ? _buttonBackdropFilter : null,
backButtonColor: state.isTransparent ? _whiteColorWithOpacity : null,
backButtonIconColor: state.isTransparent ? _whiteColor : null,
actions: [
if (state.showOptions)
PicnicContainerIconButton(
iconPath: Assets.images.moreCircle.path,
onTap: presenter.onUserTap,
iconTintColor: state.isTransparent ? _whiteColor : null,
buttonColor: state.isTransparent ? _whiteColorWithOpacity : null,
backdropFilter: state.isTransparent ? _buttonBackdropFilter : null,
),
],
),
extendBodyBehindAppBar: true,
body: stateObserver(
buildWhen: (prev, current) => prev.isLoading != current.isLoading || prev.post != current.post,
builder: (context, state) {
if (state.isLoading) {
return const Center(child: PicnicLoadingIndicator());
}
return PostListItem(
onReport: (_) => presenter.onTapReportPost(),
post: state.post,
reportId: state.reportId,
postDetailsMode: state.mode,
overlaySize: PostOverlaySize.minimized,
onPostUpdated: presenter.onPostUpdated,
showTimestamp: true,
);
},
),
),
);
}
Expand Down
12 changes: 4 additions & 8 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,10 @@ void main() async {
Future<void> _initFirebase() async {
// we initialize firebase here and not in AppInitUseCase, because we want crashlytics
// to be set up as soon as possible and cover potential failures on app start

try {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
} catch (e) {
logError(e);
}
await Firebase.initializeApp(
name: 'picnic_app',
options: DefaultFirebaseOptions.currentPlatform,
);
}

void _runPicnicApp() {
Expand Down

0 comments on commit 445fc9d

Please sign in to comment.