first commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:sign_checker/theme/theme.dart';
|
||||
|
||||
class IosPreview extends StatelessWidget {
|
||||
const IosPreview({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.padding = const EdgeInsets.symmetric(vertical: AppSpacing.s5),
|
||||
this.maxWidth = 420,
|
||||
this.stretch = false,
|
||||
});
|
||||
|
||||
const IosPreview.centered({super.key, required this.child})
|
||||
: padding = const EdgeInsets.all(AppSpacing.s5),
|
||||
maxWidth = 420,
|
||||
stretch = false;
|
||||
|
||||
final Widget child;
|
||||
final EdgeInsetsGeometry padding;
|
||||
final double maxWidth;
|
||||
final bool stretch;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ColoredBox(
|
||||
color: AppColors.of(context, AppColors.groupedBackground),
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: padding,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||
child: Column(
|
||||
crossAxisAlignment: stretch
|
||||
? CrossAxisAlignment.stretch
|
||||
: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [child],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class IosScreenPreview extends StatelessWidget {
|
||||
const IosScreenPreview({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => child;
|
||||
}
|
||||
Reference in New Issue
Block a user