forked from gskinnerTeam/flutter-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
99 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:anchored_popups/anchored_popup_region.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_folio/core_packages.dart'; | ||
import 'package:flutter_folio/data/app_user.dart'; | ||
import 'package:flutter_folio/models/app_model.dart'; | ||
import 'package:flutter_folio/views/user_profile_card/user_profile_card.dart'; | ||
import 'package:flutter_folio/views/user_profile_card/user_profile_form.dart'; | ||
|
||
class RoundedProfileBtn extends StatelessWidget { | ||
const RoundedProfileBtn({Key? key, this.useBottomSheet = false, this.invertRow = false}) : super(key: key); | ||
final bool useBottomSheet; | ||
final bool invertRow; | ||
@override | ||
Widget build(BuildContext context) { | ||
AppUser? user = context.select((AppModel m) => m.currentUser); | ||
if (user == null) return Container(); | ||
// | ||
Widget profileIcon = | ||
StyledCircleImage(padding: EdgeInsets.all(Insets.xs), url: user.imageUrl ?? AppUser.kDefaultImageUrl); | ||
return useBottomSheet | ||
? SimpleBtn(ignoreDensity: true, onPressed: () => _showProfileSheet(context), child: profileIcon) | ||
: AnchoredPopUpRegion.hoverWithClick( | ||
clickPopChild: ClipRect( | ||
child: UserProfileCard(), | ||
//child: Container(width: 100, height: 100, color: Colors.red), | ||
), | ||
hoverPopChild: StyledTooltip("Open User Info panel"), | ||
buttonBuilder: (_, child, show) => SimpleBtn(onPressed: show, child: child), | ||
hoverPopAnchor: invertRow ? Alignment.topRight : Alignment.topLeft, | ||
clickPopAnchor: invertRow ? Alignment.topRight : Alignment.topLeft, | ||
clickAnchor: invertRow ? Alignment.bottomRight : Alignment.bottomLeft, | ||
child: profileIcon); | ||
} | ||
|
||
void _showProfileSheet(BuildContext context) { | ||
showStyledBottomSheet(context, | ||
child: Container( | ||
padding: EdgeInsets.all(Insets.xl), | ||
child: UserProfileForm(bottomSheet: true), | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
// Generated file. Do not edit. | ||
// | ||
|
||
// clang-format off | ||
|
||
import FlutterMacOS | ||
import Foundation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters