Add Dialog with Pageview to select new house, and then drop a pin where the house is, then zoom map to that area.
This commit is contained in:
104
lib/widgets/custom_dialog_box copy.dart
Normal file
104
lib/widgets/custom_dialog_box copy.dart
Normal file
@@ -0,0 +1,104 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wheres_my_sign/common/constants.dart';
|
||||
|
||||
class CustomDialogBox extends StatefulWidget {
|
||||
final String title, descriptions, text;
|
||||
final Image? img;
|
||||
|
||||
const CustomDialogBox({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.descriptions,
|
||||
required this.text,
|
||||
this.img,
|
||||
});
|
||||
|
||||
@override
|
||||
CustomDialogBoxState createState() => CustomDialogBoxState();
|
||||
}
|
||||
|
||||
class CustomDialogBoxState extends State<CustomDialogBox> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(Constants.padding),
|
||||
),
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: contentBox(context),
|
||||
);
|
||||
}
|
||||
|
||||
contentBox(context) {
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: Constants.padding,
|
||||
top: Constants.avatarRadius + Constants.padding,
|
||||
right: Constants.padding,
|
||||
bottom: Constants.padding,
|
||||
),
|
||||
margin: EdgeInsets.only(top: Constants.avatarRadius),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(Constants.padding),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black,
|
||||
offset: Offset(0, 10),
|
||||
blurRadius: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.title,
|
||||
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w600),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Text(
|
||||
widget.descriptions,
|
||||
style: TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 22),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(widget.text, style: TextStyle(fontSize: 18)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: Constants.padding,
|
||||
right: Constants.padding,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: Colors.transparent,
|
||||
radius: Constants.avatarRadius,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(Constants.avatarRadius),
|
||||
),
|
||||
child: Image.asset(
|
||||
"assets/icons/house.png",
|
||||
width: Constants.avatarRadius * 2,
|
||||
height: Constants.avatarRadius * 2,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user