-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #228 from mdgspace/responsive
ptch: make widgets responsive
- Loading branch information
Showing
30 changed files
with
619 additions
and
585 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 |
---|---|---|
@@ -1,41 +1,49 @@ | ||
import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg_provider/flutter_svg_provider.dart'; | ||
|
||
import 'dart:math' as math; | ||
|
||
class AppBanner extends StatelessWidget { | ||
const AppBanner({super.key, required this.height, required this.child}); | ||
final double height; | ||
final Widget child; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack(children: [ | ||
Container( | ||
height: height + 12, | ||
width: 360, | ||
decoration: const BoxDecoration( | ||
image: DecorationImage( | ||
image: Svg('assets/images/banner.svg'), | ||
fit: BoxFit.cover, | ||
return Column( | ||
children: [ | ||
Container( | ||
height: height + 12.toAutoScaledHeight, | ||
width: double.maxFinite, | ||
decoration: const BoxDecoration( | ||
image: DecorationImage( | ||
image: Svg('assets/images/banner.svg'), //path of image | ||
fit: BoxFit.fitWidth, | ||
)), | ||
child: Padding( | ||
padding: EdgeInsets.only( | ||
top: math.max(32, MediaQuery.of(context).padding.top), | ||
bottom: 12), | ||
child: child, | ||
), | ||
), | ||
child: child, | ||
), | ||
Positioned( | ||
bottom: 0, | ||
child: Container( | ||
height: 12, | ||
width: 360, | ||
decoration: const ShapeDecoration( | ||
color: Colors.white, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.only( | ||
topLeft: Radius.circular(12), | ||
topRight: Radius.circular(12), | ||
Transform.translate( | ||
offset: Offset(0, -12.toAutoScaledHeight), | ||
child: Container( | ||
height: 12.toAutoScaledHeight, | ||
decoration: ShapeDecoration( | ||
color: Colors.white, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.only( | ||
topLeft: Radius.circular(12.toAutoScaledWidth), | ||
topRight: Radius.circular(12.toAutoScaledWidth), | ||
), | ||
), | ||
), | ||
), | ||
), | ||
) | ||
]); | ||
) | ||
], | ||
); | ||
} | ||
} |
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
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
Oops, something went wrong.