proto ready
|
|
@ -25,6 +25,12 @@ apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.Xperience.QueueClient.queue_client"
|
namespace "com.Xperience.QueueClient.queue_client"
|
||||||
compileSdkVersion flutter.compileSdkVersion
|
compileSdkVersion flutter.compileSdkVersion
|
||||||
|
|
@ -54,11 +60,17 @@ android {
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
keyPassword keystoreProperties['keyPassword']
|
||||||
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||||
|
storePassword keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig signingConfigs.release
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="queue_client"
|
android:label="Digital Queue"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 17 KiB |
|
|
@ -103,6 +103,7 @@ class _DataManager{
|
||||||
}
|
}
|
||||||
bool joined = false;
|
bool joined = false;
|
||||||
for (var m_joinedService in joinedServices){
|
for (var m_joinedService in joinedServices){
|
||||||
|
Map<String, dynamic> joinedSer = jsonDecode(m_joinedService);
|
||||||
if(service['id'] == jsonDecode(m_joinedService)['service_id']){
|
if(service['id'] == jsonDecode(m_joinedService)['service_id']){
|
||||||
//Joined this
|
//Joined this
|
||||||
JoinedServices.add(jsonDecode(m_joinedService));
|
JoinedServices.add(jsonDecode(m_joinedService));
|
||||||
|
|
|
||||||
120
lib/home.dart
|
|
@ -103,15 +103,13 @@ class _HomePageState extends State<HomePage> {
|
||||||
DataManager.instance().JoinedServices.length, (index) {
|
DataManager.instance().JoinedServices.length, (index) {
|
||||||
Map<String, dynamic> service =
|
Map<String, dynamic> service =
|
||||||
(DataManager.instance().JoinedServices[index]);
|
(DataManager.instance().JoinedServices[index]);
|
||||||
return ServiceCard(
|
return JoinedCard(
|
||||||
tokenId: int.parse(service['id']),
|
appointmentId: int.parse(service['appointment_id']),
|
||||||
id: int.parse(service['service_id']),
|
id: int.parse(service['service_id']),
|
||||||
sTime: DateTime.parse(
|
sTime: DateTime.parse(
|
||||||
service['start_time'] ?? DateTime.now().toString()),
|
service['start_time'] ?? DateTime.now().toString()),
|
||||||
eTime: DateTime.parse(
|
|
||||||
service['end_time'] ?? DateTime.now().toString()),
|
|
||||||
name: service['name']!,
|
name: service['name']!,
|
||||||
memberCount: service['members']!.split(',').length - 1,
|
queueIndex: int.parse(service['member_pos']),
|
||||||
duration: Helpers.ParseDuration(service['duration'])
|
duration: Helpers.ParseDuration(service['duration'])
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
@ -137,14 +135,13 @@ class _HomePageState extends State<HomePage> {
|
||||||
Map<String, dynamic> service =
|
Map<String, dynamic> service =
|
||||||
DataManager.instance().AvailableServices[index];
|
DataManager.instance().AvailableServices[index];
|
||||||
return ServiceCard(
|
return ServiceCard(
|
||||||
tokenId: -1,
|
|
||||||
id: int.parse(service['id']),
|
id: int.parse(service['id']),
|
||||||
sTime: DateTime.parse(
|
sTime: DateTime.parse(
|
||||||
service['start_time'] ?? DateTime.now().toString()),
|
service['start_time'] ?? DateTime.now().toString()),
|
||||||
eTime: DateTime.parse(
|
eTime: DateTime.parse(
|
||||||
service['end_time'] ?? DateTime.now().toString()),
|
service['end_time'] ?? DateTime.now().toString()),
|
||||||
name: service['name']!,
|
name: service['name']!,
|
||||||
memberCount: service['members']!.split(',').length - 1,
|
memberCount: int.parse(service['member_count']),
|
||||||
duration: Helpers.ParseDuration(service['duration']));
|
duration: Helpers.ParseDuration(service['duration']));
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
@ -160,23 +157,14 @@ class _HomePageState extends State<HomePage> {
|
||||||
required DateTime eTime,
|
required DateTime eTime,
|
||||||
required String name,
|
required String name,
|
||||||
required int memberCount,
|
required int memberCount,
|
||||||
required int tokenId,
|
|
||||||
required Duration duration}) {
|
required Duration duration}) {
|
||||||
|
|
||||||
|
|
||||||
DateTime eta = sTime.add(duration * (tokenId > 0 ? tokenId : memberCount));
|
DateTime eta = sTime.add(duration * memberCount);
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
|
||||||
if(tokenId > 0){return;}
|
|
||||||
|
|
||||||
// await Navigator.of(context).push(MaterialPageRoute(
|
|
||||||
// builder: (context) => ServiceInfoPage(
|
|
||||||
// id: id,
|
|
||||||
// tokenId: tokenId,
|
|
||||||
// )));
|
|
||||||
|
|
||||||
bool confirmed = await Dialogs.AskQuestion(context, "Confirm", "Are you sure to join to this Queue?\n\nQueue Name : ${name}");
|
bool confirmed = await Dialogs.AskQuestion(context, "Confirm", "Are you sure to join to this Queue?\n\nQueue Name : ${name}");
|
||||||
if(confirmed){
|
if(confirmed){
|
||||||
Dialogs.waiting(context);
|
Dialogs.waiting(context);
|
||||||
|
|
@ -207,19 +195,8 @@ class _HomePageState extends State<HomePage> {
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: tokenId > 0 ? 0 : 10,),
|
SizedBox(height: 10,),
|
||||||
(tokenId > 0) ? Column(
|
Row(
|
||||||
children: [
|
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
||||||
Icon(Icons.token,size: 25,),
|
|
||||||
Text(
|
|
||||||
" ${tokenId}",
|
|
||||||
style: TextStyle(fontSize: 40),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Expanded(flex:1,child: Icon(Icons.people)),
|
Expanded(flex:1,child: Icon(Icons.people)),
|
||||||
|
|
@ -229,26 +206,13 @@ class _HomePageState extends State<HomePage> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Expanded(flex:1,child: Icon(Icons.access_time)),
|
Expanded(flex:1,child: Icon(Icons.access_time)),
|
||||||
Expanded(flex: 4,child: Text("Be there around ${Helpers.DateTimeToRelative(eta)}",maxLines: 3,overflow: TextOverflow.ellipsis,))
|
Expanded(flex: 4,child:
|
||||||
|
eta.isBefore(DateTime.now()) ? Text("Available right now !") : Text("Be there around ${Helpers.DateTimeToRelative(eta)}",maxLines: 3,overflow: TextOverflow.ellipsis,)
|
||||||
|
)
|
||||||
]),
|
]),
|
||||||
// (sTime.isAfter(DateTime.now()))
|
|
||||||
// ? Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
// children: [
|
|
||||||
// Expanded(flex:1,child: Icon(Icons.access_time)),
|
|
||||||
// Expanded(flex: 4,child: Text("Starts ${Helpers.DateTimeToRelative(sTime)}",maxLines: 3,overflow: TextOverflow.ellipsis,style: TextStyle(fontSize: 13),))
|
|
||||||
// ])
|
|
||||||
// : Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
// children: [
|
|
||||||
// Expanded(flex:1,child: Icon(Icons.directions_run_outlined)),
|
|
||||||
// Expanded(flex: 4,
|
|
||||||
// child: Text(
|
|
||||||
// "Ongoing until ${Helpers.DateTimeToRelative(eTime)}"),
|
|
||||||
// )
|
|
||||||
// ]),
|
|
||||||
|
|
||||||
(tokenId <=0) ?
|
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 10,),
|
SizedBox(height: 10,),
|
||||||
|
|
@ -259,12 +223,68 @@ class _HomePageState extends State<HomePage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
) : Container()
|
)
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget JoinedCard(
|
||||||
|
{required int id,
|
||||||
|
required DateTime sTime,
|
||||||
|
required String name,
|
||||||
|
required int queueIndex,
|
||||||
|
required int appointmentId,
|
||||||
|
required Duration duration}) {
|
||||||
|
|
||||||
|
DateTime eta = sTime.add(duration * appointmentId);
|
||||||
|
|
||||||
|
return Card(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(10.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
name,
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
),
|
||||||
|
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
|
Icon(Icons.people_alt_rounded,size: 25,),
|
||||||
|
Text(
|
||||||
|
" ${queueIndex-1}",
|
||||||
|
style: TextStyle(fontSize: 25),
|
||||||
|
),
|
||||||
|
])
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
|
Icon(Icons.token,size: 25,),
|
||||||
|
Text(
|
||||||
|
" ${appointmentId}",
|
||||||
|
style: TextStyle(fontSize: 40),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Expanded(flex:1,child: Icon(Icons.access_time)),
|
||||||
|
Expanded(flex: 4,child:
|
||||||
|
eta.isBefore(DateTime.now()) ? Text("You're late !") : Text("Be there around ${Helpers.DateTimeToRelative(eta)}",maxLines: 3,overflow: TextOverflow.ellipsis,)
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
// TODO: implement initState
|
||||||
super.initState();
|
super.initState();
|
||||||
Reset();
|
// Reset();
|
||||||
// AutoLogin();
|
AutoLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset() async{
|
void Reset() async{
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0+1
|
version: 1.0.3+3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.6 <4.0.0'
|
sdk: '>=3.0.6 <4.0.0'
|
||||||
|
|
|
||||||