first commit
This commit is contained in:
146
lib/pages/component/custom_dialog_box.dart
Normal file
146
lib/pages/component/custom_dialog_box.dart
Normal file
@@ -0,0 +1,146 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomeDialogBox extends StatefulWidget {
|
||||
String title, description, positiveText, negativeText, screen;
|
||||
final Function onChangeStatus;
|
||||
|
||||
CustomeDialogBox({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.positiveText,
|
||||
required this.negativeText,
|
||||
required this.screen,
|
||||
required this.onChangeStatus,
|
||||
});
|
||||
|
||||
@override
|
||||
State<CustomeDialogBox> createState() => _CustomeDialogBoxState();
|
||||
}
|
||||
|
||||
class _CustomeDialogBoxState extends State<CustomeDialogBox> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: contentBox(context),
|
||||
);
|
||||
}
|
||||
|
||||
contentBox(context) {
|
||||
return Container(
|
||||
height: 200,
|
||||
padding: EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
offset: const Offset(
|
||||
0.5,
|
||||
2.0,
|
||||
),
|
||||
blurRadius: 3.0,
|
||||
spreadRadius: 2.0,
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 14,
|
||||
color: Color(0xFF29170B),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
widget.description,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 11,
|
||||
color: Color(0xFF080705),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 35,
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 15),
|
||||
child: Text(
|
||||
widget.negativeText,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
color: Color(0xFF29170B),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
widget.onChangeStatus();
|
||||
},
|
||||
child: Container(
|
||||
width: 115,
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
10,
|
||||
10,
|
||||
10,
|
||||
10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Color(0xFF2ECC71),
|
||||
),
|
||||
child: Text(
|
||||
widget.positiveText,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
color: Color(0xFFFFFFFF),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
15
lib/pages/component/dropdown.dart
Normal file
15
lib/pages/component/dropdown.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Dropdown extends StatefulWidget {
|
||||
const Dropdown({super.key});
|
||||
|
||||
@override
|
||||
State<Dropdown> createState() => _DropdownState();
|
||||
}
|
||||
|
||||
class _DropdownState extends State<Dropdown> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
76
lib/pages/component/success_dialog_box.dart
Normal file
76
lib/pages/component/success_dialog_box.dart
Normal file
@@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SuccessDialogBox extends StatefulWidget {
|
||||
String deskripsi;
|
||||
SuccessDialogBox({
|
||||
super.key,
|
||||
required this.deskripsi,
|
||||
});
|
||||
|
||||
@override
|
||||
State<SuccessDialogBox> createState() => _SuccessDialogBoxState();
|
||||
}
|
||||
|
||||
class _SuccessDialogBoxState extends State<SuccessDialogBox> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 160,
|
||||
padding: EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Color(0xFF2ECC71),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
offset: const Offset(
|
||||
0.5,
|
||||
2.0,
|
||||
),
|
||||
blurRadius: 3.0,
|
||||
spreadRadius: 2.0,
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/success.png'),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
"BERHASIL",
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
widget.deskripsi,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 10,
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user