add payment service page and translations
parent
a0300738e8
commit
4ac77593ad
@ -1,89 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ShowTimerText extends StatefulWidget {
|
||||
ShowTimerText({Key key, this.model});
|
||||
final model;
|
||||
|
||||
@override
|
||||
_ShowTimerTextState createState() => _ShowTimerTextState();
|
||||
}
|
||||
|
||||
class _ShowTimerTextState extends State<ShowTimerText> {
|
||||
String timerText = (TIMER_MIN - 1).toString() + ':59';
|
||||
int min = TIMER_MIN - 1;
|
||||
int sec = 59;
|
||||
Timer _timer;
|
||||
|
||||
// AuthProvider authProv;
|
||||
|
||||
resendCode() {
|
||||
min = TIMER_MIN - 1;
|
||||
sec = 59;
|
||||
_timer = Timer.periodic(Duration(seconds: 1), (Timer timer) {
|
||||
if (min <= 0 && sec <= 0) {
|
||||
timer.cancel();
|
||||
} else {
|
||||
setState(() {
|
||||
sec = sec - 1;
|
||||
if (sec == 0 && min == 0) {
|
||||
//TODO
|
||||
|
||||
min = 0;
|
||||
sec = 0;
|
||||
} else if (sec == 0) {
|
||||
min = min - 1;
|
||||
sec = 59;
|
||||
}
|
||||
timerText = min.toString() + ':' + sec.toString();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
resendCode();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_timer.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: min != 0 || sec != 0
|
||||
? null
|
||||
: () {
|
||||
resendActivatioinCode();
|
||||
},
|
||||
child: Text(
|
||||
timerText,
|
||||
style: TextStyle(
|
||||
fontSize: 3.0 * SizeConfig.textMultiplier,
|
||||
color: Hexcolor('#B8382C'),
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
resendActivatioinCode() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,151 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PaymentService extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).paymentService,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context, FadePage(page: AdvancePaymentPage())),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
padding: EdgeInsets.all(9),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
shape: BoxShape.rectangle),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).payment,
|
||||
color: Hexcolor('#B61422'),
|
||||
bold: true,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(context).paymentOnline,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
Image.asset(
|
||||
'assets/images/al-habib_online_payment_service_icon.png',
|
||||
fit: BoxFit.fill,
|
||||
height: 55,
|
||||
width: double.infinity,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
padding: EdgeInsets.all(9),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
shape: BoxShape.rectangle),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).onlineCheckIn,
|
||||
color: Hexcolor('#B61422'),
|
||||
bold: true,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(context).appointment,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
Align(
|
||||
alignment: projectViewModel.isArabic
|
||||
? Alignment.centerRight
|
||||
: Alignment.centerLeft,
|
||||
child: Image.asset(
|
||||
'assets/images/al-habib_online_payment_service_icon.png',
|
||||
height: 55,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.push(
|
||||
context, FadePage(page: MyBalancePage())),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
padding: EdgeInsets.all(9),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
shape: BoxShape.rectangle),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
'My Balances',
|
||||
color: Hexcolor('#B61422'),
|
||||
bold: true,
|
||||
),
|
||||
Texts(
|
||||
TranslationBase.of(context).payment,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
Align(
|
||||
alignment: projectViewModel.isArabic
|
||||
? Alignment.centerRight
|
||||
: Alignment.centerLeft,
|
||||
child: Image.asset(
|
||||
'assets/images/al-habib_online_payment_service_icon.png',
|
||||
height: 55,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue