Refactor ModernGlassButton to accept customizable padding
This commit is contained in:
@@ -336,6 +336,7 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
|
||||
padding: const EdgeInsets.only(left: 16, top: 4),
|
||||
child: ModernGlassButton(
|
||||
onPressed: _downloadFile,
|
||||
padding: EdgeInsets.zero,
|
||||
child: SizedBox(
|
||||
width: 80,
|
||||
child: const Center(child: Icon(Icons.download, size: 24)),
|
||||
|
||||
@@ -6,11 +6,13 @@ class ModernGlassButton extends StatefulWidget {
|
||||
final VoidCallback onPressed;
|
||||
final Widget child;
|
||||
final bool isLoading;
|
||||
final EdgeInsets padding;
|
||||
|
||||
const ModernGlassButton({
|
||||
required this.onPressed,
|
||||
required this.child,
|
||||
this.isLoading = false,
|
||||
this.padding = const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||
super.key,
|
||||
});
|
||||
|
||||
@@ -85,10 +87,7 @@ class _ModernGlassButtonState extends State<ModernGlassButton>
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
vertical: 8,
|
||||
),
|
||||
padding: widget.padding,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
gradient: LinearGradient(
|
||||
|
||||
Reference in New Issue
Block a user