Polish health app UI
This commit is contained in:
48
health_app/lib/widgets/drawer_shell.dart
Normal file
48
health_app/lib/widgets/drawer_shell.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DrawerShell extends StatelessWidget {
|
||||
final double widthFactor;
|
||||
final Widget child;
|
||||
|
||||
const DrawerShell({super.key, required this.child, this.widthFactor = 0.84});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
width: MediaQuery.of(context).size.width * widthFactor,
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.horizontal(right: Radius.circular(28)),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Image.asset(
|
||||
'assets/branding/drawer_background_v1.png',
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.centerLeft,
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.white.withValues(alpha: 0.12),
|
||||
Colors.white.withValues(alpha: 0.42),
|
||||
Colors.white.withValues(alpha: 0.72),
|
||||
],
|
||||
stops: const [0.0, 0.48, 1.0],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user