first commit
This commit is contained in:
96
lib/widget/SamplingSoundSetting.dart
Normal file
96
lib/widget/SamplingSoundSetting.dart
Normal file
@@ -0,0 +1,96 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:queuedisplay/model/sampling_location_model.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
import '../model/counter_model.dart';
|
||||
|
||||
class SamplingSoundSetting extends StatelessWidget {
|
||||
const SamplingSoundSetting({
|
||||
Key? key,
|
||||
required this.isloading,
|
||||
required this.listSamplingLocation,
|
||||
required this.activeSoundSampling,
|
||||
}) : super(key: key);
|
||||
|
||||
final ValueNotifier<bool> isloading;
|
||||
final ValueNotifier<List<SamplingLocation>> listSamplingLocation;
|
||||
final ValueNotifier<List> activeSoundSampling;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding:
|
||||
EdgeInsets.only(right: Constant.getActualX(context: context, x: 50)),
|
||||
child: SizedBox(
|
||||
height: listSamplingLocation.value.length != 1
|
||||
? (Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15)) *
|
||||
(listSamplingLocation.value.length * 3.1)
|
||||
: Constant.getActualY(context: context, y: 70),
|
||||
child: (isloading.value)
|
||||
? Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 90),
|
||||
height: Constant.getActualY(context: context, y: 90),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: GridView.count(
|
||||
childAspectRatio:
|
||||
Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15),
|
||||
crossAxisCount: 2,
|
||||
children: listSamplingLocation.value
|
||||
.map(
|
||||
(e) => Row(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
child: CupertinoSwitch(
|
||||
value: e.value,
|
||||
onChanged: (val) {
|
||||
if (val) {
|
||||
var rwData =
|
||||
json.encode(activeSoundSampling.value);
|
||||
List data = json.decode(rwData);
|
||||
List actSnd = data;
|
||||
actSnd.add(e.mLocationID);
|
||||
activeSoundSampling.value = actSnd;
|
||||
}
|
||||
if (!val) {
|
||||
var rwData =
|
||||
json.encode(activeSoundSampling.value);
|
||||
List data = json.decode(rwData);
|
||||
List actSnd = data;
|
||||
actSnd.remove(e.mLocationID);
|
||||
activeSoundSampling.value = actSnd;
|
||||
}
|
||||
|
||||
e.value = val;
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${e.mLocationName}",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Constant.normal(context: context),
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
60
lib/widget/clock.dart
Normal file
60
lib/widget/clock.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
|
||||
class Clock extends HookConsumerWidget {
|
||||
const Clock({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final strHour = useState("");
|
||||
final strMinute = useState("");
|
||||
final strDate = useState("");
|
||||
final strMonth = useState("");
|
||||
final strYear = useState("");
|
||||
|
||||
useEffect(() {
|
||||
final tmr = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
final dt = DateFormat('yyyy-MMMM-dd-HH-mm-ss').format(DateTime.now());
|
||||
final splited = dt.split('-');
|
||||
final date = splited[2].toString();
|
||||
final month = splited[1].toString();
|
||||
final year = splited[0].toString();
|
||||
final hour = splited[3].toString();
|
||||
final minute = splited[4].toString();
|
||||
|
||||
if (hour != strHour.value) strHour.value = hour;
|
||||
if (minute != strMinute.value) strMinute.value = minute;
|
||||
if (date != strDate.value) strDate.value = date;
|
||||
if (month != strMonth.value) strMonth.value = month;
|
||||
if (year != strYear.value) strYear.value = year;
|
||||
});
|
||||
return () {
|
||||
tmr.cancel();
|
||||
};
|
||||
}, []);
|
||||
return SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 882),
|
||||
height: Constant.getActualY(context: context, y: 50),
|
||||
child: Container(
|
||||
width: Constant.getActualX(context: context, x: 882),
|
||||
height: Constant.getActualY(context: context, y: 50),
|
||||
// decoration: BoxDecoration(boxShadow: [
|
||||
// BoxShadow(color: Colors.black.withOpacity(0.25), blurRadius: 8)
|
||||
// ], borderRadius: BorderRadius.circular(20), color: Colors.white),
|
||||
child: Text(
|
||||
'${strDate.value} ${strMonth.value} ${strYear.value} ${strHour.value} : ${strMinute.value}',
|
||||
textAlign: TextAlign.left,
|
||||
style: Constant.body_3(context: context)
|
||||
.copyWith(color: Constant.textRed)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
96
lib/widget/counter_sound_setting.dart
Normal file
96
lib/widget/counter_sound_setting.dart
Normal file
@@ -0,0 +1,96 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
import '../model/service_model.dart';
|
||||
|
||||
class CounterSoundSetting extends StatelessWidget {
|
||||
const CounterSoundSetting({
|
||||
Key? key,
|
||||
required this.isLoading,
|
||||
required this.listService,
|
||||
required this.activeSoundCounter,
|
||||
}) : super(key: key);
|
||||
|
||||
final ValueNotifier<bool> isLoading;
|
||||
final ValueNotifier<List<Layanan>> listService;
|
||||
final ValueNotifier<List> activeSoundCounter;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding:
|
||||
EdgeInsets.only(right: Constant.getActualX(context: context, x: 50)),
|
||||
child: SizedBox(
|
||||
height: listService.value.length != 1
|
||||
? (Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15)) *
|
||||
(listService.value.length * 3.5)
|
||||
: Constant.getActualY(context: context, y: 70),
|
||||
child: (isLoading.value)
|
||||
? Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 90),
|
||||
height: Constant.getActualY(context: context, y: 90),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: GridView.count(
|
||||
childAspectRatio:
|
||||
Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15),
|
||||
crossAxisCount: 2,
|
||||
children: listService.value
|
||||
.map(
|
||||
(e) => Row(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
child: CupertinoSwitch(
|
||||
value: e.sound,
|
||||
onChanged: (val) {
|
||||
if (val) {
|
||||
var rwData =
|
||||
json.encode(activeSoundCounter.value);
|
||||
List data = json.decode(rwData);
|
||||
List actlyn = data;
|
||||
actlyn.add(e.counterID);
|
||||
activeSoundCounter.value = actlyn;
|
||||
}
|
||||
if (!val) {
|
||||
var rwData =
|
||||
json.encode(activeSoundCounter.value);
|
||||
List data = json.decode(rwData);
|
||||
List actlyn = data;
|
||||
actlyn.remove(e.counterID);
|
||||
activeSoundCounter.value = actlyn;
|
||||
}
|
||||
|
||||
e.sound = val;
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${e.counterCode} - ${e.locationName}",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Constant.normal(context: context),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
98
lib/widget/display_counter.dart
Normal file
98
lib/widget/display_counter.dart
Normal file
@@ -0,0 +1,98 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:queuedisplay/model/service_model.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
|
||||
class DisplayCounter extends StatelessWidget {
|
||||
const DisplayCounter(
|
||||
{Key? key,
|
||||
required this.isloading,
|
||||
required this.listService,
|
||||
required this.activeLayanan})
|
||||
: super(key: key);
|
||||
|
||||
final ValueNotifier<bool> isloading;
|
||||
final ValueNotifier<List<Layanan>> listService;
|
||||
// final ValueNotifier<List> activeLayanan;
|
||||
final ValueNotifier<List> activeLayanan;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding:
|
||||
EdgeInsets.only(right: Constant.getActualX(context: context, x: 50)),
|
||||
child: Container(
|
||||
// width: Constant.getActualX(
|
||||
// context: context, x: 500),
|
||||
height: listService.value.length != 1
|
||||
? (Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15)) *
|
||||
(listService.value.length * 3.5)
|
||||
: Constant.getActualY(context: context, y: 70),
|
||||
// color: Colors.red,
|
||||
child: (isloading.value)
|
||||
? Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 90),
|
||||
height: Constant.getActualY(context: context, y: 90),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: GridView.count(
|
||||
childAspectRatio:
|
||||
Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15),
|
||||
crossAxisCount: 2,
|
||||
children: listService.value
|
||||
.map(
|
||||
(e) => Row(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
child: CupertinoSwitch(
|
||||
value: e.value,
|
||||
onChanged: (val) {
|
||||
if (val) {
|
||||
var rwData = json.encode(activeLayanan.value);
|
||||
List data = json.decode(rwData);
|
||||
List actlyn = data;
|
||||
actlyn.add(e.counterID);
|
||||
activeLayanan.value = actlyn;
|
||||
}
|
||||
if (!val) {
|
||||
var rwData = json.encode(activeLayanan.value);
|
||||
List data = json.decode(rwData);
|
||||
List actlyn = data;
|
||||
actlyn.remove(e.counterID);
|
||||
activeLayanan.value = actlyn;
|
||||
}
|
||||
|
||||
e.value = val;
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${e.counterCode} - ${e.locationName}",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Constant.normal(context: context),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
106
lib/widget/display_dokter.dart
Normal file
106
lib/widget/display_dokter.dart
Normal file
@@ -0,0 +1,106 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
import '../model/layanan_dokter.dart';
|
||||
|
||||
class DisplayDoctor extends StatelessWidget {
|
||||
const DisplayDoctor({
|
||||
Key? key,
|
||||
required this.isLoadingDoctor,
|
||||
required this.listServiceDoctor,
|
||||
required this.activeSoundDoctor,
|
||||
}) : super(key: key);
|
||||
|
||||
final ValueNotifier<bool> isLoadingDoctor;
|
||||
final ValueNotifier<List<LayananDokter>> listServiceDoctor;
|
||||
final ValueNotifier<List> activeSoundDoctor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding:
|
||||
EdgeInsets.only(right: Constant.getActualX(context: context, x: 50)),
|
||||
child: SizedBox(
|
||||
// color: Colors.red,
|
||||
// width: Constant.getActualX(
|
||||
// context: context, x: 500),
|
||||
height: listServiceDoctor.value.length != 1
|
||||
? (Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15)) *
|
||||
(listServiceDoctor.value.length * 3.1)
|
||||
: Constant.getActualY(context: context, y: 70),
|
||||
child: (isLoadingDoctor.value)
|
||||
? Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 90),
|
||||
height: Constant.getActualY(context: context, y: 90),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: GridView.count(
|
||||
childAspectRatio:
|
||||
Constant.getActualY(context: context, y: 150) /
|
||||
Constant.getActualX(context: context, x: 15),
|
||||
crossAxisCount: 2,
|
||||
children: listServiceDoctor.value
|
||||
.map(
|
||||
(e) => Row(
|
||||
children: [
|
||||
FractionallySizedBox(
|
||||
child: CupertinoSwitch(
|
||||
value: e.value,
|
||||
onChanged: (val) {
|
||||
if (val) {
|
||||
var rwData =
|
||||
json.encode(activeSoundDoctor.value);
|
||||
List data = json.decode(rwData);
|
||||
List actlyn = data;
|
||||
actlyn.add(e.id);
|
||||
activeSoundDoctor.value = actlyn;
|
||||
}
|
||||
if (!val) {
|
||||
var rwData =
|
||||
json.encode(activeSoundDoctor.value);
|
||||
List data = json.decode(rwData);
|
||||
List actlyn = data;
|
||||
actlyn.remove(e.id);
|
||||
activeSoundDoctor.value = actlyn;
|
||||
}
|
||||
|
||||
e.value = val;
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: e.isConsultDoctor == 'N'
|
||||
? Text(
|
||||
e.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Constant.normal(context: context),
|
||||
)
|
||||
: Text(
|
||||
"${e.name} ${e.doctorName}",
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Constant.normal(context: context),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
115
lib/widget/my_antrian_customer_service_dedicated.dart
Normal file
115
lib/widget/my_antrian_customer_service_dedicated.dart
Normal file
@@ -0,0 +1,115 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
|
||||
class MyAntrianCustomerServiceDedicated extends StatelessWidget {
|
||||
final String antrian;
|
||||
final String skip;
|
||||
const MyAntrianCustomerServiceDedicated(
|
||||
{Key? key, required this.antrian, required this.skip})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// return SizedBox(
|
||||
// width: Constant.getActualX(context: context, x: 420),
|
||||
// height: Constant.getActualY(context: context, y: 100),
|
||||
// child: Stack(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// children: [
|
||||
// Container(
|
||||
// width: Constant.getActualX(context: context, x: 420),
|
||||
// height: Constant.getActualY(context: context, y: 80),
|
||||
// decoration: BoxDecoration(boxShadow: [
|
||||
// BoxShadow(color: Colors.black.withOpacity(0.25), blurRadius: 8)
|
||||
// ], borderRadius: BorderRadius.circular(20), color: Colors.white),
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.only(
|
||||
// left: 80,
|
||||
// ),
|
||||
// child: Text(antrian,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: Constant.h2(context: context)
|
||||
// .copyWith(color: Constant.textRed)),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(15),
|
||||
// child: Container(
|
||||
// width: Constant.getActualX(context: context, x: 100),
|
||||
// height: Constant.getActualY(context: context, y: 100),
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(20),
|
||||
// gradient:
|
||||
// LinearGradient(colors: [Constant.red1, Constant.red2])),
|
||||
// child: const Icon(
|
||||
// Icons.arrow_forward_ios_rounded,
|
||||
// size: 40,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 890),
|
||||
height: Constant.getActualY(context: context, y: 100),
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: [
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 890),
|
||||
height: Constant.getActualY(context: context, y: 80),
|
||||
decoration: BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black.withOpacity(0.25), blurRadius: 8)
|
||||
], borderRadius: BorderRadius.circular(20), color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 80),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
antrian,
|
||||
textAlign: TextAlign.left,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Constant.S50(context: context)
|
||||
.copyWith(color: Constant.textRed),
|
||||
),
|
||||
),
|
||||
skip != 'NEW'
|
||||
? SizedBox(
|
||||
width: Constant.getActualX(context: context, x: 100),
|
||||
child: Text('Skipped'))
|
||||
: SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10,
|
||||
),
|
||||
child: Container(
|
||||
width: Constant.getActualX(context: context, x: 50),
|
||||
height: Constant.getActualY(context: context, y: 50),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
gradient:
|
||||
LinearGradient(colors: [Constant.red1, Constant.red2])),
|
||||
child: const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 30,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
105
lib/widget/my_counter_customer_service_dedicated.dart
Normal file
105
lib/widget/my_counter_customer_service_dedicated.dart
Normal file
@@ -0,0 +1,105 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
|
||||
class MyCounterCustomerServiceDedicated extends HookWidget {
|
||||
final String counter;
|
||||
final String nomorAntrian;
|
||||
final BorderRadiusGeometry borderLuar;
|
||||
final BorderRadiusGeometry borderDalam;
|
||||
final bool blink;
|
||||
|
||||
const MyCounterCustomerServiceDedicated(
|
||||
{Key? key,
|
||||
required this.counter,
|
||||
required this.nomorAntrian,
|
||||
required this.borderLuar,
|
||||
required this.borderDalam,
|
||||
required this.blink})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AnimationController _ac =
|
||||
useAnimationController(duration: Duration(seconds: 2), initialValue: 1);
|
||||
_ac.repeat();
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 355),
|
||||
height: Constant.getActualY(context: context, y: 355),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: borderLuar,
|
||||
gradient: LinearGradient(colors: [Constant.red1, Constant.red2]),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.25),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(-2, 6))
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: Constant.getActualX(context: context, x: 297),
|
||||
height: Constant.getActualY(context: context, y: 297),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: borderDalam,
|
||||
border: Border.all(
|
||||
color: Colors.white,
|
||||
strokeAlign: BorderSide.strokeAlignInside,
|
||||
width: 3),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: blink
|
||||
? FadeTransition(
|
||||
opacity: _ac,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(counter,
|
||||
textAlign: TextAlign.center,
|
||||
style: Constant.body_1(context: context)
|
||||
.copyWith(color: Colors.white)),
|
||||
// blink
|
||||
// ? FadeTransition(
|
||||
// opacity: _ac,
|
||||
// child: Text(nomorAntrian,
|
||||
// style: Constant.body_1(context: context)
|
||||
// .copyWith(color: Colors.white)),
|
||||
// )
|
||||
// :
|
||||
Text(nomorAntrian,
|
||||
style: Constant.h1(context: context)
|
||||
.copyWith(color: Colors.white)),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(counter,
|
||||
textAlign: TextAlign.center,
|
||||
style: Constant.body_1(context: context)
|
||||
.copyWith(color: Colors.white)),
|
||||
// blink
|
||||
// ? FadeTransition(
|
||||
// opacity: _ac,
|
||||
// child: Text(nomorAntrian,
|
||||
// style: Constant.body_1(context: context)
|
||||
// .copyWith(color: Colors.white)),
|
||||
// )
|
||||
// :
|
||||
Text(nomorAntrian,
|
||||
style: Constant.S75(context: context)
|
||||
.copyWith(color: Colors.white)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
59
lib/widget/my_error_dialog.dart
Normal file
59
lib/widget/my_error_dialog.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
|
||||
Future<String?> myErrorDialog(
|
||||
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'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
88
lib/widget/my_error_dialog_state.dart
Normal file
88
lib/widget/my_error_dialog_state.dart
Normal file
@@ -0,0 +1,88 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:queuedisplay/model/error_msg_model.dart';
|
||||
import 'package:queuedisplay/provider/all_service_provider.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
|
||||
Future<String?> myErrorDialogState(BuildContext context, String header) {
|
||||
return showDialog<String>(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) =>
|
||||
HookConsumer(builder: (context, ref, child) {
|
||||
return Dialog(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Error",
|
||||
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(jsonEncode(ref.watch(errorListMsgProvider)))],
|
||||
children: ref
|
||||
.watch(errorListMsgProvider)
|
||||
.map((e) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
e.title.toString(),
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
Text(e.msg.toString()),
|
||||
// Text(jsonEncode(ref.watch(errorListMsgProvider))),
|
||||
SizedBox(
|
||||
height: Constant.getActualY(
|
||||
context: context, y: 20),
|
||||
)
|
||||
],
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
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);
|
||||
ref.read(errorListMsgProvider.notifier).state =
|
||||
List.empty(growable: true);
|
||||
},
|
||||
child: const Text('Tutup'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user