-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also adds a temporary info popup in the add OATH account dialog.
- Loading branch information
Showing
3 changed files
with
113 additions
and
3 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 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,49 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:material_symbols_icons/symbols.dart'; | ||
|
||
import '../app/message.dart'; | ||
import 'responsive_dialog.dart'; | ||
|
||
class InfoPopupButton extends StatelessWidget { | ||
final RichText infoText; | ||
final bool showDialog; | ||
const InfoPopupButton( | ||
{super.key, required this.infoText, this.showDialog = false}); | ||
|
||
Widget _buildInfoContent(BuildContext context) { | ||
return Padding( | ||
padding: EdgeInsets.all(12.0), | ||
child: infoText, | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
if (!showDialog) { | ||
return PopupMenuButton( | ||
popUpAnimationStyle: AnimationStyle(duration: Duration.zero), | ||
menuPadding: EdgeInsets.zero, | ||
icon: Icon(Symbols.info), | ||
itemBuilder: (context) { | ||
return [ | ||
PopupMenuItem(enabled: false, child: _buildInfoContent(context)) | ||
]; | ||
}, | ||
); | ||
} else { | ||
return IconButton( | ||
onPressed: () { | ||
// Show info content in dialog on smaller screens and mobile | ||
showBlurDialog( | ||
context: context, | ||
builder: (context) => ResponsiveDialog( | ||
forceDialog: true, | ||
child: _buildInfoContent(context), | ||
), | ||
); | ||
}, | ||
icon: Icon(Symbols.info), | ||
); | ||
} | ||
} | ||
} |
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