first commit
This commit is contained in:
135
lib/screen/widgets/dialog_print.dart
Normal file
135
lib/screen/widgets/dialog_print.dart
Normal file
@@ -0,0 +1,135 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
|
||||
// ignore: non_constant_identifier_names
|
||||
Future<String?> DialogPrint(BuildContext context, String noAntrian,
|
||||
Function funcPrintTicket, String serviceName) {
|
||||
return showDialog<String>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Dialog(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
'CETAK TIKET ANTRIAN',
|
||||
style: Constant.subTitle(context: context),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: const Divider()),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
serviceName,
|
||||
style: Constant.subTitle(context: context),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
noAntrian,
|
||||
style: Constant.subTitle(context: context),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: QrImageView(
|
||||
data: noAntrian,
|
||||
version: QrVersions.auto,
|
||||
size: 290,
|
||||
// embeddedImage: AssetImage('assets/images/logo-westerindo.png'),
|
||||
// embeddedImageStyle: ,
|
||||
gapless: false,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
funcPrintTicket(noAntrian);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 5, backgroundColor: Colors.blue),
|
||||
child: Text(
|
||||
'Cetak Tiket',
|
||||
style: Constant.label(context: context)
|
||||
.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Scan qr code atau tekan tombol 'cetak tiket' untuk mendapatkan tiket",
|
||||
style: Constant.label(context: context),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
"Tutup dialog setelah mendapatkan tiket",
|
||||
style: Constant.label(context: context),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: const Divider()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text('Tutup'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
59
lib/screen/widgets/error_dialog.dart
Normal file
59
lib/screen/widgets/error_dialog.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
|
||||
Future<String?> ErrorDialog(
|
||||
BuildContext context, String errorMsg, String header) {
|
||||
return showDialog<String>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Dialog(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
header,
|
||||
style: Constant.subTitle(context: context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: const Divider()),
|
||||
SizedBox(
|
||||
height: Constant.getActualY(context: context, y: 500),
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: ListView(
|
||||
children: [Text(errorMsg)],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: const Divider()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text('Tutup'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
59
lib/screen/widgets/pasien_online_dialog.dart
Normal file
59
lib/screen/widgets/pasien_online_dialog.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
|
||||
// ignore: non_constant_identifier_names
|
||||
Future<String?> PasienOnlineDialog(BuildContext context) {
|
||||
return showDialog<String>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Dialog(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Pasien Online',
|
||||
style: Constant.subTitle(context: context),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: const Divider()),
|
||||
SizedBox(
|
||||
height: Constant.getActualY(context: context, y: 500),
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: ListView(
|
||||
children: [TextField()],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: const Divider()),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 700),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text('Tutup'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user