Adjusted the font settings

faiz_marathon_signalR_critical
FaizHashmiCS22 2 years ago
parent 3457136cdc
commit 60e7b5a2a0

@ -483,6 +483,9 @@
"sponsoredBy": "برعاية:",
"question": "سؤال",
"marathoners": "الماراثون",
"prize": "جائزة:"
"prize": "جائزة:",
"winnerSelection": "اختيار الفائز",
"qualifiers": "تصفيات"
}

@ -483,5 +483,7 @@
"fromUserName": "From User Name",
"sentDate": "Sent Date",
"itemTypeDisplayName": "Item Type Display Name",
"none": "None"
"none": "None",
"winnerSelection": "Winner Selection",
"qualifiers": "Qualifiers"
}

@ -13,7 +13,6 @@ import 'package:mohem_flutter_app/models/chat/get_search_user_chat_model.dart';
import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_Model.dart';
import 'package:mohem_flutter_app/models/chat/get_user_login_token_model.dart' as login;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:signalr_netcore/hub_connection.dart';
import 'package:signalr_netcore/signalr_client.dart';
import 'package:logger/logger.dart' as L;

@ -18,6 +18,7 @@ import 'package:mohem_flutter_app/ui/login/verify_last_login_screen.dart';
import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart';
import 'package:mohem_flutter_app/ui/marathon/marathon_intro_screen.dart';
import 'package:mohem_flutter_app/ui/marathon/marathon_screen.dart';
import 'package:mohem_flutter_app/ui/marathon/marathon_winner_selection.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
@ -178,6 +179,7 @@ class AppRoutes {
//Marathon
static const String marathonIntroScreen = "/marathonIntroScreen";
static const String marathonScreen = "/marathonScreen";
static const String marathonWinnerSelection = "/marathonWinnerSelection";
static final Map<String, WidgetBuilder> routes = {
login: (BuildContext context) => LoginScreen(),
@ -288,5 +290,6 @@ class AppRoutes {
// Marathon
marathonIntroScreen: (BuildContext context) => MarathonIntroScreen(),
marathonScreen: (BuildContext context) => MarathonScreen(),
marathonWinnerSelection: (BuildContext context) => MarathonWinnerSelection(),
};
}

@ -435,6 +435,8 @@ class CodegenLoader extends AssetLoader{
"adult": "بالغ",
"updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟",
"fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد",
"pleaseEnterComments": "الرجاء إدخال التعليقات",
"skip": "يتخطى",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -470,6 +472,17 @@ class CodegenLoader extends AssetLoader{
"reset_locale": "إعادة ضبط اللغة",
"chat": "دردشة",
"mychats": "دردشاتي",
"advancedSearch": "بحث متقدم",
"openNot": "التبليغات المفتوحة",
"fyi": "تبليغات للعلم",
"toDo": "تبليغات الأعمال",
"all": "كل التبليغات",
"meNot": "تبليغات صادرة مني",
"view": "عرض",
"fromUserName": "من",
"sentDate": "تاريخ الإرسال",
"itemTypeDisplayName": "اسم العرض",
"none": "بدون",
"createNewChat": "إنشاء محادثة جديدة",
"brainMarathon": "ماراثون الدماغ",
"contestTopicAbout": "سيكون موضوع المسابقة حول:",
@ -487,17 +500,8 @@ class CodegenLoader extends AssetLoader{
"question": "سؤال",
"marathoners": "الماراثون",
"prize": "جائزة:",
"advancedSearch": "بحث متقدم",
"openNot": "التبليغات المفتوحة",
"fyi": "تبليغات للعلم",
"toDo": "تبليغات الأعمال",
"all": "كل التبليغات",
"meNot": "تبليغات صادرة مني",
"view": "عرض",
"fromUserName": "من",
"sentDate": "تاريخ الإرسال",
"itemTypeDisplayName": "اسم العرض",
"none": "بدون"
"winnerSelection": "اختيار الفائز",
"qualifiers": "تصفيات"
};
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
@ -920,6 +924,8 @@ static const Map<String,dynamic> en_US = {
"adult": "Adult",
"updateMember": "Are You Sure You Want to Update this Member?",
"fieldIsEmpty": "'{data}' Field is empty. Please select",
"pleaseEnterComments": "Please enter comments",
"skip": "skip",
"profile": {
"reset_password": {
"label": "Reset Password",
@ -982,7 +988,9 @@ static const Map<String,dynamic> en_US = {
"fromUserName": "From User Name",
"sentDate": "Sent Date",
"itemTypeDisplayName": "Item Type Display Name",
"none": "None"
"none": "None",
"winnerSelection": "Winner Selection",
"qualifiers": "Qualifiers"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -442,6 +442,17 @@ abstract class LocaleKeys {
static const reset_locale = 'reset_locale';
static const chat = 'chat';
static const mychats = 'mychats';
static const advancedSearch = 'advancedSearch';
static const openNot = 'openNot';
static const fyi = 'fyi';
static const toDo = 'toDo';
static const all = 'all';
static const meNot = 'meNot';
static const view = 'view';
static const fromUserName = 'fromUserName';
static const sentDate = 'sentDate';
static const itemTypeDisplayName = 'itemTypeDisplayName';
static const none = 'none';
static const createNewChat = 'createNewChat';
static const brainMarathon = 'brainMarathon';
static const contestTopicAbout = 'contestTopicAbout';
@ -459,16 +470,7 @@ abstract class LocaleKeys {
static const question = 'question';
static const marathoners = 'marathoners';
static const prize = 'prize';
static const advancedSearch = 'advancedSearch';
static const openNot = 'openNot';
static const fyi = 'fyi';
static const toDo = 'toDo';
static const all = 'all';
static const meNot = 'meNot';
static const view = 'view';
static const fromUserName = 'fromUserName';
static const sentDate = 'sentDate';
static const itemTypeDisplayName = 'itemTypeDisplayName';
static const none = 'none';
static const winnerSelection = 'winnerSelection';
static const qualifiers = 'qualifiers';
}

@ -12,13 +12,6 @@ class DummyQuestionModel {
});
}
final List<dynamic> answersDummyMap = [
{"answer": "Jeddah"},
{"answer": "Mecca"},
{"answer": "Riyaadh"},
{"answer": "Dammaam"},
];
List<DummyQuestionModel> questions = <DummyQuestionModel>[
DummyQuestionModel(
opt1: 'Riyadh 8',

@ -77,7 +77,7 @@ class MarathonDetailsCard extends StatelessWidget {
Flexible(
child:
"Nam suscipit turpis in pharetra euismsdef. Duis rutrum at nulla id aliquam"
.toText16(color: MyColors.grey77Color),
.toText14(color: MyColors.grey77Color),
)
],
),
@ -85,7 +85,9 @@ class MarathonDetailsCard extends StatelessWidget {
5.height,
Row(
children: <Widget>[
LocaleKeys.prize.tr().toText16(color: MyColors.grey77Color),
LocaleKeys.prize
.tr()
.toText16(color: MyColors.grey77Color, isBold: true),
" LED 55\" Android TV"
.toText16(color: MyColors.greenColor, isBold: true),
],
@ -95,7 +97,8 @@ class MarathonDetailsCard extends StatelessWidget {
LocaleKeys.sponsoredBy
.tr()
.toText16(color: MyColors.grey77Color),
" Extra".toText16(color: MyColors.black, isBold: true),
" Extra"
.toText16(color: MyColors.darkTextColor, isBold: true),
],
),
10.height,
@ -216,21 +219,19 @@ class MarathonFooter extends StatelessWidget {
],
),
),
);
).paddingOnly(right: 21, left: 21, top: 11, bottom: 0);
}
@override
Widget build(BuildContext context) {
return Container(
color: MyColors.kWhiteColor,
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 15),
child: provider.itsMarathonTime
return provider.itsMarathonTime
? DefaultButton(
LocaleKeys.joinMarathon.tr(),
() => Navigator.pushNamed(context, AppRoutes.marathonScreen),
).insideContainer
: Column(
: Container(
color: Colors.white,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
buildNoteForDemo(),

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:appinio_swiper/appinio_swiper.dart';
import 'package:flutter/cupertino.dart';
import 'package:mohem_flutter_app/config/routes.dart';
class MarathonProvider extends ChangeNotifier {
final AppinioSwiperController swiperController = AppinioSwiperController();
@ -15,17 +16,32 @@ class MarathonProvider extends ChangeNotifier {
notifyListeners();
}
int _currentQuestionNumber = 1;
final int totalQuestions = 10;
int get currentQuestionNumber => _currentQuestionNumber;
set currentQuestionNumber(int value) {
_currentQuestionNumber = value;
notifyListeners();
}
Timer timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) {});
int start = 20;
int start = 5;
void startTimer() {
start = 20;
void startTimer(BuildContext context) {
start = 5;
const Duration oneSec = Duration(seconds: 1);
timer = Timer.periodic(
oneSec,
(Timer timer) {
if (start == 0) {
if (currentQuestionNumber == 10) {
timer.cancel();
Navigator.pushNamed(context, AppRoutes.marathonWinnerSelection);
}
swiperController.swipeLeft();
currentQuestionNumber = currentQuestionNumber + 1;
timer.cancel();
} else {
start--;

@ -25,10 +25,11 @@ class MarathonScreen extends StatelessWidget {
child: Column(
children: <Widget>[
const MarathonHeader(),
21.height,
20.height,
MarathonProgressContainer(provider: provider)
.paddingOnly(left: 21, right: 21),
QuestionCard(provider: provider),
QuestionCard(provider: provider)
.paddingOnly(top: 12, left: 21, right: 21),
],
),
),
@ -48,14 +49,10 @@ class MarathonProgressContainer extends StatefulWidget {
}
class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
final int totalQuestions = 10;
final int currentQuestion = 04;
@override
void initState() {
scheduleMicrotask(() {
widget.provider.startTimer();
widget.provider.startTimer(context);
});
super.initState();
}
@ -85,19 +82,19 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
),
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 8),
child:
"${currentQuestion.toString()} / ${totalQuestions.toString()} ${LocaleKeys.question.tr()}"
"${widget.provider.currentQuestionNumber.toString()} / ${widget.provider.totalQuestions.toString()} ${LocaleKeys.question.tr()}"
.toText12(color: MyColors.white),
),
"23 ${LocaleKeys.marathoners.tr()}".toText14(),
"00:${widget.provider.start < 10 ? "0${widget.provider.start}" : widget.provider.start}"
.toText18(isBold: true),
.toText18(),
],
),
15.height,
const StepsIndicator(
StepsIndicator(
lineLength: 23,
nbSteps: 10,
selectedStep: 6,
selectedStep: widget.provider.currentQuestionNumber,
doneLineColor: MyColors.greenColor,
doneStepColor: MyColors.greenColor,
doneLineThickness: 6,
@ -110,13 +107,14 @@ class _MarathonProgressContainerState extends State<MarathonProgressContainer> {
unselectedStepColorIn: MyColors.lightGreyDeColor,
unselectedStepColorOut: MyColors.lightGreyDeColor,
undoneLineColor: MyColors.lightGreyDeColor,
enableLineAnimation: true,
enableStepAnimation: true,
enableLineAnimation: false,
enableStepAnimation: false,
),
12.height,
Row(
children: <Widget>[
"25% ${LocaleKeys.completed.tr()}".toText18(isBold: true),
"${widget.provider.currentQuestionNumber * 10}% ${LocaleKeys.completed.tr()}"
.toText14(isBold: true),
],
),
],

@ -0,0 +1,121 @@
import 'dart:async';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/decorations_helper.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart';
import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_header.dart';
import 'package:provider/provider.dart';
class MarathonWinnerSelection extends StatelessWidget {
const MarathonWinnerSelection({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
MarathonProvider provider = context.read<MarathonProvider>();
return Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
const MarathonHeader(),
20.height,
QualifiersContainer(provider: provider)
.paddingOnly(left: 21, right: 21),
20.height,
Container(
height: 50,
decoration: BoxDecoration(
color: MyColors.greenColor,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: const Color(0xff000000).withOpacity(.05),
blurRadius: 26,
offset: const Offset(0, -3),
),
],
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
"Muhammad Shrouf"
.toText18(isBold: true, color: MyColors.white),
"837436".toText18(isBold: true, color: MyColors.white),
],
),
),
).paddingOnly(left: 20, right: 20),
],
),
),
);
}
}
class QualifiersContainer extends StatefulWidget {
final MarathonProvider provider;
const QualifiersContainer({Key? key, required this.provider})
: super(key: key);
@override
State<QualifiersContainer> createState() => _QualifiersContainerState();
}
class _QualifiersContainerState extends State<QualifiersContainer> {
final int totalQuestions = 10;
final int currentQuestion = 04;
@override
void initState() {
scheduleMicrotask(() {
widget.provider.startTimer(context);
});
super.initState();
}
@override
void dispose() {
widget.provider.cancelTimer();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
decoration: MyDecorations.shadowDecoration,
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
LocaleKeys.winnerSelection
.tr()
.toText18(isBold: true, color: MyColors.grey3AColor),
"00:${widget.provider.start < 10 ? "0${widget.provider.start}" : widget.provider.start}"
.toText18(isBold: true, color: MyColors.redColor),
],
),
10.height,
Row(
children: [
"18 ".toText32(color: MyColors.greenColor),
LocaleKeys.qualifiers.tr().toText20(color: MyColors.greenColor),
],
),
],
),
);
}
}

@ -21,7 +21,7 @@ class BuildCountdownTimer extends StatelessWidget {
}) : super(key: key);
final TextStyle styleTextHome = const TextStyle(
fontSize: 9,
fontSize: 7,
color: MyColors.greyACColor,
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w600,
@ -29,12 +29,12 @@ class BuildCountdownTimer extends StatelessWidget {
);
final TextStyle styleDigitHome = const TextStyle(
height: 23 / 24,
height: 23 / 27,
color: MyColors.white,
fontSize: 24,
fontStyle: FontStyle.italic,
letterSpacing: -1.44,
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w600,
);
final TextStyle styleTextMarathon = const TextStyle(
@ -48,7 +48,7 @@ class BuildCountdownTimer extends StatelessWidget {
final TextStyle styleDigitMarathon = const TextStyle(
height: 23 / 24,
color: MyColors.darkTextColor,
fontSize: 32,
fontSize: 34,
letterSpacing: -1.44,
fontWeight: FontWeight.bold,
);

@ -38,7 +38,7 @@ class MarathonBanner extends StatelessWidget {
"Get Ready for the coming contest:",
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 11,
fontSize: 12,
fontWeight: FontWeight.w600,
color: MyColors.lightGreyEFColor,
letterSpacing: -0.4,
@ -50,14 +50,14 @@ class MarathonBanner extends StatelessWidget {
"Saudi Arabia",
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 20,
fontSize: 21,
fontWeight: FontWeight.bold,
color: MyColors.lightGreyEFColor,
// letterSpacing: -0.4,
),
),
),
5.height,
3.height,
BuildCountdownTimer(
timeToMarathon: dummyEndTime,
provider: provider,

@ -28,7 +28,10 @@ class _QuestionCardState extends State<QuestionCard> {
void _loadCards() {
for (DummyQuestionModel question in questions) {
questionCards.add(
QuestionContent(question: question),
QuestionContent(
question: question,
provider: widget.provider,
),
);
}
}
@ -37,18 +40,19 @@ class _QuestionCardState extends State<QuestionCard> {
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
height: 420,
width: double.infinity,
child: Consumer<MarathonProvider>(
builder: (BuildContext context, MarathonProvider provider, _) {
return AppinioSwiper(
padding: EdgeInsets.zero,
isDisabled: true,
controller: provider.swiperController,
unswipe: (int index, AppinioSwiperDirection direction) {},
cards: questionCards,
onSwipe: (int index, AppinioSwiperDirection direction) {
if (direction == AppinioSwiperDirection.left) {
provider.startTimer();
provider.startTimer(context);
}
},
);
@ -61,10 +65,12 @@ class _QuestionCardState extends State<QuestionCard> {
class QuestionContent extends StatelessWidget {
final DummyQuestionModel question;
final MarathonProvider provider;
const QuestionContent({
Key? key,
required this.question,
required this.provider,
}) : super(key: key);
@override
@ -86,7 +92,7 @@ class QuestionContent extends StatelessWidget {
child: Column(
children: <Widget>[
Container(
height: 90,
height: 78,
width: double.infinity,
decoration: const BoxDecoration(
gradient: LinearGradient(
@ -104,17 +110,20 @@ class QuestionContent extends StatelessWidget {
),
),
child: const Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 13),
child: Text(
"What is the capital of Saudi Arabia?",
style: TextStyle(
color: Colors.white,
fontSize: 18,
color: MyColors.white,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
),
AnswerContent(question: question),
),
AnswerContent(question: question, provider: provider),
],
),
);
@ -123,13 +132,16 @@ class QuestionContent extends StatelessWidget {
class AnswerContent extends StatelessWidget {
final DummyQuestionModel question;
final MarathonProvider provider;
const AnswerContent({Key? key, required this.question}) : super(key: key);
const AnswerContent(
{Key? key, required this.question, required this.provider})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(15),
padding: const EdgeInsets.all(13),
decoration: const BoxDecoration(
color: MyColors.kWhiteColor,
borderRadius: BorderRadius.only(
@ -143,7 +155,11 @@ class AnswerContent extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () {},
onTap: () {
provider.swiperController.swipeLeft();
provider.startTimer(context);
},
child: Container(
height: 60,
width: MediaQuery.of(context).size.width - 75,
@ -154,8 +170,8 @@ class AnswerContent extends StatelessWidget {
question.opt1!,
style: const TextStyle(
color: MyColors.darkTextColor,
fontWeight: FontWeight.bold,
fontSize: 18,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
),
@ -163,7 +179,10 @@ class AnswerContent extends StatelessWidget {
),
const SizedBox(height: 15),
InkWell(
onTap: () {},
onTap: () {
provider.swiperController.swipeLeft();
provider.startTimer(context);
},
child: Container(
height: 60,
width: MediaQuery.of(context).size.width - 75,
@ -174,8 +193,8 @@ class AnswerContent extends StatelessWidget {
question.opt2!,
style: const TextStyle(
color: MyColors.darkTextColor,
fontWeight: FontWeight.bold,
fontSize: 18,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
),
@ -183,7 +202,10 @@ class AnswerContent extends StatelessWidget {
),
const SizedBox(height: 15),
InkWell(
onTap: () {},
onTap: () {
provider.swiperController.swipeLeft();
provider.startTimer(context);
},
child: Container(
height: 60,
width: MediaQuery.of(context).size.width - 75,
@ -194,8 +216,8 @@ class AnswerContent extends StatelessWidget {
question.opt3!,
style: const TextStyle(
color: MyColors.darkTextColor,
fontWeight: FontWeight.bold,
fontSize: 18,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
),
@ -214,8 +236,8 @@ class AnswerContent extends StatelessWidget {
question.opt3!,
style: const TextStyle(
color: MyColors.darkTextColor,
fontWeight: FontWeight.bold,
fontSize: 18,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
),

Loading…
Cancel
Save