repo_id
stringlengths 21
168
| file_path
stringlengths 36
210
| content
stringlengths 1
9.98M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/kasko/kasko_view_offer.dart
|
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class KaskoViewOffer extends StatefulWidget {
static const routeName = '/kasko-presentation-offer';
@override
_KaskoViewOfferState createState() => _KaskoViewOfferState();
}
class _KaskoViewOfferState extends State<KaskoViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Kasko Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Teklifleri İncele',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Kasko Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem(
title:
'Sizin için bulduğumuz tüm teklifler hazır.En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 10),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Kasko Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Kasko Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 35),
child: Container(
decoration:
BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
color: Color(0x29000000),
blurRadius: 15,
offset: Offset(0, 5),
)
]),
padding: EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sigorta Bilgileriniz',
style: D16M,
),
SizedBox(
height: 16,
),
DualTextColumn(
text1: 'Adınız Soyadınız',
text2: 'Sinan Soylu'),
DualTextColumn(text1: 'Plaka', text2: '34 DRR 364'),
DualTextColumn(
text1: 'Araç',
text2:
'2020 / Peugeot / 308Allure Sport 1.2 Puretech.'),
GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Dask/dask_payment.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:flutter/material.dart';
import 'package:dijipol/presentation/utils/constant.dart';
class DaskPayment extends StatefulWidget {
static const routeName = '/dask-payment';
@override
_DaskPaymentState createState() => _DaskPaymentState();
}
class _DaskPaymentState extends State<DaskPayment> {
int radioValue = 1;
bool policyChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset('lib/assets/images/logo_banner1.png',
width: 128, height: 50),
),
const Spacer(),
Text(
'Dask Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 15),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Divider(),
const SizedBox(height: 31),
Text('Trafik Sigorta Poliçeniz', style: D18M),
const SizedBox(height: 13),
Row(
children: [
Image.asset(
'lib/assets/images/Aklogo.png',
width: 115,
height: 57,
),
SizedBox(width: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Zorunlu Trafik Sigortası',
style: D16M,
),
SizedBox(height: 8),
Text(
'Standart Teminatlı Ürün',
style: D12R,
),
],
),
],
),
const SizedBox(height: 15),
Row(
children: [
Text('2.380,80 TL', style: P24M),
SizedBox(width: 12),
Text('Peşin Fiyat', style: L12R),
],
),
const SizedBox(height: 24),
Divider(),
const SizedBox(height: 24),
Text('Kredi Kartı Bilgileri', style: D18M),
const SizedBox(height: 16),
AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
const SizedBox(height: 25),
AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
const SizedBox(height: 23),
Row(
children: const <Widget>[
Expanded(
child: AppTextInput(
label: 'İl',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
SizedBox(width: 16),
Expanded(
child: AppTextInput(
label: 'İlçe',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
),
],
),
const SizedBox(height: 25),
const SizedBox(height: 24),
Divider(),
const SizedBox(height: 24),
Text(' Taksit Seçenekleri', style: P16M),
const SizedBox(height: 20),
Row(
children: [
Expanded(child: Text(' Taksit Sayısı',style: D16M),),
SizedBox(
width: width / 4,
child: Text('Aylık',style: D16M),
),
SizedBox(
width: width / 4,
child: Text('Toplam',style: D16M),
),
],
),
Divider(),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
TableRow(
value: 1,
groupValue: radioValue,
onChanged: (int? val) {
setState(() {
radioValue = val ?? radioValue;
});
},
text1: 'Peşin',
text2: '2.380,80 TL',
text3: '2.380,80 TL'),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
'Poliçe Bilgilendirme formu’nu okudum.',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark),
),
),
],
),
Row(
children: <Widget>[
Checkbox(
value: policyChecked,
onChanged: (bool? p) => setState(() {
policyChecked = p ?? false;
}),
activeColor:
Theme.of(context).primaryColor,
),
Flexible(
child: Text(
'Poliçe Bilgilendirme formu’nu okudum.',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark),
),
),
],
),
SizedBox(height: 8),
AppButton(text: 'Ödemeyi Tamamla', onTap: (){}),
Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color (0x29000000),
blurRadius: 15 ,
)
],
),
child: Column(
children: [
AppTextInput(label: 'Referans Kodu',trailing: AppButton(text: 'Uygula',onTap: (){},),),
],
),
),
Column(
children: [
SizedBox(height: 17),
Row(
children: [Image.asset(
'lib/assets/images/Aklogo.png',
width: 115,
height: 57,
),
SizedBox(width: 12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Zorunlu Trafik Sigortası',
style: D16M,
),
SizedBox(height: 8),
Text(
'TN: 53208772',
style: D12R,
),
],
),
],
),
SizedBox(height: 9),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'412,15 TL X 3 Taksit',
style: L14M,
),
SizedBox(height: 2),
Text(
'1.311,25 TL',
style: P14M,
),
],
),
Spacer(),
AppButton(
text: 'Ödemeyi Tamamla',
onTap: (){},
fontSize: 15,
color: primaryColorDark,
padding: EdgeInsets.symmetric(horizontal: 18, vertical: 12),
),
],
),
SizedBox(height: 15),
],
),
],
),
))
],
),
),
);
}
}
class TableRow extends StatelessWidget {
final int value;
final int groupValue;
final void Function(int?) onChanged;
final String text1;
final String text2;
final String text3;
TableRow(
{required this.value,
required this.groupValue,
required this.onChanged,
required this.text1,
required this.text2,
required this.text3});
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Column(
children: [
// SizedBox(height: 15),
Row(
children: [
Expanded(
child: Row(
children: [
Radio(
value: this.value,
groupValue: this.groupValue,
onChanged: this.onChanged),
Text(text1,style: D16M ),
],
),
),
SizedBox(
width: width / 4,
child: Text(text2,style: D16R),
),
SizedBox(
width: width / 4,
child: Text(text3,style: D16R),
),
],
),
// SizedBox(height: 15),
Divider(),
],
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Dask/dask_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Dask/dask_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class DaskHomeScreen extends StatefulWidget {
static const String routeName = '/dask-home';
@override
_DaskHomeScreenState createState() => _DaskHomeScreenState();
}
class _DaskHomeScreenState extends State<DaskHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'heart-beat',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Dask Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
SizedBox(
height: 60,
child: TabBar(
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8592a8),
labelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
unselectedLabelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
indicatorWeight: 4,
indicatorColor: Theme.of(context).primaryColor,
indicatorPadding: const EdgeInsets.only(top: 20),
tabs: const <Widget>[
Tab(
text: 'Yeni Poliçe',
),
Tab(
text: 'Mevcut Poliçe',
),
],
),
),
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon:
Icon(Icons.keyboard_arrow_down),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
DaskEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Dask/dask_request_received.dart
|
import 'package:dijipol/presentation/home/offers/Dask/dask_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class DaskRequestReceived extends StatelessWidget {
static const String routeName = '/dask-request-received';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Dask Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 30),
const Center(
child: Icon(
Icons.check_circle,
size: 150,
color: Color(0xFF2ac769),
),
),
const SizedBox(height: 30),
Text(
'Talebiniz Başarıyla\nAlınmıştır',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore.',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: 'E-posta adresi: ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
),
),
TextSpan(
text: 'sinan_soylu@live.nl',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
],
style: const TextStyle(fontWeight: FontWeight.w500),
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
AppButton(
text: 'Anasayfaya Dön',
onTap: () {
Navigator.pushNamed(context, DaskViewOffer.routeName);
},
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Dask/dask_view_offer.dart
|
import 'package:dijipol/presentation/home/offers/Dask/dask_payment.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class DaskViewOffer extends StatefulWidget {
static const routeName = '/dask-presentation-offer';
@override
_DaskViewOfferState createState() => _DaskViewOfferState();
}
class _DaskViewOfferState extends State<DaskViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Dask Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Teklifleri İncele',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Dask Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Zorunlu Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {
Navigator.pushNamed(context, DaskPayment.routeName);
},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Dask Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {
Navigator.pushNamed(context, DaskPayment.routeName);
},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 35),
child: Container(
decoration:
BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
color: Color(0x29000000),
blurRadius: 15,
offset: Offset(0, 5),
)
]),
padding: EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sigorta Bilgileriniz',
style: D16M,
),
SizedBox(
height: 16,
),
DualTextColumn(
text1: 'Adınız Soyadınız',
text2: 'Sinan Soylu'),
DualTextColumn(
text1: 'Mesken',
text2: 'Bu******* Mh. Me***** Sk\nNo. 12 Da.'),
GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Dask/dask_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Dask/dask_request_received.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class DaskEnterInfo extends StatefulWidget {
static const String routeName = '/dask-enter-info';
@override
_DaskEnterInfoState createState() => _DaskEnterInfoState();
}
class _DaskEnterInfoState extends State<DaskEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
bool? doKnowRadioStep3;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Dask Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Column(
children: <Widget>[
Row(
children: [
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Yeni poliçe yaptırmak istiyorum'),
],
),
Row(
children: [
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Mevcut poliçemi yenilemek istiyorum'),
],
)
],
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Ruhsat sahibi TC kimlik numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0 && plakamRadio == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextInput(
label: 'Eski Dask Poliçe Numaranız',
placeholder: '12342323',
fontSize: 14,
),
SizedBox(height: 25),
Text('Dask Poliçe Numaramı Bilmiyorum' ,style: P16M),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Adres Seçimi',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
),
SizedBox(
width: 15,
),
Expanded(
child: Text(
'Ulusal Adres Veri Tabanında kayıt adresiniz',
style: TextStyle(
fontSize: 16,
color: Theme.of(context).primaryColorDark,
),
),
),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Text(
'Bu******* Mh. Me****** Sk. No. 12 Da.7Ü******* İstanbul',
style: D16M,
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Column(
children: <Widget>[
Row(
children: [
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'İkamet adresim ile devam et'),
],
),
Row(
children: [
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Adres Seçimi Yaparak ( il, ilçe, belde vb.)'),
],
)
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Column(
children: [
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Belde', initialtext1: 'Merkez', labeltext2: 'Mahalle', initialtext2: 'Burhaniye'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Cadde/Sokak Seç', initialtext1: 'Mevlana', labeltext2: 'Bina No', initialtext2: '12'),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
AppTextInput(
label: 'Kapı No',
readOnly: true,
initialValue: '6',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
disabled: false,
onTap: () {
setState(() {
currentStep = 3;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'04. Diğer Özellikler',
style: TextStyle(
color: currentStep >= 3
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 3) const SizedBox(width: 30),
if (currentStep > 3)
InkWell(
onTap: () => setState(() => currentStep = 3),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
// if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Dairenin brüt m2', initialtext1: 'Seçiniz', labeltext2: 'Binanın Yapı Tarzı', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Dairenin Kullanım Şekli', initialtext1: 'Seçiniz', labeltext2: 'İnşaat Yılı', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Binadaki Top. Kat Say.', initialtext1: 'Seçiniz', labeltext2: 'Bulunduğu Kat', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
Text('Rehinli Alacak Var mı?',style: D14M),
],
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Evet'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Hayır Yok'),
],
),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
const SizedBox(height: 20),
if (currentStep == 3 && (doKnowRadioStep3 ?? false))
DualAppTextInput(labeltext1: 'Kurum Seçiniz', initialtext1: 'Seçiniz', labeltext2: 'Şube Seçiniz', initialtext2: 'Seçiniz'),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
AppButton(
text: 'Devam Et',
disabled: doKnowRadioStep3 == null
,
onTap: () {
Navigator.of(context)
.pushNamed(DaskRequestReceived.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Konut/konut_view_offer.dart
|
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../../../../presentation/utils/constant.dart';
class KnoutViewOffer extends StatefulWidget {
static const routeName = '/knout-presentation-offer';
@override
_KnoutViewOfferState createState() => _KnoutViewOfferState();
}
class _KnoutViewOfferState extends State<KnoutViewOffer> {
bool switchValue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Knout Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
),
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: Text(
'Teklifleri İncele',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
SizedBox(height: 25),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
'Size En Uygun Knout Sigortası Teklifleri',
style: D16B,
),
),
SizedBox(height: 17),
OffersItem2(
title:
'Sizin için bulduğumuz tüm teklifler hazır. En pahalı ve en ucuz teklif arasında %0 fiyat avantajı bulunuyor',
icon: Icon(Icons.pie_chart),
backColor: primaryColorDark),
SizedBox(height: 21),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(17),
color: inputBG,
child: Text(
'Tüm Paketler(18)',
style: L16R,
),
),
),
],
),
),
SizedBox(height: 33),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Zorunlu Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: primaryColor,
headerVisible: true,
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: ViewOffersItem(
title: 'Knout Sigortası',
subtitle: 'Standart Teminatlı Ürün',
installment: '412,15 TL X 3 Taksit',
subinstallment: 'S1.311,25 TL',
onButtonTap: () {},
onChange: (val) {
setState(() {
switchValue = val;
});
},
switchvalue: this.switchValue,
bordercolor: Color(0xFFe4e7ec),
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 35),
child: Container(
decoration:
BoxDecoration(color: Colors.white, boxShadow: [
BoxShadow(
color: Color(0x29000000),
blurRadius: 15,
offset: Offset(0, 5),
)
]),
padding: EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sigorta Bilgileriniz',
style: D16M,
),
SizedBox(
height: 16,
),
DualTextColumn(
text1: 'Adınız Soyadınız',
text2: 'Sinan Soylu'),
DualTextColumn(
text1: 'Mesken',
text2: 'Bu******* Mh. Me***** Sk\nNo. 12 Da.'),
GestureDetector(
onTap: () {},
child: Row(
children: [
Icon(
Icons.edit,
color: primaryColor,
),
SizedBox(
width: 10,
),
Text(
'Düzenle',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Konut/konut_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Konut/konut_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class KnoutHomeScreen extends StatefulWidget {
static const String routeName = '/knout-home';
@override
_KnoutHomeScreenState createState() => _KnoutHomeScreenState();
}
class _KnoutHomeScreenState extends State<KnoutHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'house',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Knout Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
SizedBox(
height: 60,
child: TabBar(
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8592a8),
labelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
unselectedLabelStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
indicatorWeight: 4,
indicatorColor: Theme.of(context).primaryColor,
indicatorPadding: const EdgeInsets.only(top: 20),
tabs: const <Widget>[
Tab(
text: 'Ev Sahibiyim',
),
Tab(
text: 'Kiracıyım',
),
],
),
),
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
const SizedBox(height: 12),
if (index == 1)
const Padding(
padding: EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'Aracınızın Plaka İli',
readOnly: true,
initialValue: 'Seçiniz',
suffixIcon:
Icon(Icons.keyboard_arrow_down),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
KonutEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Konut/konut_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Konut/konut_view_offer.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class KonutEnterInfo extends StatefulWidget {
static const String routeName = '/konut-enter-info';
@override
_KonutEnterInfoState createState() => _KonutEnterInfoState();
}
class _KonutEnterInfoState extends State<KonutEnterInfo> {
int plakamRadio = 0;
int propertyOwnerRadio = 0;
int threeRadio = 0;
int currentStep = 0;
bool? doKnowRadioStep3;
List<bool> vehicleAccesoriesSelected = <bool>[
false,
false,
];
List<String> vehicleAccesories = <String>[
'Cam Teminatı',
'Dekorasyon Teminatı',
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Konut Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Text('Mülk Sahibi misiniz?',style: D14M),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Row(
children: <Widget>[
Expanded(
child: Row(
children: [
RadioText<int>(value: 0, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Ev Sahibiyim'),
],
),
),
Expanded(
child: Row(
children: [
RadioText<int>(value: 1, groupvalue: plakamRadio, onChange: (i) => setState(()=>plakamRadio = i),text:'Kiracıyım'),
],
),
),
],
),
if (currentStep == 0 && plakamRadio == 0)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
Text('Vadesi Dolmuş Poliçeniz var mı?',style: D14M),
SizedBox(height: 25),
Row(
children: <Widget>[
Expanded(
child: Row(
children: [
RadioText<int>(value: 0, groupvalue: propertyOwnerRadio, onChange: (i) => setState(()=>propertyOwnerRadio = i),text:'Evet, var'),
],
),
),
Expanded(
child: Row(
children: [
RadioText<int>(value: 1, groupvalue: propertyOwnerRadio, onChange: (i) => setState(()=>propertyOwnerRadio = i),text:'Hayır, yok'),
],
),
)
],
),
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: '512332323232',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '538 568 44 95',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
),
if (currentStep == 0 && plakamRadio == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
AppTextInput(
label: 'TC Kimlik Numarası / Vergi Numarası',
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Şirket Ünvanı (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
AppTextInput(
label: 'Cep Telefonu Numarası',
placeholder: '538 568 44 95',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'E-posta Adresi',
placeholder: 'örnek@gmail.com',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'@',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
if (plakamRadio == 0)
currentStep = 1;
else
currentStep = 2;
});
},
),
if (plakamRadio == 0)
const SizedBox(height: 20),
if (plakamRadio == 0)
const Divider(color: Color(0xFFe4e7ec)),
if (plakamRadio == 0)
const SizedBox(height: 20),
if (plakamRadio == 0)
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'0${plakamRadio == 0 ? 3 : 2}. Adres Seçimi',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.info_outline,
),
SizedBox(
width: 15,
),
Expanded(
child: Text(
'Ulusal Adres Veri Tabanında kayıt adresiniz',
style: TextStyle(
fontSize: 16,
color: Theme.of(context).primaryColorDark,
),
),
),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Text(
'Bu******* Mh. Me****** Sk. No. 12 Da.7Ü******* İstanbul',
style: D16M,
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Column(
children: <Widget>[
Row(
children: [
RadioText<int>(value: 0, groupvalue: threeRadio, onChange: (i) => setState(()=>threeRadio = i),text:'İkamet adresim ile devam et'),
],
),
Row(
children: [
RadioText<int>(value: 1, groupvalue: threeRadio, onChange: (i) => setState(()=>threeRadio = i),text:'Adres Seçimi Yaparak ( il, ilçe, belde vb.)'),
],
)
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2 && threeRadio == 1)
Column(
children: [
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Belde', initialtext1: 'Merkez', labeltext2: 'Mahalle', initialtext2: 'Burhaniye'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Cadde/Sokak Seç', initialtext1: 'Mevlana', labeltext2: 'Bina No', initialtext2: '12'),
SizedBox(height: 25),
AppTextInput(
label: 'Kapı No',
readOnly: true,
initialValue: '6',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
],
),
if (currentStep == 2) const SizedBox(height: 20),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
disabled: false,
onTap: () {
setState(() {
currentStep = 3;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'0${plakamRadio == 0 ? 4 : 3}. Konut Bilgileri',
style: TextStyle(
color: currentStep >= 3
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 3) const SizedBox(width: 30),
if (currentStep > 3)
InkWell(
onTap: () => setState(() => currentStep = 3),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
// if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Dairenin brüt m2', initialtext1: 'Yazınız', labeltext2: 'Binanın Yapı Tarzı', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Binadaki Top. Kat Say.', initialtext1: 'Seçiniz', labeltext2: 'İnşaat Yılı', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Binadaki Top. Kat Say.', initialtext1: 'Seçiniz', labeltext2: 'Bulunduğu Kat', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
Text('Rehinli Alacak Var mı?',style: D14M),
SizedBox(height: 15),
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Evet Var'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Hayır Yok'),
],
),
SizedBox(height: 25),
DualAppTextInput(labeltext1: 'Kurum Seçiniz', initialtext1: 'Seçiniz', labeltext2: 'Şube Seçiniz', initialtext2: 'Seçiniz'),
SizedBox(height: 25),
Text('Dask Var mı?',style: D14M),
SizedBox(height: 15),
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Evet Var'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Hayır Yok'),
],
),
SizedBox(height: 25),
Text('Konut 3 aydan fazla boş kalıyor mu?',style: D14M),
SizedBox(height: 15),
Row(
children: <Widget>[
RadioText<bool>(value: true, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Evet'),
RadioText<bool>(value: false, groupvalue: doKnowRadioStep3, onChange: (i) => setState(()=>doKnowRadioStep3 = i),text:'Hayır'),
],
),
SizedBox(height: 25),
Text(
'Teminatlar',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontWeight: FontWeight.w500,
fontSize: 16),
textAlign: TextAlign.left,
),
Column(
children: List<Widget>.generate(
vehicleAccesories.length,
(int i) => Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: Row(
children: <Widget>[
Checkbox(
value: vehicleAccesoriesSelected[i],
onChanged: (bool? e) {
if (e != null)
setState(() {
vehicleAccesoriesSelected[i] = e;
});
},
),
Expanded(
child: Text(
vehicleAccesories[i],
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColorDark,
),
),
),
Expanded(
child: AppTextInput(
placeholder: 'Örnek: 1000 TL',
backgroundColor:
vehicleAccesoriesSelected[i]
? Colors.white
: null,
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 6,
),
),
)
],
),
),
).toList(),
),
],
),
if (currentStep == 3) const SizedBox(height: 20),
if (currentStep == 3)
AppButton(
text: 'Devam Et',
disabled: doKnowRadioStep3 == null,
onTap: () {
Navigator.of(context)
.pushNamed(KnoutViewOffer.routeName);
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Cep/cep_home_screen.dart
|
import 'package:dijipol/presentation/home/offers/Cep/cep_enter_info.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_icon.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CepHomeScreen extends StatefulWidget {
static const String routeName = '/cep-home';
@override
_CepHomeScreenState createState() => _CepHomeScreenState();
}
class _CepHomeScreenState extends State<CepHomeScreen> {
bool policyChecked = false;
bool illuminationChecked = false;
bool receiveSmsChecked = false;
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(width: 20),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'S. SOYLU',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 35),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: CustomIcon(
'phone-cracked',
size: 40,
),
),
const SizedBox(height: 5),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
'Cep Telefonu Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 30),
Expanded(
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
),
color: Colors.white,
),
width: width,
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
Container(),
Expanded(
child: TabBarView(
children: List<Widget>.generate(
2,
(int index) => SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 25,
),
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel:
'Ruhsat sahibi TC kimlik numarası',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
const SizedBox(height: 12),
AppTextInput(
placeholder: '0850 *** ** **',
contentPadding:
const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin:
const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context)
.primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
CheckboxText(text: 'Gizlilik Politikası ve Kullanıcı Sözleşmesi’ni okudum ve onaylıyorum.', value: policyChecked, onChange: (bool? p) => setState(() => policyChecked = p ?? false)),
CheckboxText(text: 'Aydınlatma Metni’ni okudum.', value: illuminationChecked, onChange: (bool? p) => setState(() => illuminationChecked = p ?? false)),
CheckboxText(text: 'Yenilikler ve kampanyalar hakkında e-bülten ve sms almak istiyorum.', value: receiveSmsChecked, onChange: (bool? p) => setState(() => receiveSmsChecked = p ?? false)),
const SizedBox(height: 20),
AppButton(
text: 'Teklif Al',
color: Color(0xFF1ab759),
onTap: () {
Navigator.of(context).pushNamed(
CepEnterInfo.routeName,
);
},
),
],
),
),
),
),
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Cep/cep_request_received.dart
|
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class EvcilRequestReceived extends StatelessWidget {
static const String routeName = '/evcil-request-received';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Evcil Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 30),
const Center(
child: Icon(
Icons.check_circle,
size: 150,
color: Color(0xFF2ac769),
),
),
const SizedBox(height: 30),
Text(
'Talebiniz Başarıyla\nAlınmıştır',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore.',
style: TextStyle(
color: Theme.of(context).primaryColorLight,
fontSize: 14,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
RichText(
text: TextSpan(
children: <InlineSpan>[
TextSpan(
text: 'E-posta adresi: ',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
),
),
TextSpan(
text: 'sinan_soylu@live.nl',
style: TextStyle(
color: Theme.of(context).primaryColor,
),
),
],
style: const TextStyle(fontWeight: FontWeight.w500),
),
textAlign: TextAlign.center,
),
const SizedBox(height: 30),
AppButton(
text: 'Anasayfaya Dön',
onTap: () {
},
),
],
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home/offers
|
mirrored_repositories/Dijipol/lib/presentation/home/offers/Cep/cep_enter_info.dart
|
import 'package:dijipol/presentation/home/offers/Evcil/evcil_request_received.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dijipol/presentation/widgets/app_text_input.dart';
import 'package:dijipol/presentation/widgets/custom_widgets.dart';
import 'package:flutter/material.dart';
import '../../../../presentation/utils/constant.dart';
class CepEnterInfo extends StatefulWidget {
static const String routeName = '/cep-enter-info';
@override
_CepEnterInfoState createState() => _CepEnterInfoState();
}
class _CepEnterInfoState extends State<CepEnterInfo> {
int plakamRadio = 0;
int currentStep = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 20,
left: 25,
right: 25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Row(
children: <Widget>[
const Icon(Icons.arrow_back, size: 30),
const SizedBox(width: 10),
Text(
'Geri Dön',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
],
),
),
const Spacer(),
Text(
'Cep Sigortası',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 30),
Row(
children: <Widget>[
Container(
color: Theme.of(context).primaryColor,
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'01',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'02',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
const SizedBox(width: 15),
const Expanded(
child: Divider(
color: Color(0xFFbbc3cf),
),
),
const SizedBox(width: 15),
Container(
color: const Color(0xFFbbc3cf),
height: 32,
width: 32,
alignment: Alignment.center,
child: const Text(
'03',
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
],
),
const SizedBox(height: 8),
Center(
child: Text(
'Bilgileri Gir',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
const SizedBox(height: 10),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(color: Color(0xFFbbc3cf)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'01. Kimlik No ve Cep Telefonu',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 0) const SizedBox(width: 30),
if (currentStep > 0)
InkWell(
onTap: () => setState(() => currentStep = 0),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0)
Padding(
padding: const EdgeInsets.symmetric(
vertical: 12,
),
child: AppTextInput(
placeholder: '0850 *** ** **',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'+90',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
),
if (currentStep == 0 && plakamRadio == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextInput(
label: 'Eski Cep Poliçe Numaranız',
placeholder: '12342323',
fontSize: 14,
),
SizedBox(height: 25),
Text('Cep Poliçe Numaramı Bilmiyorum' ,style: P16M),
],
),
if (currentStep == 0) const SizedBox(height: 20),
if (currentStep == 0)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 1;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'02. Sigortalı Bilgileri',
style: TextStyle(
color: currentStep >= 1
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 1) const SizedBox(width: 30),
if (currentStep > 1)
InkWell(
onTap: () => setState(() => currentStep = 1),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Adınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Soyadınız (Opsiyonel)',
placeholder: 'Yazınız',
fontSize: 14,
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
DualAppTextInput(labeltext1: 'İl', initialtext1: 'Seçiniz', labeltext2: 'İlçe', initialtext2: 'Seçiniz'),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
const AppTextInput(
label: 'Doğum Tarihi',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
if (currentStep == 1) const SizedBox(height: 20),
if (currentStep == 1)
AppButton(
text: 'Devam Et',
onTap: () {
setState(() {
currentStep = 2;
});
},
),
const SizedBox(height: 20),
const Divider(color: Color(0xFFe4e7ec)),
const SizedBox(height: 20),
Row(
children: <Widget>[
Expanded(
child: Text(
'03. Adres Seçimi',
style: TextStyle(
color: currentStep >= 2
? Theme.of(context).primaryColorDark
: Theme.of(context).primaryColorLight,
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
),
if (currentStep > 2) const SizedBox(width: 30),
if (currentStep > 2)
InkWell(
onTap: () => setState(() => currentStep = 2),
child: Text(
'Güncelle',
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.underline,
),
),
),
],
),
if (currentStep == 2) SizedBox(height: 25),
if (currentStep == 2)
Column(
children: [
AppTextInput(
label: 'Boy',
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Kilo',
floatingLabel: 'TC kimlik numarası / Vergi Numarası',
contentPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
keyboardType: TextInputType.phone,
leading: Container(
color: const Color(0xFFe4e7ec),
width: 50,
height: 50,
margin: const EdgeInsets.only(right: 10),
alignment: Alignment.center,
child: Text(
'TC',
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w400,
),
),
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Mevcut Sağlık Sigortanız var mı?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Hangi Plan Tipi İstersiniz?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Sağlık teklifinizde Amerikan Hastanesi İsteniyor mu?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Acıbadem, Florence Nightangle gibi hastaneleri dahil edelim mi?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Ayakta tedaviyi kişi başı limitli mi limitsiz mi çalışalım?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Doğum teminatı isteniyor mu?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
SizedBox(height: 25),
AppTextInput(
label: 'Yurtdışı tedavi teminatı isteniyor mu?',
readOnly: true,
initialValue: 'Seçiniz',
fontSize: 14,
suffixIcon: Icon(Icons.keyboard_arrow_down),
contentPadding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
),
],
),
if (currentStep == 2) const SizedBox(height: 25),
if (currentStep == 2)
AppButton(
text: 'Devam Et',
disabled: false,
onTap: () {
Navigator.of(context)
.pushNamed(CepRequestReceived.routeName);
setState(() {
currentStep = 3;
});
},
),
const SizedBox(height: 20),
],
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation/home
|
mirrored_repositories/Dijipol/lib/presentation/home/start/start_screen.dart
|
import 'dart:ui';
import 'package:dijipol/presentation/auth/login.dart';
import 'package:dijipol/presentation/auth/register.dart';
import 'package:dijipol/presentation/home/offers/offers_screen.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class StartScreen extends StatefulWidget {
const StartScreen(this.changeTab);
static const String routeName = '/start-screen';
final void Function(String) changeTab;
@override
_StartScreenState createState() => _StartScreenState();
}
class _StartScreenState extends State<StartScreen> {
final PageController pageController = PageController(initialPage: 0);
final ValueNotifier<int> currentPage = ValueNotifier<int>(0);
@override
void initState() {
pageController.addListener(() {
setState(() {
currentPage.value = (pageController.page ?? 0).round();
});
});
super.initState();
}
@override
void dispose() {
pageController.dispose();
super.dispose();
}
void showDetailsModal() {
showModalBottomSheet<void>(
context: context,
backgroundColor: Colors.transparent,
builder: (_) => Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15),
topRight: Radius.circular(15),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(height: 8),
Container(
alignment: Alignment.center,
child: Container(
decoration: BoxDecoration(
color: const Color(0xFFbbc3cf),
borderRadius: BorderRadius.circular(100),
),
),
),
const SizedBox(height: 10),
],
),
),
);
}
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return Container(
color: const Color(0xFFbbc3cf),
padding: EdgeInsets.symmetric(
vertical: MediaQuery.of(context).padding.top + 20,
// horizontal: 20,
),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
const SizedBox(width: 20),
Image.asset(
'lib/assets/images/logo_banner.png',
width: width / 3,
fit: BoxFit.scaleDown,
),
const Spacer(),
AppButton(
text: 'Giriş Yap',
onTap: () {
Navigator.of(context).pushNamed(LoginScreen.routeName);
},
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
fontWeight: FontWeight.w500,
color: Colors.transparent,
textColor: Theme.of(context).primaryColorDark,
),
const SizedBox(width: 12),
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Üye Ol',
fontSize: 14,
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 7),
fontWeight: FontWeight.w500,
onTap: () {
Navigator.of(context).pushNamed(Register.routeName);
},
color: Colors.transparent,
textColor: Theme.of(context).primaryColor,
),
),
SizedBox(width: 10,)
],
),
Expanded(
child: PageView(
controller: pageController,
children: <Widget>[
SlideViewContainer(
key: const Key('1'),
text1: 'Aradığın sigorta, dijipol.com’da',
text2:
'Kasko’dan Dask’a, Tamamlayıcı Sağlık Sigortasından Seyahat Sigortasına kadar aradığın her teklifi bul, karşılaştır, satın al.',
infoButtonPressed: showDetailsModal,
changeTab: widget.changeTab,
),
SlideViewContainer(
key: const Key('2'),
text1: 'Kasko Sigortası',
text2:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
infoButtonPressed: showDetailsModal,
changeTab: widget.changeTab,
),
SlideViewContainer(
key: const Key('3'),
text1: 'Trafik Sigortası',
text2:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
infoButtonPressed: showDetailsModal,
changeTab: widget.changeTab,
),
SlideViewContainer(
key: const Key('4'),
text1: 'DASK Sigortası',
text2:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
infoButtonPressed: showDetailsModal,
changeTab: widget.changeTab,
),
SlideViewContainer(
key: const Key('5'),
text1: 'Konut Sigortası',
text2:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
infoButtonPressed: showDetailsModal,
changeTab: widget.changeTab,
),
SlideViewContainer(
key: const Key('6'),
text1: 'Tamamlayıcı Sağlık Sigortası',
text2:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ',
infoButtonPressed: showDetailsModal,
changeTab: widget.changeTab,
),
],
),
),
Container(
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(horizontal: 30),
child: ValueListenableBuilder<int>(
valueListenable: currentPage,
builder: (BuildContext ctx, int val, _) => DotsIndicator(
dotsCount: 6,
position: val.toDouble(),
decorator: DotsDecorator(
activeColor: Theme.of(context).primaryColor,
color: const Color(0xFFabb3bf),
size: const Size.square(12),
activeSize: const Size.square(20),
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(60),
),
spacing: const EdgeInsets.symmetric(horizontal: 5),
// shape: const CircleBorder(
// side: BorderSide(
// color: Colors.white,
// width: 1,
// ),
// ),
),
),
),
),
],
),
);
}
}
class SlideViewContainer extends StatelessWidget {
const SlideViewContainer({
Key? key,
required this.text1,
required this.text2,
required this.infoButtonPressed,
required this.changeTab,
}) : super(key: key);
final String text1;
final String text2;
final void Function() infoButtonPressed;
final void Function(String) changeTab;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
text1,
style: TextStyle(
fontSize: 34,
fontWeight: FontWeight.w700,
color: Theme.of(context).primaryColorDark,
),
textAlign: TextAlign.left,
),
Text(
text2,
style: TextStyle(
fontSize: 16,
color: Theme.of(context).primaryColorLight,
),
textAlign: TextAlign.left,
),
Row(
children: <Widget>[
Expanded(
child: AppButton(
text: 'Teklif Al',
onTap: () {
changeTab(OffersScreen.routeName);
},
color: const Color(0xFF1ab759),
),
),
const SizedBox(width: 18),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: Theme.of(context).primaryColor,
),
),
child: AppButton(
text: 'Bilgi Al',
onTap: infoButtonPressed,
padding: const EdgeInsets.symmetric(
vertical: 16,
horizontal: 18,
),
color: Colors.white,
textColor: Theme.of(context).primaryColor,
),
),
),
],
),
Row(
children: <Widget>[
SizedBox(
child: BenifitsButton(
text: 'İhtiyacın Olan Her Sigorta',
color: Theme.of(context).primaryColor,
icon: const Icon(CupertinoIcons.suit_heart),
),
),
SizedBox(
child: BenifitsButton(
text: 'Kişiselleştirilmiş Hizmet',
color: Theme.of(context).primaryColor,
icon: const Icon(Icons.headphones),
),
),
],
),
Row(
children: <Widget>[
SizedBox(
child: BenifitsButton(
text: 'Kolay Erişim',
color: Theme.of(context).primaryColor,
icon: const Icon(Icons.label_outline),
),
),
SizedBox(
child: BenifitsButton(
text: 'Kesintisiz Destek',
color: Theme.of(context).primaryColor,
icon: const Icon(Icons.shield_outlined),
),
),
],
),
],
),
);
}
}
class BenifitsButton extends StatelessWidget {
final String text;
final Color color;
final Widget icon;
const BenifitsButton({
required this.text,
required this.color,
required this.icon,
});
@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return SizedBox(
width: (width - 40) / 2,
child: Row(
children: <Widget>[
SizedBox(
width: 51,
height: 51,
child: Stack(
children: <Widget>[
const SizedBox(
width: 51,
height: 51,
),
Positioned(
bottom: 0,
right: 0,
child: Container(
height: 48,
width: 48,
color: color,
),
),
Positioned(
top: 0,
left: 0,
child: Container(
height: 48,
width: 48,
color: Colors.white,
alignment: Alignment.center,
child: icon,
),
),
],
),
),
const SizedBox(width: 8),
Flexible(
child: Text(
text,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryColorDark,
),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/first_open/select_language.dart
|
import 'package:dijipol/presentation/first_open/steps_pages.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:flutter/material.dart';
class SelectLanguageScreen extends StatelessWidget {
static const String routeName = '/select-language';
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: RichText(
text: TextSpan(
children: const <InlineSpan>[
TextSpan(
text: 'Please ',
style: TextStyle(fontWeight: FontWeight.w300),
),
TextSpan(
text: 'Select Language',
style: TextStyle(fontWeight: FontWeight.w700),
),
],
style: TextStyle(
color: Theme.of(context).primaryColorDark,
fontSize: 24,
),
),
),
),
const SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const SizedBox(width: 20),
const Icon(
Icons.radio_button_unchecked,
color: Color(0xFF0047bb),
),
Image.asset(
'lib/assets/images/turkey_flag.png',
width: 95,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Türkçe',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
Text(
'Turkish',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'اللغة التركية',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'ترکی',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'Tурецкий',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
],
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 50),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const SizedBox(width: 20),
const Icon(
Icons.radio_button_checked,
color: Color(0xFF0047bb),
),
Image.asset(
'lib/assets/images/uk_flag.png',
width: 95,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'English',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
Text(
'İngilizce',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'الإنجليزية',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'انگلیسی',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'Aнглийский',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
],
),
const SizedBox(width: 20),
],
),
const SizedBox(height: 50),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const SizedBox(width: 20),
const Icon(
Icons.radio_button_unchecked,
color: Color(0xFF0047bb),
),
Image.asset(
'lib/assets/images/saudi_flag.jpeg',
width: 95,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'عربى',
style: TextStyle(color: Theme.of(context).primaryColorDark),
),
Text(
'Arapça',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'Arabic',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'عربی',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
Text(
'Aрабский',
style: TextStyle(color: Theme.of(context).primaryColorLight),
),
],
),
const SizedBox(width: 20),
],
),
const Spacer(),
Padding(
padding: const EdgeInsets.all(25),
child: AppButton(
text: 'Continue',
onTap: () {
Navigator.of(context).pushNamed(StepsPagesScreen.routeName);
},
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/first_open/steps_pages.dart
|
import 'package:dijipol/presentation/home/home_bottom_tabs.dart';
import 'package:dijipol/presentation/widgets/app_button.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
class StepsPagesScreen extends StatefulWidget {
static const String routeName = '/steps-screen';
@override
_StepsPagesScreenState createState() => _StepsPagesScreenState();
}
class _StepsPagesScreenState extends State<StepsPagesScreen> {
final PageController pageController = PageController(initialPage: 0);
final ValueNotifier<int> currentPage = ValueNotifier<int>(0);
@override
void initState() {
pageController.addListener(() {
setState(() {
currentPage.value = (pageController.page ?? 0).round();
});
});
super.initState();
}
@override
void dispose() {
pageController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Column(
children: <Widget>[
Expanded(
child: PageView(
controller: pageController,
children: const <Widget>[
StepViewContainer(
key: Key('1'),
image: 'lib/assets/images/steps/s1.png',
),
StepViewContainer(
key: Key('2'),
image: 'lib/assets/images/steps/s2.png',
),
StepViewContainer(
key: Key('3'),
image: 'lib/assets/images/steps/s3.png',
),
StepViewContainer(
key: Key('4'),
image: 'lib/assets/images/steps/s4.png',
),
StepViewContainer(
key: Key('5'),
image: 'lib/assets/images/steps/s5.png',
),
],
),
),
Container(
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(horizontal: 30),
child: ValueListenableBuilder<int>(
valueListenable: currentPage,
builder: (BuildContext ctx, int val, _) => DotsIndicator(
dotsCount: 5,
position: val.toDouble(),
decorator: DotsDecorator(
activeColor: Theme.of(context).primaryColor,
color: const Color(0xFFBBC3CF),
size: const Size.square(12),
activeSize: const Size.square(20),
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(60),
),
spacing: const EdgeInsets.symmetric(horizontal: 5),
shape: const CircleBorder(
side: BorderSide(
color: Colors.white,
width: 1,
),
),
),
),
),
),
const SizedBox(height: 50),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
child: ValueListenableBuilder<int>(
valueListenable: currentPage,
builder: (BuildContext ctx, int val, _) => Text(
<String>[
'Get instant offer, Compare, Buy!',
'Track your past policies easily!',
'QR Code Ease Get Information Instantly!',
'24 Banks Contracted Cash, Installment Payment Facility!',
'29 Different Insurance Companies in one app',
][val.toInt()],
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
color: Theme.of(context).primaryColorDark,
),
maxLines: 2,
textAlign: TextAlign.center,
),
),
),
const SizedBox(height: 15),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sagittis vitae erat vitae vehicula. Cras id elementum mauris. Nam bibendum luctus justo non dapibus. ',
style: TextStyle(
fontSize: 16,
color: Theme.of(context).primaryColorLight,
),
textAlign: TextAlign.center,
),
),
Padding(
padding: const EdgeInsets.all(25),
child: ValueListenableBuilder<int>(
valueListenable: currentPage,
builder: (BuildContext ctx, int val, _) => Row(
children: <Widget>[
Expanded(
child: AppButton(
text: 'Continue',
onTap: () {
pageController.nextPage(
duration: const Duration(milliseconds: 500),
curve: Curves.ease,
);
if (val == 4) {
Navigator.of(context).pop();
Navigator.of(context).pushReplacementNamed(HomeBottomTabs.routeName);
}
},
),
),
if (val == 4)
Container()
else
Expanded(
child: AppButton(
color: Colors.white,
textColor: Theme.of(context).primaryColor,
text: 'Skip',
onTap: () {
Navigator.of(context).pop();
Navigator.of(context).pushReplacementNamed(HomeBottomTabs.routeName);
},
),
),
],
),
),
),
],
),
);
}
}
class StepViewContainer extends StatelessWidget {
const StepViewContainer({
Key? key,
required this.image,
}) : super(key: key);
final String image;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(30),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: Image.asset(image),
),
],
),
);
}
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/utils/color.dart
|
import 'package:flutter/material.dart';
Map<int, Color> materialColorMaker(int r, int g, int b) {
return <int, Color>{
50: Color.fromRGBO(r, g, b, .1),
100: Color.fromRGBO(r, g, b, .2),
200: Color.fromRGBO(r, g, b, .3),
300: Color.fromRGBO(r, g, b, .4),
400: Color.fromRGBO(r, g, b, .5),
500: Color.fromRGBO(r, g, b, .6),
600: Color.fromRGBO(r, g, b, .7),
700: Color.fromRGBO(r, g, b, .8),
800: Color.fromRGBO(r, g, b, .9),
900: Color.fromRGBO(r, g, b, 1),
};
}
| 0
|
mirrored_repositories/Dijipol/lib/presentation
|
mirrored_repositories/Dijipol/lib/presentation/utils/constant.dart
|
import 'package:flutter/cupertino.dart';
const primaryColor = Color(0xFF0047ba);
const primaryColorDark = Color(0xFF090f4e);
const primaryColorLight = Color(0xFF5a7184);
const inputBG = Color(0xFFF1F3F5);
const primaryGreen = Color(0xFF20b759);
const D16B = TextStyle(
color: primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.bold,
);
const L16R = TextStyle(
color: primaryColorLight,
fontSize: 16,
fontWeight: FontWeight.w400
);
const L12_R = TextStyle(
color: primaryColorLight,
fontSize: 12,
fontWeight: FontWeight.w400
);
const D12B = TextStyle(
color: primaryColorDark,
fontSize: 12,
fontWeight: FontWeight.bold,
);
const D16M = TextStyle(
color: primaryColorDark,
fontSize: 16,
fontWeight: FontWeight.w500,
);
const D12R = TextStyle(
color: primaryColorDark,
fontSize: 12,
fontWeight: FontWeight.w400,
);
const L14M = TextStyle(
color: primaryColorLight,
fontSize: 14,
fontWeight: FontWeight.w500
);
const P14M = TextStyle(
color: primaryColor,
fontSize: 14,
fontWeight: FontWeight.w500
);
const P12M = TextStyle(
color: primaryColor,
fontSize: 12,
fontWeight: FontWeight.w500
);
const D10M = TextStyle(
color: primaryColorDark,
fontSize: 10,
fontWeight: FontWeight.w500,
);
const D14R = TextStyle(
color: primaryColorDark,
fontSize: 14,
fontWeight: FontWeight.w400
);
const D14M = TextStyle(
color: primaryColorDark,
fontSize: 14,
fontWeight: FontWeight.w500
);
const D24M = TextStyle(
color: primaryColorDark,
fontSize: 24,
fontWeight: FontWeight.w500
);
const P16M = TextStyle(
color: primaryColor,
fontSize: 16,
fontWeight: FontWeight.w500
);
const D18M = TextStyle(
color: primaryColorDark,
fontSize: 18,
fontWeight: FontWeight.w500
);
const P24M = TextStyle(
color: primaryColor,
fontSize: 24,
fontWeight: FontWeight.w500,
);
const P12R = TextStyle(
color: primaryColor,
fontSize: 12,
fontWeight: FontWeight.w400,
);
const L12R = TextStyle(
color: primaryColorLight,
fontSize: 12,
fontWeight: FontWeight.w400,
);
const D16R = TextStyle(
color: primaryColorLight,
fontSize: 12,
fontWeight: FontWeight.w400,
);
const P18S = TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.w600,
);
const L12M = TextStyle(
color: primaryColorLight,
fontSize: 12,
fontWeight: FontWeight.w400,
);
const P18M = TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.w400,
);
| 0
|
mirrored_repositories/Dijipol
|
mirrored_repositories/Dijipol/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:dijipol/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/DribbleUI_flutter
|
mirrored_repositories/DribbleUI_flutter/lib/main.dart
|
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Dribble Challenge",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.purple,
brightness: Brightness.light,
primaryTextTheme: TextTheme(
title: TextStyle(
color: Colors.black,
fontFamily: "Sans",
fontStyle: FontStyle.normal))),
home: Home(),
);
}
}
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
body: Container(
padding: EdgeInsets.only(top: 40),
child: Body(),
));
}
}
class Body extends StatefulWidget {
@override
_BodyState createState() => _BodyState();
}
class _BodyState extends State<Body> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
"Trendster",
style: TextStyle(
fontStyle: FontStyle.normal,
color: Colors.black,
fontSize: 30.0),
),
CircleAvatar(
child: Icon(
Icons.add,
color: Colors.white,
),
backgroundColor: Colors.purpleAccent,
),
],
),
Padding(
padding: const EdgeInsets.only(left: 0.0, top: 30.0, bottom: 8.0),
child: Row(
children: <Widget>[
Text(
"LIKES",
style: TextStyle(
fontStyle: FontStyle.normal,
),
),
Padding(
padding: const EdgeInsets.only(left: 40.0),
child: Text(
"COMMENTS",
style: TextStyle(),
),
),
Padding(
padding: const EdgeInsets.only(left: 40.0),
child: Text(
"TRENDS",
style: TextStyle(),
),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(
Icons.maximize,
size: 35.0,
color: Colors.amberAccent,
),
],
),
Row(
children: <Widget>[
//1st Card
Padding(
padding: const EdgeInsets.only(
right: 12.0,
left: 16.0,
),
child: Card(
elevation: 2.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(35.0)),
color: Colors.blue[800],
child: Container(
margin: EdgeInsets.all(30),
child: Column(
children: <Widget>[
Icon(
Icons.add_to_photos,
color: Colors.white,
size: 120.0,
),
Padding(
padding: const EdgeInsets.only(
top: 16.0, left: 0.0, bottom: 2.0),
child: Text(
" Copy Pasta\n Whatever\n Trends",
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontStyle: FontStyle.normal),
),
),
Container(
child: Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
"#EASYMONEY",
style: TextStyle(
fontSize: 12.0,
fontStyle: FontStyle.normal,
color: Colors.white,
),
),
),
)
],
),
),
),
),
//2nd Card
Padding(
padding: const EdgeInsets.only(left: 12.0),
child: Card(
elevation: 2.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(35.0)),
color: Colors.cyan,
child: Container(
margin: EdgeInsets.all(30),
child: Column(
children: <Widget>[
Icon(
Icons.cake,
color: Colors.white,
size: 120.0,
),
Padding(
padding: const EdgeInsets.only(
top: 16.0, left: 0.0, bottom: 2.0),
child: Text(
" Copy Cake\n Whenever\n Trends",
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontStyle: FontStyle.normal),
),
),
Container(
child: Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
"#JUSTDOIT",
style: TextStyle(
fontSize: 12.0,
fontStyle: FontStyle.normal,
color: Colors.white,
),
),
),
)
],
),
),
),
),
],
),
//Network
Padding(
padding: const EdgeInsets.only(top: 50.0, left: 16.0, bottom: 30.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
"Networks",
style: TextStyle(
fontStyle: FontStyle.normal,
fontSize: 20.0,
),
),
],
),
),
Row(
children: <Widget>[
//1st child
Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 0.0, bottom: 2.0, left: 12.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100.0)),
color: Colors.cyan,
elevation: 2.0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
gradient: LinearGradient(
colors: [Colors.blue[700], Colors.cyan],
begin: Alignment.topLeft,
end: Alignment.bottomRight)),
child: Padding(
padding: const EdgeInsets.only(
left: 30, right: 30, top: 30, bottom: 30),
child: Image.network(
"https://image.flaticon.com/icons/png/512/87/87380.png",
width: 50,
height: 50,
)),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
" BEHANCE",
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
),
),
)
],
),
//2nd child
Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 0.0, bottom: 2.0, left: 24.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100.0)),
color: Colors.cyan,
elevation: 2.0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
gradient: LinearGradient(
colors: [Colors.pink[700], Colors.pinkAccent],
begin: Alignment.topLeft,
end: Alignment.bottomRight)),
child: Padding(
padding: const EdgeInsets.only(
left: 30, right: 30, top: 30, bottom: 30),
child: Image.network(
"https://image.flaticon.com/icons/png/512/69/69441.png",
width: 50,
height: 50,
)),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
" DRIBBLE",
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
),
),
)
],
),
//3rd child
Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 0.0, bottom: 2.0, left: 24.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100.0)),
color: Colors.cyan,
elevation: 2.0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
gradient: LinearGradient(
colors: [
Colors.blue[700],
Colors.pinkAccent,
Colors.red,
Colors.orange,
Colors.amberAccent
],
begin: Alignment.topCenter,
end: Alignment.bottomRight)),
child: Padding(
padding: const EdgeInsets.only(
left: 30, right: 30, top: 30, bottom: 30),
child: Image.network(
"https://image.flaticon.com/icons/png/512/87/87390.png",
width: 50,
height: 50,
)),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
" INSTAGRAM",
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
),
),
)
],
),
],
)
],
),
);
}
}
| 0
|
mirrored_repositories/DribbleUI_flutter
|
mirrored_repositories/DribbleUI_flutter/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_fun/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/FlutterIntroSlider
|
mirrored_repositories/FlutterIntroSlider/lib/intro_page.dart
|
import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
var color1 = Color(0xff45e5ea);
var color1b = Color(0xff144446);
var color2 = Color(0xffab1fea);
var color2b = Color(0xff440c5d);
var color3 = Color(0xff00FF00);
var color3b = Color(0xff129314);
List<String> image = [
'assets/images/first.png',
'assets/images/second.png',
'assets/images/third.png'
];
List<String> title = [
'FIRST SCREEN',
'SECOND SCREEN',
'THRID SCREEN',
];
List<String> text = [
'Welcome to the Intro Slider App.',
'This is the second slide.',
'This is the third slide.'
];
class MyIntroPage extends StatefulWidget {
@override
_MyIntroPage createState() => _MyIntroPage();
}
class _MyIntroPage extends State<MyIntroPage> {
CarouselSlider carouselSlider;
int carouselIndex = 0;
@override
Widget build(BuildContext context) {
carouselSlider = CarouselSlider(
viewportFraction: 1.0,
enableInfiniteScroll: false,
onPageChanged: (index) {
setState(() {
carouselIndex = index;
});
},
height: MediaQuery
.of(context)
.size
.height,
items: <Widget>[
CarouselComponent(
col1: color1,
col2: color1b,
imgUrl: image[0],
ttl: title[0],
txt: text[0],
),
CarouselComponent(
col1: color2,
col2: color2b,
imgUrl: image[1],
ttl: title[1],
txt: text[1],
),
CarouselComponent(
col1: color3,
col2: color3b,
imgUrl: image[2],
ttl: title[2],
txt: text[2],
),
],
);
return Scaffold(
floatingActionButton: carouselIndex == 2
? Container()
: Stack(
children: <Widget>[
Align(
alignment: Alignment.bottomLeft,
child: FlatButton(
onPressed: () {
carouselSlider.nextPage(
duration: Duration(milliseconds: 500),
curve: Curves.ease);
},
child: Container(
margin: const EdgeInsets.only(left: 30.0),
child: Text(
'SKIP',
style: TextStyle(
color: Color(0xFFffffff),
fontWeight: FontWeight.w600),
),
),
),
),
Align(
alignment: Alignment.bottomRight,
child: FlatButton(
onPressed: () {
carouselSlider.nextPage(
duration: Duration(milliseconds: 500),
curve: Curves.ease);
},
child: Text(
'NEXT',
style: TextStyle(
color: Color(0xFFffffff),
fontWeight: FontWeight.w600),
),
),
),
],
),
body: Stack(
alignment: Alignment.center,
children: <Widget>[
carouselSlider,
carouselIndex == 2
? Stack(
children: <Widget>[
Align(
alignment: Alignment.bottomRight,
child: Container(
margin: const EdgeInsets.only(bottom: 10.0),
child: FlatButton(
onPressed: () {
navigateToLoginPage(context);
},
child: Text(
'LOGIN',
style: TextStyle(
color: Color(0xFFffffff),
fontWeight: FontWeight.w600),
),
),
),
),
Align(
alignment: Alignment.bottomLeft,
child: Container(
margin: const EdgeInsets.only(bottom: 10.0),
child: FlatButton(
onPressed: () {
navigateToRegisterPage(context);
},
child: Text(
'REGISTER',
style: TextStyle(
color: Color(0xFFffffff),
fontWeight: FontWeight.w600),
),
),
),
),
],
)
: Positioned(
bottom: 30,
child: Row(
children: <Widget>[
Indicator(
carouselIndex: carouselIndex,
indicatorIndex: 0,
),
Indicator(
carouselIndex: carouselIndex,
indicatorIndex: 1,
),
Indicator(
carouselIndex: carouselIndex,
indicatorIndex: 2,
),
],
),
),
],
),
);
}
}
Future navigateToRegisterPage(context) async {
//logic to proceed to register page
print("Register button clicked");
}
Future navigateToLoginPage(context) async {
//logic to proceed to register page
print("Login button clicked");
}
class CarouselComponent extends StatelessWidget {
final col1, col2, imgUrl, ttl, txt;
CarouselComponent({this.col1, this.col2, this.imgUrl, this.ttl, this.txt});
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery
.of(context)
.size
.width,
height: MediaQuery
.of(context)
.size
.height,
padding: EdgeInsets.only(right: 0),
color: col2,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [col1, col2],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
)
),
child: Column(
children: <Widget>[
SizedBox(
height: 100,
),
SizedBox(
height: 100,
),
Image.asset(
imgUrl,
height: 100,
),
SizedBox(
height: 50,
),
Text(
ttl,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 36,
),
),
SizedBox(
height: 20,
),
Container(
margin: const EdgeInsets.only(left: 30.0, right: 30.0),
child: Text(
txt,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 20,
),
),
),
//Show divider line close to the bottom
Expanded(
child: Padding(
padding: const EdgeInsets.only(bottom: 60.0),
child: Align(
alignment: Alignment.bottomCenter,
child: Divider(
color: Colors.white,
),
),
),
),
],
),
),
);
}
}
class Indicator extends StatelessWidget {
final carouselIndex, indicatorIndex;
Indicator({this.carouselIndex, this.indicatorIndex});
@override
Widget build(BuildContext context) {
return Container(
height: 13,
width: 13,
margin: EdgeInsets.all(4),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: carouselIndex == indicatorIndex ? Colors.white : Colors.grey,
),
);
}
}
| 0
|
mirrored_repositories/FlutterIntroSlider
|
mirrored_repositories/FlutterIntroSlider/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:introslider/intro_page.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyIntroPage()
);
}
}
| 0
|
mirrored_repositories/FlutterIntroSlider
|
mirrored_repositories/FlutterIntroSlider/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:introslider/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/fitso_app_ui
|
mirrored_repositories/fitso_app_ui/lib/constants.dart
|
import 'package:flutter/material.dart';
Color bgcolor = Colors.white.withOpacity(1.0);
double defaultPadding = 15.0;
| 0
|
mirrored_repositories/fitso_app_ui
|
mirrored_repositories/fitso_app_ui/lib/homepage.dart
|
import 'package:fitso_app_ui/constants.dart';
import 'package:fitso_app_ui/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
class Homepage extends StatefulWidget {
Homepage({Key key}) : super(key: key);
@override
_HomepageState createState() => _HomepageState();
}
class _HomepageState extends State<Homepage> {
final List<String> imageList = [
'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=840&q=80',
'https://images.unsplash.com/photo-1446292532430-3e76f6ab6444?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=804&q=80'
];
int _currentIndex = 0;
ScrollController _scrollController = ScrollController();
@override
Widget build(BuildContext context) {
final _size = MediaQuery.of(context).size;
return Scaffold(
appBar: appBarSection(),
body: SingleChildScrollView(
controller: _scrollController,
child: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
WarningContainer(size: _size),
SizedBox(
height: defaultPadding,
),
Column(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: defaultPadding),
child: CarouselSlider(
items: imageList
.map(
(item) => Container(
//color: Colors.green,
width: _size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0)),
margin: EdgeInsets.symmetric(
horizontal: defaultPadding / 2),
child: Image.network(
item,
fit: BoxFit.fitHeight,
),
),
)
.toList(),
options: CarouselOptions(
pauseAutoPlayInFiniteScroll: true,
aspectRatio: 16 / 9,
viewportFraction: 0.8,
initialPage: 0,
enableInfiniteScroll: true,
autoPlayInterval: Duration(seconds: 3),
autoPlayAnimationDuration: Duration(milliseconds: 800),
autoPlayCurve: Curves.fastOutSlowIn,
reverse: false,
autoPlay: true,
height: 200.0,
onPageChanged: (index, reason) {
setState(
() {
_currentIndex = index;
},
);
},
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: imageList.map((urlOfItem) {
int index = imageList.indexOf(urlOfItem);
return Container(
width: 10.0,
height: 10.0,
margin:
EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _currentIndex == index
? Color.fromRGBO(0, 0, 0, 0.8)
: Color.fromRGBO(0, 0, 0, 0.3),
),
);
}).toList(),
)
],
),
SizedBox(
height: defaultPadding,
),
HeadingSection(heading: "Explore products around you"),
ChipRowSection(),
SizedBox(
height: defaultPadding,
),
SportCategory(),
SizedBox(
height: defaultPadding,
),
HeadingSection(heading: "Take a look around you "),
SizedBox(
height: defaultPadding,
),
SportCenterListView(size: _size)
],
)),
),
bottomNavigationBar: BottomBarSection(size: _size),
);
}
}
| 0
|
mirrored_repositories/fitso_app_ui
|
mirrored_repositories/fitso_app_ui/lib/main.dart
|
import 'package:fitso_app_ui/constants.dart';
import 'package:fitso_app_ui/homepage.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
scaffoldBackgroundColor: bgcolor,
primarySwatch: Colors.blue,
textTheme: GoogleFonts.nunitoTextTheme(Theme.of(context).textTheme)
.apply(bodyColor: Colors.black)),
home: Homepage(),
);
}
}
| 0
|
mirrored_repositories/fitso_app_ui/lib
|
mirrored_repositories/fitso_app_ui/lib/widgets/widgets.dart
|
import 'package:fitso_app_ui/model/activity.dart';
import 'package:fitso_app_ui/model/sports.dart';
import 'package:flutter/material.dart';
import '../constants.dart';
Widget chipSection(String label) {
return Chip(
padding: EdgeInsets.all(4.0),
elevation: 10.0,
shadowColor: Colors.white,
backgroundColor: Colors.white60,
label: Text(label));
}
Widget appBarSection() {
return AppBar(
backgroundColor: bgcolor,
elevation: 0,
actions: [
Padding(
padding: EdgeInsets.only(right: defaultPadding),
child: CircleAvatar(
backgroundColor: Color(0xffffdfbf),
child: Text(
"L",
style: TextStyle(
fontSize: 20.0, color: Colors.red, fontWeight: FontWeight.bold),
),
),
)
],
);
}
class WarningContainer extends StatelessWidget {
const WarningContainer({
Key key,
@required Size size,
}) : _size = size,
super(key: key);
final Size _size;
@override
Widget build(BuildContext context) {
return Container(
width: _size.width,
height: _size.height / 6,
color: Color.fromRGBO(239, 219, 205, 0.5),
child: Padding(
padding: EdgeInsets.all(defaultPadding * 1.3),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: CircleAvatar(
radius: 25.0,
backgroundColor: Colors.redAccent.shade400,
child: Icon(
Icons.speaker,
size: 28.0,
color: Colors.white,
),
)),
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"This is warning message",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 16.0),
),
Text(
"Centers are now open. You can book new slot for u. ",
style: TextStyle(
fontWeight: FontWeight.w500, fontSize: 14.0),
),
Row(
children: [
Text(
"Know more",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.0,
color: Colors.red.shade900),
),
Icon(
Icons.arrow_forward,
color: Colors.red.shade900,
)
],
)
],
))
],
),
),
);
}
}
class HeadingSection extends StatelessWidget {
const HeadingSection({
@required this.heading,
Key key,
}) : super(key: key);
final String heading;
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: defaultPadding),
child: Row(
children: [
Text(
heading,
style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.w600),
)
],
),
);
}
}
class BottomBarSection extends StatelessWidget {
const BottomBarSection({
Key key,
@required Size size,
}) : _size = size,
super(key: key);
final Size _size;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.shade300,
offset: Offset(2, 2),
blurRadius: 3,
spreadRadius: 1)
],
),
height: _size.height / 7,
child: Column(
children: [
Padding(
padding: EdgeInsets.all(15.0),
child: MaterialButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 5.0),
child: Center(
child: Column(
children: [
Text(
"Become a member",
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
fontWeight: FontWeight.bold),
),
Text(
"4999 for 3 months",
style: TextStyle(
fontSize: 15.0,
color: Colors.white,
fontWeight: FontWeight.w400),
)
],
),
),
),
color: Colors.pink,
onPressed: () {}),
),
SizedBox(
height: defaultPadding / 3,
),
Container(
alignment: Alignment.center,
child: Text(
"Book a free trial session",
style: TextStyle(
fontSize: 16.0,
color: Colors.redAccent,
),
))
],
),
);
}
}
class ChipRowSection extends StatelessWidget {
const ChipRowSection({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: defaultPadding),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
chipSection("Within 15 km"),
chipSection("Within 10 km"),
chipSection("Within 5 km")
],
),
);
}
}
class SportCategory extends StatelessWidget {
const SportCategory({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: defaultPadding),
child: GridView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: activityList.length,
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 150,
childAspectRatio: 2 / 2,
crossAxisSpacing: 20,
mainAxisSpacing: 20),
itemBuilder: (context, int index) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
width: 40.0,
height: 70.0,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.shade300,
offset: Offset(2, 2),
blurRadius: 5,
spreadRadius: 3)
],
borderRadius: BorderRadius.circular(10.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: CircleAvatar(
backgroundColor: activityList[index].color,
child: Icon(activityList[index].iconData),
),
),
Column(
children: [
Text(
"${activityList[index].title}",
style: TextStyle(fontWeight: FontWeight.bold),
),
Text("${activityList[index].subtitle}")
],
)
],
),
);
}),
);
}
}
class SportCenterListView extends StatelessWidget {
const SportCenterListView({
Key key,
@required Size size,
}) : _size = size,
super(key: key);
final Size _size;
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: defaultPadding),
child: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: sportCenterList.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(vertical: defaultPadding / 2),
height: _size.height / 3.5,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.shade300,
offset: Offset(2, 2),
blurRadius: 5,
spreadRadius: 3)
],
borderRadius: BorderRadius.circular(10.0)),
child: Column(
children: [
Expanded(
flex: 4,
child: Container(
width: _size.width,
child: Image.network(
"${sportCenterList[index].imageurl}",
fit: BoxFit.cover),
)),
Expanded(
flex: 2,
child: Container(
margin: EdgeInsets.symmetric(
horizontal: defaultPadding,
vertical: defaultPadding / 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${sportCenterList[index].centerName}",
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold),
),
Text(
"${sportCenterList[index].rating}",
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.green),
),
],
),
Text("${sportCenterList[index].sports.toList()}")
],
)),
)
],
),
);
}),
);
}
}
| 0
|
mirrored_repositories/fitso_app_ui/lib
|
mirrored_repositories/fitso_app_ui/lib/model/sports.dart
|
import 'package:flutter/material.dart';
class SportCenter {
SportCenter(this.centerName, this.sports, this.rating, this.imageurl);
final String centerName;
final List<String> sports;
final double rating;
final String imageurl;
}
List<SportCenter> sportCenterList = [
SportCenter("Ganeshara Stadium", ["Tenis"], 4.3,
"https://images.unsplash.com/photo-1547347298-4074fc3086f0?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTB8fHNwb3J0c3xlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"),
SportCenter("Sector 43 EAS", ["Tenis", "running", "Badminton"], 4.1,
"https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?ixid=MnwxMjA3fDB8MHxzZWFyY2h8NTB8fHNwb3J0c3xlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"),
SportCenter("TipTop Academy", ["Tenis", "Cricket"], 3.3,
"https://images.unsplash.com/photo-1526166729864-ddc57657d48f?ixid=MnwxMjA3fDB8MHxzZWFyY2h8NTl8fHNwb3J0c3xlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"),
SportCenter("Playing Ground", ["Bollybol"], 5.0,
"https://images.unsplash.com/photo-1571019613576-2b22c76fd955?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80"),
];
| 0
|
mirrored_repositories/fitso_app_ui/lib
|
mirrored_repositories/fitso_app_ui/lib/model/activity.dart
|
import 'package:flutter/material.dart';
class Activity {
Activity(this.iconData, this.title, this.subtitle, this.color);
final IconData iconData;
final String title;
final String subtitle;
final Color color;
}
List<Activity> activityList = [
Activity(Icons.sports_basketball, "Basketball", "12 center",
Color.fromRGBO(239, 219, 205, 0.6)),
Activity(Icons.sports_cricket, "Cricket", "5 center",
Color.fromRGBO(255, 246, 217, 0.6)),
Activity(Icons.sports_football, "Football", "8 center",
Color.fromRGBO(236, 228, 220, 0.6)),
Activity(Icons.sports_baseball, "Baseball", "13 center",
Color.fromRGBO(243, 223, 212, 0.6)),
Activity(Icons.sports_golf, "Golf", "2 center",
Color.fromRGBO(222, 247, 254, 0.6)),
Activity(Icons.sports_handball, "Handball", "11 center",
Color.fromRGBO(246, 206, 252, 0.6)),
Activity(Icons.sports_hockey, "Hockey", "14 center",
Color.fromRGBO(255, 255, 194, 0.6))
];
class ActivityData extends ChangeNotifier {
// List<Activity> activityList = [
// Activity(Icons.sports_basketball, "Basketball", "12 center",
// Color.fromRGBO(239, 219, 205, 0.6)),
// Activity(Icons.sports_cricket, "Cricket", "5 center",
// Color.fromRGBO(255, 246, 217, 0.6)),
// Activity(Icons.sports_football, "Football", "8 center",
// Color.fromRGBO(236, 228, 220, 0.6)),
// Activity(Icons.sports_baseball, "Baseball", "13 center",
// Color.fromRGBO(243, 223, 212, 0.6)),
// Activity(Icons.sports_golf, "Golf", "2 center",
// Color.fromRGBO(222, 247, 254, 0.6)),
// Activity(Icons.sports_handball, "Handball", "11 center",
// Color.fromRGBO(246, 206, 252, 0.6)),
// Activity(Icons.sports_hockey, "Hockey", "14 center",
// Color.fromRGBO(255, 255, 194, 0.6))
// ];
}
| 0
|
mirrored_repositories/fitso_app_ui
|
mirrored_repositories/fitso_app_ui/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fitso_app_ui/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/lib/main_staging.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:eduserveMinimal/edu_serve.dart';
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
void main() {
runApp(MultiProvider(providers: [
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
ChangeNotifierProvider<ThemeProvider>(create: (_) => ThemeProvider()),
], child: EduServeMinimal(flavor: "staging")));
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/lib/main_production.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
// Project imports:
import 'package:eduserveMinimal/edu_serve.dart';
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
void main() async {
await SentryFlutter.init(
(options) {
options.dsn =
"https://5cf3e648046b4e67a059fc4d6b8fa0fd@o1022830.ingest.sentry.io/6010044";
},
appRunner: () => runApp(MultiProvider(
providers: [
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
ChangeNotifierProvider<ThemeProvider>(create: (_) => ThemeProvider()),
],
child: EduServeMinimal(flavor: "production"),
)),
);
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/lib/shortcuts.dart
|
import 'package:quick_actions/quick_actions.dart';
class ShortcutItems {
static final List<ShortcutItem> items = [
timetable,
applyLeave,
fees,
studentQR,
];
static final ShortcutItem timetable = const ShortcutItem(
type: "timetable",
localizedTitle: "Timetable",
icon: "icon_timetable",
);
static final ShortcutItem applyLeave = const ShortcutItem(
type: "apply_leave",
localizedTitle: "Apply Leave",
icon: "icon_leave",
);
static final ShortcutItem fees = const ShortcutItem(
type: "fees",
localizedTitle: "Fees",
icon: "icon_fees",
);
static final ShortcutItem studentQR = const ShortcutItem(
type: "user",
localizedTitle: "User",
icon: "icon_user",
);
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/lib/edu_serve.dart
|
// Flutter imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/global/widgets/restart_widget.dart';
import 'package:eduserveMinimal/screens/settings/pages/user.dart';
import 'package:eduserveMinimal/service/login.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:eduserveMinimal/shortcuts.dart';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
import 'package:eduserveMinimal/screens/home/pages/pages.dart';
import 'package:quick_actions/quick_actions.dart';
import 'package:shared_preferences/shared_preferences.dart';
class EduServeMinimal extends StatelessWidget {
EduServeMinimal({Key? key, this.flavor = "production"}) : super(key: key);
final String flavor;
@override
Widget build(BuildContext context) {
Provider.of<AppState>(context)..initPlatformState();
return MaterialApp(
debugShowCheckedModeBanner: flavor == "development",
home: HomeController(),
routes: {
"/home": (BuildContext context) => HomePage(),
"/feedbackForm": (BuildContext context) => FeedbackForm(),
"/timetable": (BuildContext context) => TimeTable(),
"/apply_leave": (BuildContext context) => ApplyLeaveView(),
"/fees": (BuildContext context) => FeesView(),
"/credentials": (BuildContext context) => Credentials(),
"/user": (BuildContext context) => User(),
},
darkTheme: ThemeProvider.dark,
title: "eduserveMinimal",
themeMode: Provider.of<ThemeProvider>(context).themeMode,
);
}
}
class HomeController extends StatelessWidget {
const HomeController({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
initQuickActions(context);
return Scaffold(
body: FutureBuilder(
future: SharedPreferences.getInstance(),
builder: (context, AsyncSnapshot<SharedPreferences> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
SharedPreferences prefs = snapshot.data!;
if (credentialsExist(prefs))
return FutureBuilder(
future: isLoggedIn(prefs),
builder: (context, AsyncSnapshot<Map> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data!["isLoggedIn"]) {
if (snapshot.data!["feedBackFormFound"])
return FeedbackForm();
if (snapshot.data!["loginError"]) return Credentials();
return RestartWidget(child: HomePage());
}
return Credentials();
}
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Lottie.asset("assets/lottie/log_in.json"),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Logging In...",
style: TextStyle(fontSize: 25),
),
),
],
));
});
return Credentials();
}
return Container();
},
),
);
}
void initQuickActions(BuildContext context) {
final quickActions = QuickActions();
quickActions.setShortcutItems(ShortcutItems.items);
}
bool credentialsExist(SharedPreferences prefs) =>
prefs.containsKey("username") && prefs.containsKey("password");
Future<Map> isLoggedIn(SharedPreferences prefs) async {
Duration lastLogin = DateTime.parse(
prefs.getString("lastLogin") ?? DateTime.now().toString())
.difference(DateTime.now());
if (lastLogin.inMinutes < 30 && Scraper.cache["home"] != null) {
return {
"isLoggedIn": true,
"loginData": Scraper.cache["home"],
"feedBackFormFound":
Scraper.cache["home"].contains("feedback form found"),
"loginError": false,
};
}
String loginData = await login();
await scraper.login();
if (!loginData.contains("Login error"))
prefs.setString("lastLogin", DateTime.now().toString());
return {
"isLoggedIn": loginData.length > 0,
"loginData": loginData,
"feedBackFormFound": loginData.contains("feedback form found"),
"loginError": loginData.contains("Login error"),
};
}
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/lib/main.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:eduserveMinimal/edu_serve.dart';
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
void main(List<String> args) async {
runApp(MultiProvider(
providers: [
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
ChangeNotifierProvider<ThemeProvider>(create: (_) => ThemeProvider()),
],
child: EduServeMinimal(),
));
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/lib/main_development.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:eduserveMinimal/edu_serve.dart';
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
void main() {
runApp(MultiProvider(providers: [
ChangeNotifierProvider<AppState>(create: (_) => AppState()),
ChangeNotifierProvider<ThemeProvider>(create: (_) => ThemeProvider()),
], child: EduServeMinimal(flavor: "development")));
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/global/gloabls.dart
|
import 'package:eduserveMinimal/service/scrap.dart';
Map<String, String> httpHeaders = {
"user-agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66",
"accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"content-type": "application/x-www-form-urlencoded",
"origin": "https://eduserve.karunya.edu",
"referer": "",
"upgrade-insecure-requests": "1",
"accecpt-encoding": "gzip, deflate, br",
};
Map httpFormData = {
"RadScriptManager1_TSM":
";;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-US:1b322a7c-dfaa-439f-aa80-5f3d155ef91d:ea597d4b:b25378d2;Telerik.Web.UI:en-US:a519da8a-d673-48a9-9976-4b08756261d2:16e4e7cd:f7645509:22a6274a:33715776:24ee1bba:e330518b:2003d0b8:c128760b:1e771326:88144a7a:c8618e41:1a73651d:333f8d94:58366029:f46195d3",
"__EVENTTARGET": "ctl00\$mainContent\$DDLACADEMICTERM",
"__EVENTARGUMENT": "",
"__LASTFOCUS": "",
"__VIEWSTATE": "",
"__VIEWSTATEGENERATOR": "",
"__PREVIOUSPAGE": "",
"__EVENTVALIDATION": "",
"ctl00_radMenuModule_ClientState": "",
"ctl00\$mainContent\$DDLACADEMICTERM": "",
"ctl00_mainContent_grdData_ClientState": "",
};
List academicTerms = [];
Scraper scraper = Scraper();
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/global/enum.dart
|
enum LeaveType { Medical, OnDuty }
| 0
|
mirrored_repositories/eduserveMinimal/lib/global
|
mirrored_repositories/eduserveMinimal/lib/global/widgets/dot_container.dart
|
import 'package:flutter/material.dart';
class DotContainer extends StatelessWidget {
const DotContainer({Key? key, required this.color, required this.text})
: super(key: key);
final Color color;
final String text;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(10),
child: Container(
width: 10,
height: 10,
decoration: BoxDecoration(
color: color,
shape: BoxShape.circle,
),
),
),
Text(text),
],
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/global
|
mirrored_repositories/eduserveMinimal/lib/global/widgets/circle_tab_bar_indicator.dart
|
import 'package:flutter/material.dart';
class CircleTabIndicator extends Decoration {
final BoxPainter _painter;
CircleTabIndicator({required Color color, double radius = 5})
: _painter = _CirclePainter(color, radius);
@override
BoxPainter createBoxPainter([VoidCallback? onChanged]) => _painter;
}
class _CirclePainter extends BoxPainter {
final Paint _paint;
final double radius;
_CirclePainter(Color color, this.radius)
: _paint = Paint()
..color = color
..isAntiAlias = true;
@override
void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
final Offset circleOffset =
offset + Offset(cfg.size!.width / 2, cfg.size!.height - radius);
canvas.drawCircle(circleOffset, radius, _paint);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/global
|
mirrored_repositories/eduserveMinimal/lib/global/widgets/restart_widget.dart
|
import 'package:flutter/material.dart';
class RestartWidget extends StatefulWidget {
const RestartWidget({required this.child});
final Widget child;
static void restartApp(BuildContext context) {
context.findAncestorStateOfType<_RestartWidgetState>()!.restartApp();
}
@override
_RestartWidgetState createState() => _RestartWidgetState();
}
class _RestartWidgetState extends State<RestartWidget> {
Key key = UniqueKey();
void restartApp() {
setState(() {
key = UniqueKey();
});
}
@override
Widget build(BuildContext context) {
return KeyedSubtree(
key: key,
child: widget.child,
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/models/leave.dart
|
class Leave {
List<OtherLeave> allLeave = [];
List<OnDutyLeave> allOnDuty = [];
void addOtherLeave(List<String> leave) {
allLeave.add(OtherLeave(
leaveType: leave[0],
reason: leave[1],
fromDate: leave[2],
fromSession: leave[3],
toDate: leave[4],
toSession: leave[5],
status: leave[6],
));
}
void addOnDuty(List<String> leave) {
allOnDuty.add(OnDutyLeave(
fromDate: leave[0],
fromSession: leave[1],
toDate: leave[2],
toSession: leave[3],
reason: leave[4],
status: leave[5],
pendingWith: leave[6],
createdBy: leave[7],
createdOn: leave[8],
approvalBy: leave[9],
approvalOn: leave[9],
availedBy: leave[10],
availedOn: leave[11],
));
}
static Leave generateFakeLeave([otherLeaveAmount = 3, onDutyAmount = 2]) {
Leave leave = Leave();
List.generate(
otherLeaveAmount, (index) => ["", "", "", "", "", "", " "])
.forEach((element) => leave.addOtherLeave(element));
List.generate(
onDutyAmount,
(index) => [
" ",
" ",
" ",
" ",
" ",
" ",
"",
"",
"",
"",
"",
"",
""
]).forEach((element) => leave.addOtherLeave(element));
return leave;
}
}
class OtherLeave {
String leaveType;
String reason;
String fromSession;
String toSession;
late String session;
String fromDate;
String toDate;
String status;
OtherLeave({
required this.leaveType,
required this.reason,
required this.fromSession,
required this.toSession,
required this.fromDate,
required this.toDate,
required this.status,
}) {
if (this.fromSession == this.toSession)
this.session = fromSession;
else
this.session = "${this.fromSession} - ${this.toSession}";
}
}
class OnDutyLeave {
String fromDate;
String fromSession;
String toDate;
String toSession;
late String session;
String reason;
String status;
String pendingWith;
String createdBy;
String createdOn;
String approvalBy;
String approvalOn;
String availedBy;
String availedOn;
OnDutyLeave({
required this.fromDate,
required this.fromSession,
required this.toDate,
required this.toSession,
required this.reason,
required this.status,
required this.pendingWith,
required this.createdBy,
required this.createdOn,
required this.approvalBy,
required this.approvalOn,
required this.availedBy,
required this.availedOn,
}) {
if (this.fromSession == this.toSession)
this.session = fromSession;
else
this.session = "${this.fromSession} - ${this.toSession}";
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/models/fees.dart
|
import 'dart:convert';
class Currency {
static String inr = "\u{20B9}";
static Map<String, dynamic> currencyCharMap = {
"Indian Rupee": inr,
};
static String currencyToChar(String currency) => currencyCharMap[currency];
}
class Fees {
List<SingleFee> all = [];
List dues = [];
void add(String id, List<String> data) {
all.add(SingleFee(
reciept: data[1],
recieptType: data[2],
description: data[0],
date: data[2],
amountPaid: double.parse(data[5]),
currency: Currency.currencyToChar(data[4]),
));
}
int get length => all.length;
List<String> get ids => all.map((fee) => fee.reciept).toList();
List<SingleFee> get values => all;
}
class SingleFee {
String reciept;
String recieptType;
String description;
String date;
double amountPaid;
String currency;
SingleFee({
required this.reciept,
required this.recieptType,
required this.description,
required this.date,
required this.amountPaid,
required this.currency,
});
SingleFee copyWith({
String? reciept,
String? recieptType,
String? description,
String? date,
double? amountPaid,
}) {
return SingleFee(
reciept: reciept ?? this.reciept,
recieptType: recieptType ?? this.recieptType,
description: description ?? this.description,
date: date ?? this.date,
amountPaid: amountPaid ?? this.amountPaid,
currency: Currency.currencyToChar("Indian Rupee"));
}
Map<String, dynamic> toMap() {
return {
'reciept': reciept,
'recieptType': recieptType,
'description': description,
'date': date,
'amountPaid': amountPaid,
};
}
factory SingleFee.fromMap(Map<String, dynamic> map) {
return SingleFee(
reciept: map['reciept'] ?? '',
recieptType: map['recieptType'] ?? '',
description: map['description'] ?? '',
date: map['date'] ?? '',
amountPaid: map['amountPaid']?.toDouble() ?? 0.0,
currency: Currency.currencyToChar("Indian Rupee"));
}
String toJson() => json.encode(toMap());
factory SingleFee.fromJson(String source) =>
SingleFee.fromMap(json.decode(source));
@override
String toString() {
return 'SingleFee(reciept: $reciept, recieptType: $recieptType, description: $description, date: $date, amountPaid: $amountPaid)';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is SingleFee &&
other.reciept == reciept &&
other.recieptType == recieptType &&
other.description == description &&
other.date == date &&
other.amountPaid == amountPaid;
}
@override
int get hashCode {
return reciept.hashCode ^
recieptType.hashCode ^
description.hashCode ^
date.hashCode ^
amountPaid.hashCode;
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/models/attendance_summary.dart
|
import 'dart:math';
class AttendanceSummary {
late AttendanceBasicInfo basicInfo;
List<AttendanceSummaryData> summaryData = [];
AttendanceSummary(
{required List basicInfo, required List<List<String>> summaryData}) {
this.basicInfo = AttendanceBasicInfo(
semester: basicInfo[0],
kmail: basicInfo[1],
phoneNumber: basicInfo[2],
mentor: basicInfo[3],
sra: basicInfo[4],
studentStatus: basicInfo[5],
totalHours: basicInfo[7],
presentHours: basicInfo[9],
actual: basicInfo[10],
odCorrected: basicInfo[11],
mlCorrected: basicInfo[12],
leaveHours: basicInfo[14],
absentHours: basicInfo[16],
);
for (int i = 0; i < summaryData.length; i++)
this.summaryData.add(AttendanceSummaryData(
date: summaryData[i][0],
present: summaryData[i][14],
absent: summaryData[i][15],
unAttended: summaryData[i][16],
));
}
static AttendanceSummary generateFakeData() {
AttendanceSummary summary = AttendanceSummary(
basicInfo: [
"semester",
"kmail@karunya.edu.in",
"+91 99999 99999",
"Jane Doe",
"Jhon Doe",
"Unknown",
"",
"0",
"",
"0",
"0",
"0",
"0",
"",
"0",
"",
"0",
],
summaryData: List.generate(
10,
(index) => List.generate(
17,
(index) => index == 0
? "18 MAY 2002"
: Random().nextInt(11).toString())),
);
return summary;
}
}
class AttendanceBasicInfo {
String semester;
String kmail;
String phoneNumber;
String mentor;
String sra;
String studentStatus;
String totalHours;
String presentHours;
String actual;
String odCorrected;
String mlCorrected;
String leaveHours;
String absentHours;
AttendanceBasicInfo({
required this.semester,
required this.kmail,
required this.phoneNumber,
required this.mentor,
required this.sra,
required this.studentStatus,
required this.totalHours,
required this.presentHours,
required this.actual,
required this.odCorrected,
required this.mlCorrected,
required this.leaveHours,
required this.absentHours,
});
@override
String toString() {
return 'AttendanceBasicInfo(semester: $semester, kmail: $kmail, phoneNumber: $phoneNumber, mentor: $mentor, sra: $sra, studentStatus: $studentStatus, totalHours: $totalHours, presentHours: $presentHours, odCorrected: $odCorrected, mlCorrected: $mlCorrected, leaveHours: $leaveHours, absentHours: $absentHours)';
}
}
class AttendanceSummaryData {
String date;
late double present;
late double absent;
late double unAttended;
AttendanceSummaryData({
required this.date,
present,
absent,
unAttended,
}) {
this.present = double.parse(present);
this.absent = double.parse(absent);
this.unAttended = double.parse(unAttended);
}
@override
String toString() {
return 'AttendanceSummaryData(date: $date, present: $present, absent: $absent, unAttended: $unAttended)';
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/download_hallticket.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/service/login.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:shared_preferences/shared_preferences.dart';
Future<List?> downloadHallTicket(
{String? term, bool download = false, int retry = 0}) async {
final String hallticketURL = "/Student/CBCS/HallTicketDownload.aspx";
Map<String, String> headers = httpHeaders;
Map formData = httpFormData;
if (term == null) {
Response res = await get(
Uri.parse("https://eduserve.karunya.edu$hallticketURL"),
headers: headers);
if (res.body.indexOf("Login") != -1) {
Fluttertoast.showToast(msg: "Session expired. Refresh data!");
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool("isLoggedIn", false);
return null;
}
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
inputs.forEach((element) {
// Populate form data
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
final examination = soup
.find_all("option")
.map((e) => {e.text.trim(): e.attributes})
.toSet()
.toList();
return examination;
} else {
formData["ctl00\$mainContent\$DDLEXAM"] = term;
if (download) {
headers["referer"] =
"https://eduserve.karunya.edu/Student/CBCS/HallTicketDownload.aspx";
headers["Sec-Fetch-Dest"] = "document";
headers["sec-ch-ua"] = ';Not A Brand";v="99", "Chromium";v="94"';
headers["sec-ch-ua-mobile"] = "?0";
headers["sec-ch-ua-platform"] = "Windows";
headers["sec-fetch-dest"] = "document";
headers["sec-fetch-mode"] = "navigate";
headers["sec-fetch-site"] = "same-origin";
headers["sec-fetch-user"] = "?1";
formData["ctl00\$mainContent\$BTNDOWNLOAD"] = "Download";
formData["__EVENTTARGET"] = "";
formData.remove("ctl00\$mainContent\$DDLACADEMICTERM");
Response res = await post(
Uri.parse("https://eduserve.karunya.edu$hallticketURL"),
headers: headers,
body: formData);
print(res.headers);
return [];
}
if (Scraper.cache.containsKey("hallticket"))
return Scraper.cache["hallticket"];
formData["ctl00\$mainContent\$DDLACADEMICTERM"] = "";
Response res = await post(
Uri.parse("https://eduserve.karunya.edu$hallticketURL"),
headers: headers,
body: formData);
if (res.body.indexOf("No records to display.") != -1) {
Scraper.cache["hallticket"] = ["No records to display."];
return null;
}
Beautifulsoup hallticketSoup = Beautifulsoup(res.body);
List eligibility =
hallticketSoup.find_all("td").map((e) => e.text.trim()).toList();
List endFlag = eligibility.map((e) => e.length > 80 ? e : null).toList();
endFlag.removeWhere((element) => element == null);
if (endFlag.length == 0) {
Fluttertoast.showToast(
msg: "Something went wrong please restart the app");
login();
if (retry == 2) return [];
return downloadHallTicket(term: term, retry: retry + 1);
}
int end = eligibility.indexOf(endFlag.first);
List mainEligibility = eligibility.sublist(
eligibility.indexOf("Attendance Eligibility?:"), end);
eligibility = eligibility.sublist(end + 1);
Map hallTicketdata = {};
for (int i = 0; i < mainEligibility.length; i++) {
hallTicketdata[mainEligibility[i]] = mainEligibility[i];
}
List subjectData = [];
List allEligibility = [];
for (int i = 0; i < eligibility.length; i++) {
subjectData.add(eligibility[i]);
if (subjectData.length == 3) {
allEligibility.add(subjectData);
subjectData = [];
}
}
formData.remove("ctl00\$mainContent\$DDLEXAM");
Scraper.cache["hallticket"] = [mainEligibility, allEligibility];
return [mainEligibility, allEligibility];
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/semester_summary.dart
|
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:http/http.dart';
Future<Map<String, List<String>>> getSemesterSummary() async {
Response res = await get(
Uri.parse("https://eduserve.karunya.edu/Student/SemSummary.aspx"),
headers: httpHeaders);
Beautifulsoup soup = Beautifulsoup(res.body);
List tds = soup.find_all("td").map((e) => e.text).toList();
tds = tds.sublist(tds.indexOf("Active") + 2);
List<List<String>> summaryData = [];
List<String> temp = [];
for (int i = 0; i < tds.length; i++) {
temp.add(tds[i]);
if (temp.length == 5) {
summaryData.add(temp);
temp = [];
}
}
summaryData.sort((a, b) => b.first.compareTo(a.first));
List<String> months = summaryData.map((e) => e[0]).toList();
List<String> arrears = summaryData.map((e) => e[2]).toList();
List<String> scgpa = summaryData.map((e) => e[3]).toList();
List<String> cgpa = summaryData.map((e) => e[4]).toList();
Map<String, List<String>> data = {
"months": months,
"arrears": arrears,
"scgpa": scgpa,
"cgpa": cgpa
};
return data;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/internal_marks.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:shared_preferences/shared_preferences.dart';
Future getInternalMarks({String? academicTerm = null}) async {
Scraper scraper = Scraper();
await scraper.login();
return await scraper.getInternalMarks();
final String internalsURL = "/Student/InternalMarks.aspx";
Map<String, String> headers = httpHeaders;
Map formData = httpFormData;
if (academicTerm == null) {
Response res = await get(
Uri.parse("https://eduserve.karunya.edu$internalsURL"),
headers: headers);
if (res.body.indexOf("Login") != -1) {
Fluttertoast.showToast(msg: "Session expired. Refresh data!");
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool("isLoggedIn", false);
return;
}
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
List academicTerms =
soup.find_all("option").map((e) => e.text.trim()).toSet().toList();
inputs.forEach((element) {
// Populate form data
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
formData["ctl00\$mainContent\$DDLACADEMICTERM"] = academicTerm;
return academicTerms;
} else {
headers["accept-encoding"] = "gzip, deflate, br";
headers["accept-language"] = "en-US,en;q0.9";
headers["cache-control"] = "max-age=0";
// headers["content-length"] = "15695";
headers["sec-ch-ua-platform"] = "Windows";
headers["sec-ch-ua"] =
"\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"";
headers["sec-ch-ua-mobile"] = "?0";
formData["ctl00\$mainContent\$DDLACADEMICTERM"] = 20.toString();
formData.remove("ctl00\$mainContent\$DDLEXAM");
Response res = await post(
Uri.parse("https://eduserve.karunya.edu$internalsURL"),
headers: headers,
body: formData);
if ((res.body.indexOf("No records to display.") != -1)) {
return "No records to display.";
}
var soup = Beautifulsoup(res.body);
List table = soup.find_all("tr").map((e) => e.innerHtml).toSet().toList();
bool flagReached = false;
Map data = new Map();
table.forEach((element) {
if (element.indexOf("Entered by") != -1) {
flagReached = true;
return;
}
if (flagReached) {
element = element.trim().replaceAll("<td>", "");
element = element.trim().replaceAll("</td>", "<space>");
data[element.split("<space>")[8]] = element.split("<space>");
data[element.split("<space>")[8]]
.removeWhere((element) => element == "");
}
});
return Map.of(data);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/attendence.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/service/scrap.dart';
Future<List> getAttendance() async {
if (Scraper.cache.containsKey("att")) return Scraper.cache["att"];
Map<String, String> headers = httpHeaders;
Response page = await get(
Uri.parse("https://eduserve.karunya.edu/Student/Home.aspx"),
headers: headers);
if (page.body.indexOf("Hourly Feedback") != -1) {
return ["feedback form found"];
}
Beautifulsoup attendanceSoup = Beautifulsoup(page.body);
List attendenceList = attendanceSoup
.find_all("span")
.map((e) => (e.attributes["id"] == "mainContent_LBLCLASS" ||
e.attributes["id"] == "mainContent_LBLASSEMBLY" ||
e.attributes["id"] == "mainContent_LBLARREAR")
? e.text
: null)
.toList();
attendenceList.removeWhere((element) => element == null);
Scraper.cache["att"] = attendenceList;
return attendenceList;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/fees_details.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/models/fees.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:shared_preferences/shared_preferences.dart';
Future<Fees?> getFeesDetails({bool force = false}) async {
if (Scraper.cache.containsKey("fees")) return Scraper.cache["fees"];
Map<String, String> headers = httpHeaders;
String feesDownload = "/Student/Fees/DownloadReceipt.aspx";
String feesOverallStatement = "/Student/Fees/FeesStatement.aspx";
Fees fees = new Fees();
Response page = await get(
Uri.parse("https://eduserve.karunya.edu${feesDownload}"),
headers: headers);
if (page.body.indexOf("Login") != -1) {
Fluttertoast.showToast(msg: "Session expired. Refresh data!");
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool("isLoggedIn", false);
return null;
}
Response dues = await get(
Uri.parse("https://eduserve.karunya.edu${feesOverallStatement}"),
headers: headers);
var dueSoup = Beautifulsoup(dues.body);
List dueslist = dueSoup
.find_all("span")
.map((e) => (e.attributes["id"] == "mainContent_LBLDUES" ||
e.attributes["id"] == "mainContent_LBLEXCESS")
? e.text
: "")
.toSet()
.toList();
dueslist.removeWhere((element) => element == "");
var soup = Beautifulsoup(page.body);
List table = soup.find_all("tr").map((e) => e.innerHtml).toSet().toList();
bool flagReached = false;
table.forEach((element) {
if (element.indexOf("Total Amount") != -1) {
flagReached = true;
return;
}
if (flagReached) {
element = element.trim().replaceAll("<td>", "");
element = element.trim().replaceAll('<td style="display:none;">', "");
element = element.trim().replaceAll("</td>", "<space>");
List<String>? temp = [];
temp = element.split("<space>");
temp!.removeRange(0, 3);
temp.removeWhere((element) => element.length == 0);
fees.add(temp[1], temp);
}
});
fees.dues = dueslist;
Scraper.cache["fees"] = fees;
return fees;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/leave_info.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/models/leave.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/service/scrap.dart';
Future<Leave> getLeaveInfo() async {
if (Scraper.cache.containsKey("leave")) return Scraper.cache["leave"];
Map<String, String> headers = httpHeaders;
Leave parsePage(String page) {
String onDutySection = page.toString().split("Leave Type")[1];
Beautifulsoup onDutySoup = Beautifulsoup(onDutySection);
List onDuties = onDutySoup.find_all("td").map((e) => e.text).toList();
Beautifulsoup leaveSoup = Beautifulsoup(page.toString());
List leavest = leaveSoup.find_all("td").map((e) => e.text).toList();
leavest = leavest.sublist(leavest.indexOf("Medical Leave"));
Leave allLeave = Leave();
// onDuty structure [From Date, From Session, To Date, To Session, Reason, Status, Pending with, Created by, Created on, Approval by,
// Approval on, Availed by, Availed on]
List<String> onDuty = [];
RegExp dateRegExp =
RegExp(r"\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{1,2}:\d{1,2} \w{2}");
List<String> leave = [];
int leaveEntryCount = 0;
for (int i = 0; i < leavest.length; i++) {
if (int.tryParse(leavest[i]) == null) {
leave.add(leavest[i]);
leaveEntryCount++;
if (leaveEntryCount > 8) {
allLeave.addOtherLeave(leave);
break;
}
} else {
allLeave.addOtherLeave(leave);
leave = [];
leaveEntryCount = 0;
}
}
onDuties.forEach((element) {
final datetimesOnTable = onDuty
.map((e) =>
(dateRegExp.allMatches(e.toString()).length > 0) ? e : null)
.toList();
datetimesOnTable.removeWhere((element) => element == null);
if (onDuty.length == 13) {
if (onDuty.first == "") {
onDuty.removeAt(0);
onDuty.add(element);
return;
}
allLeave.addOnDuty(onDuty);
onDuty = [element];
return;
}
if (element.toString().trim() == "No records to display.") return;
onDuty.add(element.toString().trim());
});
Scraper.cache["leave"] = allLeave;
return allLeave;
}
Response home_page = await get(
Uri.parse("https://eduserve.karunya.edu/Student/Home.aspx"),
headers: headers);
Scraper.pages["home"] = home_page.body;
return parsePage(home_page.body);
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/fill_feedback_form.dart
|
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:http/http.dart';
Future<void> fillFeedbackForm(Map rating) async {
Map formData = httpFormData;
Map<String, String> headers = httpHeaders;
formData["ctl00_radMenu_ClientState"] = "";
formData["__SCROLLPOSITIONX"] = "204";
formData["__SCROLLPOSITIONY"] = "0";
formData.remove("ctl00_radMenuModule_ClientState");
formData.remove("ctl00_mainContent_grdData_ClientState");
formData.remove("ctl00\$mainContent\$DDLACADEMICTERM");
Response res = await get(
Uri.parse("https://eduserve.karunya.edu/MIS/IQAC/HFBCollection.aspx"),
headers: headers,
);
void setInputs(String body) {
Beautifulsoup soup = Beautifulsoup(body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
inputs.forEach((element) {
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
}
setInputs(res.body);
for (int i = 0; i < rating.keys.toList().length; i++) {
formData[rating.keys.toList()[i]] = {
"value": rating.values.toList()[i].toString(),
"readOnly": "false"
}.toString();
formData["__EVENTTARGET"] = rating.keys.toList()[i];
post(Uri.parse("https://eduserve.karunya.edu/MIS/IQAC/HFBCollection.aspx"))
.then((res) async {
setInputs(res.body);
print(res.statusCode);
if (i + 1 == rating.keys.toList().length) {
formData["ctl00\$mainContent\$btnSave"] = "Save";
formData["__EVENTTARGET"] = "";
res = await post(
Uri.parse(
"https://eduserve.karunya.edu/MIS/IQAC/HFBCollection.aspx"),
headers: headers,
body: formData);
print(res.statusCode);
}
});
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/student_info.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/global/gloabls.dart';
// Project imports:
import 'package:eduserveMinimal/service/login.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:http/http.dart';
Future<Map> getInfo() async {
if (Scraper.cache.containsKey("user")) return Scraper.cache["user"];
String studentHomePage = await login();
if (studentHomePage == "") return {};
var soup = Beautifulsoup(studentHomePage);
List basicInfo =
soup.find_all("span").map((e) => (e.innerHtml)).toList().sublist(54);
String? studentImage =
soup.find_all("img").map((e) => (e.attributes["src"])).toList()[2];
String? qrImage =
soup.find_all("img").map((e) => (e.attributes["src"])).toList()[3];
List td = soup.find_all("td").map((e) => (e.text)).toList();
bool flagReached = false;
bool flagStop = false;
int flagLines = 0;
Map leaveApplication = new Map();
RegExp leaveTypeExp = new RegExp(r"[^\d\s].*Leave");
String temp = "";
td.forEach((element) {
if (!flagStop) {
element = element.trim();
if (element == "No records to display.") {
flagStop = true;
}
if (leaveTypeExp.hasMatch(element)) {
// if onDuty applications found set the flag to true.
flagReached = true;
}
if (flagReached) {
// Wait untill the onDuty applications found.
if (flagLines != 8) {
// 7 items in the application section -> [Leave Type, Reason, From Date, From Session, To Date, To Session, Status, Pending with]
temp +=
"$element<space>"; // Add each one of'em with delimiter : <space>
flagLines++;
} else {
List splited =
temp.split("<space>"); // Once completed parse the string to list.
splited.removeWhere((element) => RegExp(r"\d{5,}").hasMatch(element));
splited.asMap().forEach((i, value) {
splited[i] = splited[i].trim();
});
splited.removeWhere(
(element) => element.toString() == ""); // Remove empty elements.
leaveApplication[splited[1]] = splited;
flagLines = 0;
temp = "";
}
}
} else {
return;
}
});
basicInfo.add(studentImage);
basicInfo.add(qrImage);
basicInfo.removeWhere(
(element) => element.toString() == ""); // Remove empty elements
basicInfo.remove("Academic Performance Summary");
List basicInfoKeys = [
"reg",
"kmail",
"name",
"mobile",
"programme",
"mentor",
"semester",
"att",
"asm",
"cgpa",
"arrears",
"resultOf",
"credits",
"cgpa",
"sgpa",
"nonAcademicCredits",
"studentIMG",
"qrImage"
];
// generate Map of infromation
Map data = new Map();
basicInfoKeys.asMap().forEach((i, element) {
data[basicInfoKeys[i]] = basicInfo[i];
});
data["leaveApplications"] = leaveApplication;
Response imageResponse = await get(
Uri.parse(
"https://eduserve.karunya.edu/${data["studentIMG"].replaceAll("../", "")}"),
headers: httpHeaders);
data["studentIMG"] = imageResponse.bodyBytes;
Response qrCodeResponse = await get(
Uri.parse(
"https://eduserve.karunya.edu/${data["qrImage"].replaceAll("../", "")}"),
headers: httpHeaders);
data["qrImage"] = qrCodeResponse.bodyBytes;
Scraper.cache["user"] = data;
return data;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/login.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:connectivity/connectivity.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart' as http;
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/providers/app_state.dart';
Future<String> login(
[String? username, String? password, Function? callback]) async {
// Login
var connection = await (Connectivity().checkConnectivity());
if (connection == ConnectivityResult.none) {
Fluttertoast.showToast(
msg: "Internet, caveman. Turn it on...",
timeInSecForIosWeb: 10,
);
}
Map<String?, String?>? login_data = {
"RadScriptManager1_TSM": "",
"__EVENTTARGET": "",
"__EVENTARGUMENT": "",
"__VIEWSTATE": "",
"__VIEWSTATEGENERATOR": "",
"__EVENTVALIDATION": "",
"ctl00\$mainContent\$Login1\$UserName":
AppState.prefs!.getString("username") ?? username,
"ctl00\$mainContent\$Login1\$Password":
AppState.prefs!.getString("password") ?? password,
"ctl00\$mainContent\$Login1\$LoginButton": "Log In"
};
var res = await http.get(Uri.parse(
"https://eduserve.karunya.edu/Login.aspx?ReturnUrl=%2fStudent%2fAttSummary.aspx"));
var eduserveCookie = res.headers["set-cookie"]!; // Set the ASP.NET_SessionId
// Parse: Start
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
inputs.forEach((element) {
if (login_data[element["name"]] == "") {
login_data[element["name"]] = element["value"];
}
});
// Parse: End
// Get login.aspx
httpHeaders["cookie"] = eduserveCookie.split(";")[0];
httpHeaders["referer"] =
"https://eduserve.karunya.edu/Login.aspx?ReturnUrl=%2fStudent%2fAttSummary.aspx";
// Post to login.aspx
res = await http.post(
Uri.parse(
"https://eduserve.karunya.edu/Login.aspx?ReturnUrl=%2fStudent%2fAttSummary.aspx"),
headers: httpHeaders,
body: login_data);
if (res.body.indexOf(
"Your login attempt was not successful. Please try again.") !=
-1) {
Fluttertoast.showToast(
msg: "Your login attempt was not successful. Please try again.",
gravity: ToastGravity.CENTER);
return "Login error";
}
if (res.statusCode == 302) {
httpHeaders["cookie"] = httpHeaders["cookie"]! +
"; ${res.headers['set-cookie']!.split(';')[0]}";
res = await http.get(
Uri.parse("https://eduserve.karunya.edu${res.headers["location"]}"),
headers: httpHeaders);
}
if (res.body.contains("Hourly Feedback")) {
return "feedback form found";
}
Scraper.cache["home"] = res.body;
return res.body;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/timetable.dart
|
// Dart imports:
import 'dart:convert';
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/providers/app_state.dart';
Future<Map?> getTimetable({bool force = false}) async {
if (AppState.prefs!.containsKey("timetable"))
return jsonDecode(AppState.prefs!.getString("timetable")!);
Scraper scraper = Scraper();
await scraper.initAsyncMethods();
await scraper.login();
final timetable = await scraper.getTimetable();
await AppState.prefs!.setString("timetable", jsonEncode(timetable));
return timetable;
// I dont know why the below implementation works and I spent a lot of time than I should have.
// So, I am using the old code(the above code) which was working before.
Map<String, String> headers = httpHeaders;
Map formData = httpFormData;
formData.remove("ctl00\$mainContent\$DDLEXAM");
if (AppState.prefs!.containsKey("timetable"))
return jsonDecode(AppState.prefs!.getString("timetable")!);
final String timetableURL = "/Student/TimeTable.aspx";
headers["referer"] = "https://eduserve.karunya.edu/Student/TimeTable.aspx";
Response res = await get(
Uri.parse("https://eduserve.karunya.edu$timetableURL"),
headers: headers);
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
final academicTerms =
soup.find_all("option").map((e) => e.text.trim()).toSet().toList();
int maxAcademicTerm = academicTerms.length -
1; // -1 for for compensating 0 indexing and to remove the option 'Select the Academic Term'
inputs.forEach((element) {
// Populate form data
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
formData["ctl00\$mainContent\$DDLACADEMICTERM"] = maxAcademicTerm.toString();
res = await post(Uri.parse("https://eduserve.karunya.edu$timetableURL"),
headers: headers, body: formData);
soup = Beautifulsoup(res.body);
List classes = soup.find_all("td").map((e) => e.text).toList();
if (res.body.indexOf(
"You have pending dues so you cannot view timetable. Please pay your dues.") !=
-1)
return {
"__error__":
"You have pending dues so you cannot view timetable. Please pay your dues."
};
if (classes.contains("No records to display.") || classes.length == 0)
return {"__error__": "No records to display."};
List days = ["MON", "TUE", "WED", "THU", "FRI"];
List tempList = [];
Map data = new Map();
days.forEach((day) {
int dayIndex = classes.indexOf(day);
tempList = classes.sublist(dayIndex + 1, dayIndex + 12);
data[day] = tempList;
});
await AppState.prefs!.setString("timetable", jsonEncode(data));
return data;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/attendance_summary.dart
|
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/models/attendance_summary.dart';
import 'package:http/http.dart';
Future<Map<String, List>> getAttendanceSummary([retries = 0]) async {
Map<String, String> headers = httpHeaders;
Map formData = httpFormData;
formData.remove("ctl00\$mainContent\$DDLEXAM");
headers["referer"] = "https://eduserve.karunya.edu/Student/AttSummary.aspx";
Response res = await get(
Uri.parse("https://eduserve.karunya.edu/Student/AttSummary.aspx"),
headers: headers);
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
final academicTerms =
soup.find_all("option").map((e) => e.text.trim()).toSet().toList();
int maxAcademicTerm = academicTerms.length -
1; // -1 for for compensating 0 indexing and to remove the option 'Select the Academic Term'
inputs.forEach((element) {
// Populate form data
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
formData["ctl00\$mainContent\$DDLACADEMICTERM"] = maxAcademicTerm.toString();
res = await post(
Uri.parse("https://eduserve.karunya.edu/Student/AttSummary.aspx"),
headers: headers,
body: formData);
soup = Beautifulsoup(res.body);
const basicInfoStart = 46;
const summaryDataStart = 38;
List basicInfo = soup.find_all("span").map((e) => e.text).toList();
if (basicInfo.length == 0 && retries == 0)
return getAttendanceSummary(++retries);
basicInfo = basicInfo.sublist(basicInfoStart);
// basicInfo [Semester, email, phone, ANDREW, SRA, Status, Total Hours : , total_hour_value, Present Hours : , present_hour_value, actual, od_corrected, ml_corrected, Leave Hours : , leave_hours_value, Absent Hours : , absent_hours_value]
List summary = soup.find_all("td").map((e) => e.text.trim()).toList();
summary = summary.sublist(summaryDataStart);
List<List<String>> summaryData = [];
for (int i = 0; i < summary.length; i += 14) {
try {
summaryData.add(summary.sublist(i, i + 14) as List<String>);
} catch (e) {}
}
for (int i = 0; i < summaryData.length; i++) {
int totalPresent = summaryData[i].where((e) => e == "P").toList().length;
int totalAbsent = summaryData[i].where((e) => e == "A").toList().length;
int totalUnAttended = summaryData[i].where((e) => e == "U").toList().length;
summaryData[i].add(totalPresent.toString());
summaryData[i].add(totalAbsent.toString());
summaryData[i].add(totalUnAttended.toString());
}
return {
"basicInfo": basicInfo,
"summaryData": summaryData,
};
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/scrap.dart
|
// Flutter imports:
import 'package:connectivity/connectivity.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart';
import 'package:shared_preferences/shared_preferences.dart';
class Scraper {
static BuildContext? mainPageContext;
static String status = "";
late SharedPreferences prefs;
late Client client;
static Map pages = {};
String hostname = "https://eduserve.karunya.edu";
String url = "";
static Map cache = {};
Map<String, String> headers = {
"user-agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66",
"accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"content-type": "application/x-www-form-urlencoded",
"origin": "https://eduserve.karunya.edu",
"referer": "",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "same-origin",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1"
};
Map formData = {
"RadScriptManager1_TSM":
";;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-US:1b322a7c-dfaa-439f-aa80-5f3d155ef91d:ea597d4b:b25378d2;Telerik.Web.UI:en-US:a519da8a-d673-48a9-9976-4b08756261d2:16e4e7cd:f7645509:22a6274a:33715776:24ee1bba:e330518b:2003d0b8:c128760b:1e771326:88144a7a:c8618e41:1a73651d:333f8d94:58366029:f46195d3",
"__EVENTTARGET": "ctl00\$mainContent\$DDLACADEMICTERM",
"__EVENTARGUMENT": "",
"__LASTFOCUS": "",
"__VIEWSTATE": "",
"__VIEWSTATEGENERATOR": "",
"__PREVIOUSPAGE": "",
"__EVENTVALIDATION": "",
"ctl00_radMenuModule_ClientState": "",
"ctl00\$mainContent\$DDLACADEMICTERM": "",
"ctl00_mainContent_grdData_ClientState": "",
};
Scraper() {
client = new Client();
initAsyncMethods();
}
Future<void> initAsyncMethods() async {
prefs = await SharedPreferences.getInstance();
}
Future<String> login([callback]) async {
// Login
var connection = await (Connectivity().checkConnectivity());
if (connection == ConnectivityResult.none) {
Fluttertoast.showToast(
msg: "Internet, caveman. Turn it on...",
timeInSecForIosWeb: 10,
);
}
String loginAddress = "/Login.aspx?ReturnUrl=%2f";
String username = prefs.getString("username")!;
String password = prefs.getString("password")!;
Map<String, String> login_data = {
"RadScriptManager1_TSM": "",
"__EVENTTARGET": "",
"__EVENTARGUMENT": "",
"__VIEWSTATE": "",
"__VIEWSTATEGENERATOR": "",
"__EVENTVALIDATION": "",
"ctl00\$mainContent\$Login1\$UserName": username,
"ctl00\$mainContent\$Login1\$Password": password,
"ctl00\$mainContent\$Login1\$LoginButton": "Log In"
};
status = "Get EduServe...";
// Get karunya.edu
url = hostname;
headers["referer"] = url;
var res = await client.get(Uri.parse(url));
var eduserveCookie = res.headers["set-cookie"]; // Set the ASP.NET_SessionId
// Parse: Start
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
inputs.forEach((element) {
if (login_data[element["name"]] == "") {
login_data[element["name"]!] = element["value"]!;
}
});
// Parse: End
// Get login.aspx
status += "\nLogging in...";
headers["cookie"] = eduserveCookie!.split(";")[0];
url = hostname + loginAddress;
headers["referer"] = url;
// Post to login.aspx
res = await client.post(Uri.parse(url), headers: headers, body: login_data);
if (res.body.indexOf(
"Your login attempt was not successful. Please try again.") !=
-1) {
Fluttertoast.showToast(
msg: "Your login attempt was not successful. Please try again.",
gravity: ToastGravity.CENTER);
}
if (res.statusCode == 302) {
status += "\nRedirecting to Home";
headers["cookie"] =
headers["cookie"]! + "; ${res.headers['set-cookie']!.split(';')[0]}";
res = await client.get(
Uri.parse("https://eduserve.karunya.edu${res.headers["location"]}"),
headers: headers);
}
if (res.body.contains("Hourly Feedback")) {
return "feedback form found";
}
return res.body;
}
Future<dynamic> getInternalMarks({String? academicTerm = null}) async {
final String internalsURL = "/Student/InternalMarks.aspx";
if (academicTerm == null) {
Response res = await client.get(Uri.parse("$hostname$internalsURL"),
headers: headers);
if (res.body.indexOf("Login") != -1) {
Fluttertoast.showToast(msg: "esM: Session expired. Refresh data!");
return;
}
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
List academicTerms =
soup.find_all("option").map((e) => e.text.trim()).toSet().toList();
inputs.forEach((element) {
// Populate form data
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
formData["ctl00\$mainContent\$DDLACADEMICTERM"] = academicTerm;
return academicTerms;
} else {
Map formDataCopy = formData;
formDataCopy["ctl00\$mainContent\$DDLACADEMICTERM"] =
academicTerm.toString();
Response res = await client.post(Uri.parse("$hostname$internalsURL"),
headers: headers, body: formDataCopy);
if ((res.body.indexOf("No records to display.") != -1)) {
return "No records to display.";
}
var soup = Beautifulsoup(res.body);
List table = soup.find_all("tr").map((e) => e.innerHtml).toSet().toList();
bool flagReached = false;
Map data = new Map();
table.forEach((element) {
if (element.indexOf("Entered by") != -1) {
flagReached = true;
return;
}
if (flagReached) {
element = element.trim().replaceAll("<td>", "");
element = element.trim().replaceAll("</td>", "<space>");
data[element.split("<space>")[8]] = element.split("<space>");
data[element.split("<space>")[8]]
.removeWhere((element) => element == "");
}
});
return Map.of(data);
}
}
Future<Map> getTimetable({bool force = false}) async {
final String timetableURL = "/Student/TimeTable.aspx";
headers["referer"] = "https://eduserve.karunya.edu/Student/TimeTable.aspx";
Response res =
await client.get(Uri.parse("$hostname$timetableURL"), headers: headers);
if (res.body.indexOf("Login") != -1) {
Fluttertoast.showToast(msg: "esM: Session expired. Refresh data!");
return {};
}
var soup = Beautifulsoup(res.body);
final inputs = soup.find_all("input").map((e) => e.attributes).toList();
final academicTerms =
soup.find_all("option").map((e) => e.text.trim()).toSet().toList();
int maxAcademicTerm = academicTerms.length -
1; // -1 for for compensating 0 indexing and to remove the option 'Select the Academic Term'
inputs.forEach((element) {
// Populate form data
if (formData[element["name"]] == "") {
formData[element["name"]] =
(element["value"] == "Clear" || element["value"] == null)
? ""
: element["value"];
}
});
formData["ctl00\$mainContent\$DDLACADEMICTERM"] =
maxAcademicTerm.toString();
res = await client.post(Uri.parse("$hostname$timetableURL"),
headers: headers, body: formData);
soup = Beautifulsoup(res.body);
List classes = soup.find_all("td").map((e) => e.text).toList();
List days = ["MON", "TUE", "WED", "THU", "FRI"];
List tempList = [];
Map data = new Map();
days.forEach((day) {
int dayIndex = classes.indexOf(day);
tempList = classes.sublist(dayIndex + 1, dayIndex + 12);
data[day] = tempList;
});
return data;
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/service/get_feedback_form.dart
|
// Package imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:http/http.dart';
// Project imports:
import 'package:eduserveMinimal/global/gloabls.dart';
Future<List> getFeedbackForm([int? stars]) async {
Map<String, String> headers = httpHeaders;
Response page = await get(
Uri.parse("https://eduserve.karunya.edu/MIS/IQAC/HFBCollection.aspx"),
headers: headers);
Beautifulsoup feedbackSoup = Beautifulsoup(page.body);
List feedbackList =
feedbackSoup.find_all("td").map((e) => e.text.trim()).toList();
List feedback_inputs = feedbackSoup
.find_all("input")
.map((e) => e.id)
.where((id) => id.contains("ClientState") && id.length > 36)
.toList();
List feedback = [];
List allFeedback = [];
bool feedbackStart = false;
int counter = 0;
feedbackList.forEach((element) {
if (element == "Class Not Handled") {
feedback.add(feedback_inputs[counter]);
feedback.removeWhere((element) => element == "");
allFeedback.add(feedback);
feedbackStart = false;
feedback = [];
counter++;
return;
}
if (element.toString().contains("Command item")) {
feedbackStart = true;
return;
}
feedback.add(element.toString().trim());
});
return allFeedback;
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/on_duty_list.dart
|
// Flutter imports:
import 'package:eduserveMinimal/models/leave.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:auto_size_text/auto_size_text.dart';
import 'package:shimmer/shimmer.dart';
// Project imports:
import 'package:eduserveMinimal/global/enum.dart';
import 'package:eduserveMinimal/screens/home/pages/apply_leave.dart';
class OnDutyList extends StatelessWidget {
const OnDutyList({Key? key, required this.leave, this.isLoading = false})
: super(key: key);
final List<OnDutyLeave>? leave;
final bool isLoading;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(10),
child: Container(
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: leave!.length + 1,
itemBuilder: (BuildContext context, int index) {
if (index == 0)
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton.icon(
icon: Icon(Icons.add),
label: Text("Apply leave"),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (_) =>
ApplyLeaveView(leaveType: LeaveType.OnDuty))),
),
],
);
if (isLoading)
return Shimmer.fromColors(
child: onDutyTile(context, 1),
baseColor: Colors.grey,
highlightColor: Colors.grey[900]!,
);
return onDutyTile(context, index);
},
),
),
);
}
Padding onDutyTile(BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context)
.textTheme
.bodyText1!
.color!
.withOpacity(0.2),
width: 2,
),
borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AutoSizeText(
leave![index - 1].reason.toString(),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context)
.textTheme
.bodyText1!
.color!
.withOpacity(0.3)),
),
Text(
"${leave![index - 1].fromDate} - ${leave![index - 1].toDate}",
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
Text(
leave![index - 1].session,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary),
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.all(2),
decoration: BoxDecoration(
color: leave![index - 1].status.contains("AVAILED")
? Colors.greenAccent.withOpacity(0.8)
: leave![index - 1].status.contains("REJECTED")
? Colors.redAccent.withOpacity(0.8)
: Colors.orangeAccent.withOpacity(0.8),
borderRadius: BorderRadius.circular(5),
),
child: Text(
leave![index - 1].status,
style: TextStyle(color: Colors.black),
),
),
SizedBox(height: 15),
InkWell(
child: Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.transparent.withOpacity(0.2),
borderRadius: BorderRadius.circular(8),
),
child: Icon(Icons.chevron_right),
),
onTap: () {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: Text(leave![index - 1].reason.toString()),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Duration: ${leave![index - 1].fromDate} - ${leave![index - 1].toDate}",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10),
Text(
"Created on: ${leave![index - 1].createdOn.toString()}"),
Text(
"From Session: ${leave![index - 1].fromSession}"),
Text(
"To Session: ${leave![index - 1].toSession}"),
Text("Status: ${leave![index - 1].status}"),
SizedBox(height: 10),
Text(
"Created by: ${leave![index - 1].createdBy}"),
Text(
"Approval by: ${leave![index - 1].approvalBy}"),
Text(
"Approval on: ${leave![index - 1].approvalOn}"),
Text(
"Availed by: ${leave![index - 1].availedBy}"),
Text(
"Availed on: ${leave![index - 1].availedOn}"),
Center(
child: TextButton(
onPressed: () =>
Navigator.of(context).pop(),
child: Text("Close")),
),
],
),
));
},
),
],
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/attendance_summary_basic.dart
|
import 'dart:math';
import 'package:eduserveMinimal/screens/home/widgets/attendance_bar_chart.dart';
import 'package:eduserveMinimal/screens/home/widgets/attendance_pie_chart.dart';
import 'package:eduserveMinimal/service/attendance_summary.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
class AttendanceSummaryWidget extends StatelessWidget {
AttendanceSummaryWidget({Key? key}) : super(key: key);
final Map dummyData = {
"basicInfo": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
Random().nextInt(90).toString(),
Random().nextInt(10).toString()
],
"summaryData": List.generate(
7,
(index) => List.generate(
17,
(index) =>
index == 0 ? "18 MAY 2002" : Random().nextInt(11).toString()))
};
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: getAttendanceSummary(),
builder: (context, AsyncSnapshot<Map<String, List>> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
print(snapshot.error);
print(snapshot);
}
if (snapshot.hasData) {
List<String> basicInfo =
List<String>.from(snapshot.data!["basicInfo"]!);
List<List<String>> summaryData =
List<List<String>>.from(snapshot.data!["summaryData"]!);
summaryData = summaryData.length < 7
? summaryData
: summaryData.sublist(0, 7);
return Column(
children: [
AttendancePieChart(data: basicInfo),
Padding(padding: EdgeInsets.all(10)),
AttendanceBarChart(data: summaryData)
],
);
} else {
Center(
child: Text("Something went wrong while building the chart"));
}
}
return Shimmer.fromColors(
baseColor: Colors.grey,
highlightColor: Colors.grey[900]!,
child: Column(
children: [
AttendancePieChart(data: dummyData["basicInfo"]),
Padding(padding: EdgeInsets.all(10)),
AttendanceBarChart(data: dummyData["summaryData"]),
],
),
);
},
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/attendance_widget.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:auto_size_text/auto_size_text.dart';
import 'package:provider/provider.dart';
import 'package:shimmer/shimmer.dart';
// Project imports:
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
import 'package:eduserveMinimal/service/attendence.dart';
class AttendanceContainer extends StatelessWidget {
const AttendanceContainer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: getAttendance(),
builder: (BuildContext context, AsyncSnapshot<List> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
Provider.of<AppState>(context, listen: false).attendance =
snapshot.data;
return containerWithData(context, snapshot.data!);
}
return containerWithData(context, ["0", "0", ""], true);
},
);
}
Container containerWithData(BuildContext context, List data,
[bool isLoading = false]) {
return Container(
decoration: BoxDecoration(
color: ThemeProvider.currentThemeData!.primaryColor.withOpacity(0.1),
// borderRadius: BorderRadius.circular(20),
),
child: Column(
children: [
isLoading
? Shimmer.fromColors(
baseColor: Colors.grey,
highlightColor: Colors.grey[900]!,
child: buildAttendenceContainer(data, context),
)
: buildAttendenceContainer(data, context),
],
),
);
}
Widget buildAttendenceContainer(List<dynamic> data, BuildContext context) {
final double _height = MediaQuery.of(context).size.height;
final double _width = MediaQuery.of(context).size.width;
return Padding(
padding: const EdgeInsets.only(top: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Stack(
alignment: Alignment.topRight,
children: [
Container(
padding: EdgeInsets.all(20),
height: _height * 0.15,
width: _width * 0.45,
decoration: BoxDecoration(
color: ThemeProvider.currentThemeData!.primaryColor,
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
AutoSizeText(
"Class",
minFontSize: 20,
maxFontSize: 50,
),
Spacer(),
AutoSizeText(
data[0].toString(),
minFontSize: data[1] == "Out-of-rolls" ? 20 : 30,
maxFontSize: 40,
),
],
),
),
Visibility(
visible: (double.tryParse(data[0].split("%")[0]) ?? 0) < 85,
child: Padding(
padding: const EdgeInsets.all(10),
child: Icon(Icons.warning_amber_outlined, color: Colors.red),
),
),
],
),
Stack(
alignment: Alignment.topRight,
children: [
Container(
padding: EdgeInsets.all(20),
height: _height * 0.15,
width: _width * 0.45,
decoration: BoxDecoration(
color: ThemeProvider.currentThemeData!.primaryColor,
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
AutoSizeText(
"Assembly",
minFontSize: 20,
maxFontSize: 50,
),
Spacer(),
AutoSizeText(
data[1].toString(),
minFontSize: data[1] == "Out-of-rolls" ? 20 : 30,
maxFontSize: 40,
),
],
),
),
Visibility(
visible: (double.tryParse(data[1].split("%")[0]) ?? 0) < 85,
child: Padding(
padding: const EdgeInsets.all(10),
child: Icon(Icons.warning_amber_outlined, color: Colors.red),
),
),
],
),
],
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/attendance_bar_chart.dart
|
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class AttendanceBarChart extends StatelessWidget {
const AttendanceBarChart({Key? key, required this.data}) : super(key: key);
final List<List<String>> data;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Container(
height: 250,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
border: Border.all(
color:
Theme.of(context).textTheme.bodyText1!.color!.withOpacity(0.2),
width: 2,
),
),
padding: EdgeInsets.all(10),
child: Column(
children: [
Text("Last 7 days attendance/hour"),
Expanded(
child: BarChart(
BarChartData(
alignment: BarChartAlignment.center,
maxY: 11,
minY: 0,
groupsSpace: 10,
gridData: FlGridData(show: false),
barTouchData: BarTouchData(enabled: true),
borderData: FlBorderData(show: false),
titlesData: FlTitlesData(
topTitles: SideTitles(showTitles: false),
rightTitles: SideTitles(showTitles: false),
leftTitles: SideTitles(showTitles: false),
bottomTitles: SideTitles(
showTitles: true,
getTitles: (double value) =>
data[value.toInt()][0].substring(0, 6),
rotateAngle: -55,
getTextStyles: (context, _) => TextStyle(fontSize: 12),
),
),
axisTitleData: FlAxisTitleData(
show: true,
bottomTitle: AxisTitle(
titleText: "Day", showTitle: true, margin: 20),
leftTitle: AxisTitle(titleText: "Hour", showTitle: true),
),
barGroups: List.generate(
data.length,
(index) => BarChartGroupData(
x: index,
barRods: [
BarChartRodData(
y: double.parse(data[index][14]),
colors: [Colors.green, Colors.greenAccent],
width: 15,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
),
BarChartRodData(
y: double.parse(data[index][15]),
backDrawRodData: BackgroundBarChartRodData(
colors: [
Colors.redAccent.withOpacity(0.01),
Colors.red.withOpacity(0.01)
],
show: true,
),
colors: [Colors.red, Colors.redAccent],
width: 12,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
),
BarChartRodData(
y: double.parse(data[index][16]),
backDrawRodData: BackgroundBarChartRodData(
colors: [
Colors.white.withOpacity(0.01),
Colors.grey.withOpacity(0.01)
],
show: true,
),
colors: [Colors.grey, Colors.white],
width: 10,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
),
],
),
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/leave_information.dart
|
// Flutter imports:
import 'package:eduserveMinimal/global/widgets/circle_tab_bar_indicator.dart';
import 'package:eduserveMinimal/models/leave.dart';
import 'package:eduserveMinimal/service/leave_info.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:eduserveMinimal/providers/app_state.dart';
import 'package:eduserveMinimal/providers/theme.dart';
import 'package:eduserveMinimal/screens/home/widgets/leave_list.dart';
import 'package:eduserveMinimal/screens/home/widgets/on_duty_list.dart';
class LeaveInformationWidget extends StatefulWidget {
const LeaveInformationWidget({Key? key}) : super(key: key);
@override
_LeaveInformationWidgetState createState() => _LeaveInformationWidgetState();
}
class _LeaveInformationWidgetState extends State<LeaveInformationWidget>
with SingleTickerProviderStateMixin {
TabController? _tabController;
@override
void initState() {
_tabController = TabController(length: 2, vsync: this);
super.initState();
}
@override
Widget build(BuildContext context) {
// Provider.of<AppState>(context, listen: false).scraper.getLeaveInfo();
// return Container();
Leave fakeLeaveData = Leave.generateFakeLeave();
return Container(
height: MediaQuery.of(context).size.height * 0.60,
child: Column(
children: [
TabBar(
controller: _tabController,
indicator:
CircleTabIndicator(color: Theme.of(context).primaryColor),
overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent),
tabs: [
Tab(text: "Leave"),
Tab(text: "On-Duty Details"),
],
labelColor:
ThemeProvider.currentThemeData!.textTheme.bodyText1!.color,
),
Expanded(
child: FutureBuilder(
future: getLeaveInfo(),
builder: (context, AsyncSnapshot<Leave> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
print(snapshot);
}
Provider.of<AppState>(context, listen: false).leaveInfo =
snapshot.data;
if (snapshot.data == null)
return Text("No records to display.");
List<OtherLeave>? leave = snapshot.data?.allLeave;
List<OnDutyLeave>? onDuty = snapshot.data?.allOnDuty;
return TabBarView(
controller: _tabController,
children: [
LeaveList(leave: leave),
OnDutyList(leave: onDuty),
],
);
}
return TabBarView(
controller: _tabController,
children: [
LeaveList(leave: fakeLeaveData.allLeave, isLoading: true),
OnDutyList(leave: fakeLeaveData.allOnDuty, isLoading: true),
],
);
},
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/leave_list.dart
|
// Flutter imports:
import 'package:eduserveMinimal/models/leave.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:auto_size_text/auto_size_text.dart';
import 'package:shimmer/shimmer.dart';
// Project imports:
import 'package:eduserveMinimal/global/enum.dart';
import 'package:eduserveMinimal/screens/home/pages/apply_leave.dart';
class LeaveList extends StatelessWidget {
const LeaveList({Key? key, required this.leave, this.isLoading = false})
: super(key: key);
final List<OtherLeave>? leave;
final bool isLoading;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(10),
child: Container(
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: leave!.length + 1,
itemBuilder: (BuildContext context, int index) {
if (index == 0)
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton.icon(
icon: Icon(Icons.add),
label: Text("Apply leave"),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (_) =>
ApplyLeaveView(leaveType: LeaveType.Medical))),
),
],
);
if (isLoading)
return Shimmer.fromColors(
child: leaveTile(context, 1),
baseColor: Colors.grey,
highlightColor: Colors.grey[900]!,
);
return leaveTile(context, index);
},
),
),
);
}
Padding leaveTile(BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context)
.textTheme
.bodyText1!
.color!
.withOpacity(0.2),
width: 2,
),
borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AutoSizeText(
leave![index - 1].reason.toString(),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context)
.textTheme
.bodyText1!
.color!
.withOpacity(0.3)),
),
Text(
"${leave![index - 1].fromDate} - ${leave![index - 1].toDate}",
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
Text(
leave![index - 1].session,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary),
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.all(2),
decoration: BoxDecoration(
color: leave![index - 1].status.contains("Active")
? Colors.greenAccent.withOpacity(0.8)
: leave![index - 1].status.contains("Rejected")
? Colors.redAccent.withOpacity(0.8)
: Colors.orangeAccent.withOpacity(0.8),
borderRadius: BorderRadius.circular(5),
),
child: Text(
leave![index - 1].status,
style: TextStyle(color: Colors.black),
),
),
SizedBox(height: 15),
InkWell(
child: Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.transparent.withOpacity(0.2),
borderRadius: BorderRadius.circular(8),
),
child: Icon(Icons.chevron_right),
),
onTap: () {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: Text(leave![index - 1].reason.toString()),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Duration: ${leave![index - 1].fromDate} - ${leave![index - 1].fromDate}",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10),
Text("From Session: ${leave![index - 1].fromSession}"),
Text("To Session: ${leave![index - 1].toSession}"),
Text("Status: ${leave![index - 1].status}"),
SizedBox(height: 10),
Center(
child: TextButton(
onPressed: () =>
Navigator.of(context).pop(),
child: Text("Close")),
),
],
),
));
},
),
],
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/attendance_pie_chart.dart
|
import 'package:eduserveMinimal/global/widgets/dot_container.dart';
import 'package:eduserveMinimal/providers/theme.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
class AttendancePieChart extends StatelessWidget {
const AttendancePieChart({
Key? key,
required this.data,
}) : super(key: key);
final List<String> data;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Container(
height: 350,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
border: Border.all(
color:
Theme.of(context).textTheme.bodyText1!.color!.withOpacity(0.2),
width: 2,
),
),
child: Stack(
children: [
PieChart(
PieChartData(
borderData: FlBorderData(show: false),
sectionsSpace: 10,
centerSpaceRadius: 100,
startDegreeOffset: -45,
sections: [
PieChartSectionData(
title: data[9],
color: Colors.green,
value: double.parse(data[9]),
radius: 60,
),
PieChartSectionData(
title: data.last,
color: Colors.red,
value: double.parse(data.last),
radius: 70,
),
],
),
),
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Present vs Absent Hours",
style: TextStyle(fontWeight: FontWeight.bold),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
DotContainer(color: Colors.green, text: "Present"),
DotContainer(color: Colors.red, text: "Absent"),
],
),
RichText(
text: TextSpan(children: [
TextSpan(
text: "More",
style: TextStyle(
color: ThemeProvider.currentThemeData!.primaryColor,
fontWeight: FontWeight.bold,
),
recognizer: TapGestureRecognizer()
..onTap = () => showDialog(
context: context,
builder: (_) => AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text("Total Hours: ${data[7]}"),
Text("Actual: ${data[10]}"),
Text("OD Corrected: ${data[11]}"),
Text("ML Corrected: ${data[12]}"),
Text("Leave Hours: ${data[14]}"),
],
),
)),
),
])),
],
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/birthday.dart
|
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
class BirthDayWidget extends StatelessWidget {
const BirthDayWidget({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
child: Stack(
alignment: Alignment.topRight,
children: [
Lottie.asset("assets/lottie/confetti.json"),
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Lottie.asset("assets/lottie/happy_birthday.json",
repeat: false),
),
],
),
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/widgets/additional_info.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
class AdditionalInfo extends StatelessWidget {
const AdditionalInfo({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: null,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Container();
}
return LinearProgressIndicator();
},
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/home_page.dart
|
// Flutter imports:
import 'package:eduserveMinimal/global/widgets/restart_widget.dart';
import 'package:eduserveMinimal/screens/home/widgets/attendance_summary_basic.dart';
import 'package:eduserveMinimal/screens/home/widgets/birthday.dart';
import 'package:eduserveMinimal/service/download_hallticket.dart';
import 'package:eduserveMinimal/service/fees_details.dart';
import 'package:eduserveMinimal/service/login.dart';
import 'package:eduserveMinimal/service/student_info.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:intl/intl.dart';
// Package imports:
import 'package:new_version/new_version.dart';
import 'package:package_info/package_info.dart';
import 'package:quick_actions/quick_actions.dart';
import 'package:shared_preferences/shared_preferences.dart';
// Project imports:
import 'package:eduserveMinimal/screens/home/pages/fees.dart';
import 'package:eduserveMinimal/screens/home/pages/hallticket.dart';
import 'package:eduserveMinimal/screens/home/pages/internals.dart';
import 'package:eduserveMinimal/screens/home/pages/issues.dart';
import 'package:eduserveMinimal/screens/home/pages/settings.dart';
import 'package:eduserveMinimal/screens/home/pages/timetable.dart';
import 'package:eduserveMinimal/screens/home/widgets/attendance_widget.dart';
import 'package:eduserveMinimal/screens/home/widgets/leave_information.dart';
import 'package:eduserveMinimal/screens/settings/pages/user.dart';
import 'package:eduserveMinimal/service/scrap.dart';
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
processExcessInfo(context);
initQuickActionsEvents(context);
return Scaffold(
drawer: Drawer(
child: Column(
children: buildDrawer(context),
),
),
body: RefreshIndicator(
displacement: 100,
triggerMode: RefreshIndicatorTriggerMode.anywhere,
child: CustomScrollView(
slivers: [
SliverAppBar(
expandedHeight: MediaQuery.of(context).size.height * 0.25,
title: Text("eduserveMinimal"),
pinned: true,
snap: true,
floating: true,
flexibleSpace: FlexibleSpaceBar(
background: Padding(
padding: const EdgeInsets.only(top: 80),
child: AttendanceContainer(),
),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15)),
),
SliverList(
delegate: SliverChildListDelegate([
LeaveInformationWidget(),
AttendanceSummaryWidget(),
]),
),
],
),
onRefresh: () => login().then((value) {
Scraper.cache.clear();
RestartWidget.restartApp(context);
Fluttertoast.showToast(msg: "Refresh complete");
}),
),
);
}
void initQuickActionsEvents(BuildContext context) {
final quickActions = QuickActions();
quickActions.initialize((type) {
print(type);
switch (type) {
case "timetable":
Navigator.of(context).pushNamed("/timetable");
break;
case "fees":
Navigator.of(context).pushNamed("/fees");
break;
case "apply_leave":
Navigator.of(context).pushNamed("/apply_leave");
break;
case "user":
Navigator.of(context).pushNamed("/user");
break;
}
});
}
Future<void> checkBirthday(BuildContext context) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
if (prefs.containsKey("birthDay")) {
String? birthday = prefs.getString("birthDay");
if (birthday != null) {
DateFormat dateFormat = DateFormat("dd MMM yyyy");
DateTime birthDay = dateFormat.parse(birthday);
DateTime today = DateTime.now();
if (birthDay.month == today.month && birthDay.day == today.day) {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => BirthDayWidget()));
}
}
}
}
List<StatelessWidget> buildDrawer(BuildContext context) {
return [
DrawerHeader(
child: Container(
child: Row(
children: [
Text("Hola amigo!", style: TextStyle(fontSize: 25)),
Spacer(),
GestureDetector(
child: Hero(
tag: "hero-userImage",
child: FutureBuilder(
future: getInfo(),
builder: (context, AsyncSnapshot snapshot) {
return snapshot.hasData
? CircleAvatar(
maxRadius: 50,
backgroundImage:
MemoryImage(snapshot.data!["studentIMG"]),
backgroundColor: Colors.transparent,
)
: Container(
height: 50,
width: 50,
decoration:
BoxDecoration(shape: BoxShape.circle),
child: CircularProgressIndicator(),
);
}),
),
onTap: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => User()));
},
),
],
),
),
),
ListTile(
title: Text("Timetable"),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => TimeTable())),
),
ListTile(
title: Text("Fees"),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => FeesView())),
),
ListTile(
title: Text("Internal"),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => InternalMarks())),
),
ListTile(
title: Text("Hallticket"),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => HallTicketView())),
),
ListTile(
title: Text("Settings"),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => Settings())),
),
];
}
Future<void> processExcessInfo(BuildContext context) async {
checkBirthday(context);
_checkUpdates(context);
Map dataCache = await fetchAllData();
try {
bool feesDue =
(double.tryParse(dataCache["fees"]["dues"].first) ?? 0) > 0;
bool hallTicketUnEligile = dataCache["hallticket"]
.contains("No records to display.")
? false
: dataCache["hallticket"].first.where((e) => e == "Eligible").length <
3;
print("Fees due: $feesDue");
print("Uneligible for exam: $hallTicketUnEligile");
if (feesDue || hallTicketUnEligile) {
ScaffoldMessenger.of(context).showMaterialBanner(MaterialBanner(
backgroundColor: Colors.redAccent,
leading: Icon(Icons.error_outline),
content: TextButton(
onPressed: () {
SchedulerBinding.instance!.addPostFrameCallback((timeStamp) {
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => IssuesView(
outstandingDue: feesDue,
hallTicketUnEligible: hallTicketUnEligile)));
ScaffoldMessenger.of(context).removeCurrentMaterialBanner();
});
},
child: Text("Action required!",
style: TextStyle(
color: Colors.white,
fontSize: 22,
fontWeight: FontWeight.bold))),
actions: [
IconButton(
onPressed: () =>
ScaffoldMessenger.of(context).removeCurrentMaterialBanner(),
icon: Icon(Icons.close)),
],
));
}
} catch (e) {}
}
Future<Map> fetchAllData() async {
await getFeesDetails();
await getInfo();
List? hallTicketData = await downloadHallTicket();
if (hallTicketData != null) {
await downloadHallTicket(
term: hallTicketData[1].values.toList()[0]["value"]);
}
return Scraper.cache;
}
void _checkUpdates(BuildContext context) async {
PackageInfo info = await PackageInfo.fromPlatform();
if (info.packageName.contains("dev") || info.packageName.contains("stg"))
return;
final newVersion = NewVersion(androidId: info.packageName);
newVersion.showAlertIfNecessary(context: context);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/issues.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:eduserveMinimal/screens/home/pages/fees.dart';
import 'package:eduserveMinimal/screens/home/pages/hallticket.dart';
class IssuesView extends StatelessWidget {
const IssuesView(
{Key? key,
required this.outstandingDue,
required this.hallTicketUnEligible})
: super(key: key);
final bool outstandingDue;
final bool hallTicketUnEligible;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Issues"),
actions: [
IconButton(
onPressed: () {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: Text("Issues Feature"),
content: Text(
"Issues page will suggest potential issues you might experience by the data provided in eduserve. This feature will suggest issues by statically analysing the data and not by any intelligent models."),
));
},
icon: Icon(Icons.info_outline))
],
),
body: SafeArea(
child: Column(
children: [
Visibility(
visible: outstandingDue,
child: ListTile(
tileColor: Colors.redAccent.withOpacity(0.6),
title: Text("You have outstanding fees due"),
trailing: TextButton(
onPressed: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => FeesView())),
child: Text("Review"),
),
),
),
Visibility(
visible: hallTicketUnEligible,
child: ListTile(
tileColor: Colors.orangeAccent.withOpacity(0.6),
title: Text("You might have issues on hallticket download"),
trailing: TextButton(
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => HallTicketView())),
child: Text("Review"),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/internals.dart
|
// Flutter imports:
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/service/internal_marks.dart';
import 'package:flutter/material.dart';
class InternalMarks extends StatefulWidget {
@override
_InternalMarksState createState() => _InternalMarksState();
}
class _InternalMarksState extends State<InternalMarks> {
String status = "";
bool _visible = false;
Widget table = Container();
String? dropdownSelection;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Internal"),
centerTitle: true,
),
body: Column(
children: [
dropDown(context),
Expanded(
child: table,
),
],
),
);
}
FutureBuilder<dynamic> dropDown(BuildContext context) {
return FutureBuilder(
future: getInternalMarks(),
builder: (context, AsyncSnapshot<dynamic> snapshot) {
List<String> academicTerms = [];
if (snapshot.hasData) {
academicTerms =
(snapshot.data.runtimeType == academicTerms.runtimeType)
? snapshot.data
: [];
academicTerms.remove("Select the Academic Term");
return Column(
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: DropdownButton(
hint: Text("Select the Academic Term"),
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
underline: Container(
height: 2,
),
value: dropdownSelection,
items: academicTerms
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (String? value) async {
setState(() {
dropdownSelection = value.toString();
table = Center(child: CircularProgressIndicator());
});
final data = await scraper.getInternalMarks(
academicTerm: (academicTerms.length -
academicTerms.indexOf(value!))
.toString());
if (data == "No records to display.") {
// If login required
academicTerms = [];
}
if (data.runtimeType != String) {
// table dataY
List dataCell = [];
data.forEach((key, value) {
List<DataCell> temp = [];
value.forEach((element) {
temp.add(DataCell(Container(
color:
((double.tryParse(element.trim()) ?? 21) < 20)
? Colors.red
: Colors.transparent,
width: MediaQuery.of(context).size.width / 3,
child: Text(
element.trim(),
style: TextStyle(fontSize: 17),
),
)));
});
dataCell.add(temp);
});
setState(() {
table = buildTable(data, dataCell);
});
return;
} else {
// No records available
_visible = true;
setState(() {
status = data;
table = Container();
});
Future.delayed(Duration(seconds: 2)).then((value) {
setState(() => _visible = !_visible);
});
}
},
)),
AnimatedOpacity(
duration: Duration(seconds: 1),
opacity: _visible ? 1.0 : 0.0,
child: Text(status.toString()),
),
],
);
} else {
return Center(
child: CircularProgressIndicator(),
);
}
},
);
}
Widget buildTable(Map data, List dataCell) {
List header = [
"Subject Code",
"Subject Name",
"IA Parameter",
"Total Marks",
"Marks Scored",
"Test Marks",
"Online Exam Marks",
"Attendance",
"Test Date",
"Entered by",
"Entered on"
];
return Container(
margin: EdgeInsets.only(top: 2, left: 5, right: 5),
child: SingleChildScrollView(
child: Column(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
dataRowHeight: MediaQuery.of(context).size.height / 5,
columnSpacing: MediaQuery.of(context).size.width / 20,
headingRowColor: MaterialStateProperty.all(Colors.white70),
dividerThickness: 2,
columns: List.generate(
header.length,
(index) => DataColumn(
label: Text(
header[index].toString(),
style: TextStyle(color: Colors.black),
))),
rows: List.generate(dataCell.length,
(index) => DataRow(cells: dataCell[index])),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/credentials.dart
|
// Flutter imports:
import 'package:beautifulsoup/beautifulsoup.dart';
import 'package:eduserveMinimal/edu_serve.dart';
import 'package:eduserveMinimal/global/gloabls.dart';
import 'package:eduserveMinimal/service/scrap.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:auto_size_text/auto_size_text.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:http/http.dart';
import 'package:shared_preferences/shared_preferences.dart';
// Project imports:
import 'package:eduserveMinimal/service/login.dart';
class Credentials extends StatelessWidget {
bool? pushHomePage = false;
Credentials({this.pushHomePage});
GlobalKey<FormState> _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
TextEditingController _usernameController = new TextEditingController();
TextEditingController _passwordController = new TextEditingController();
void setDefaults() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
_usernameController.text = prefs.getString("username") ?? "";
_passwordController.text = prefs.getString("password") ?? "";
}
setDefaults();
return Scaffold(
resizeToAvoidBottomInset: false,
body: SafeArea(
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 20, top: 20),
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Form(
key: _formKey,
child: Column(
children: [
Text("Enter Credentials", style: TextStyle(fontSize: 30)),
SizedBox(height: 20),
buildTextField(_usernameController,
'Enter your register number.', false),
SizedBox(height: 20),
buildTextField(
_passwordController, 'Enter your password.', true),
SizedBox(height: 20),
ElevatedButton(
child: Text("Save"),
onPressed: () async {
if (!_formKey.currentState!.validate()) return;
SharedPreferences prefs =
await SharedPreferences.getInstance();
showDialog(
context: context,
barrierDismissible: false,
builder: (_) => AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Verifying credentials...",
style: TextStyle(fontSize: 25),
),
),
CircularProgressIndicator(),
],
),
));
String loginStatus = await login(
_usernameController.text, _passwordController.text);
Navigator.of(context).pop();
if (loginStatus == "Login error") {
Fluttertoast.showToast(msg: "Login error");
return;
}
await prefs.setString(
"username", _usernameController.text);
await prefs.setString(
"password", _passwordController.text);
Fluttertoast.showToast(
msg: "Credentials updated successfully");
cacheBirthDate();
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => HomeController()));
},
),
SizedBox(height: 30.0),
Text("Caution!",
style: GoogleFonts.kanit(
fontSize: 20,
color: Colors.red,
)),
Column(
children: [
Row(children: [
Icon(Icons.control_point),
SizedBox(width: 10),
Expanded(
child: AutoSizeText(
"Refreshing the data too many times will result in banning in eduserve. You will need to reset your password everytime you get banned.",
style: GoogleFonts.kanit(),
maxFontSize: 30,
minFontSize: 15,
maxLines: 4,
overflow: TextOverflow.ellipsis,
),
),
]),
SizedBox(height: 20),
Row(children: [
Icon(Icons.control_point),
SizedBox(width: 10),
Expanded(
child: AutoSizeText(
"If you feel the app doesn't work properly hard restart the app. If that doesnt help file a issue on github.\nSettings -> About -> Request Feature",
style: GoogleFonts.kanit(),
maxFontSize: 30,
minFontSize: 15,
maxLines: 4,
overflow: TextOverflow.ellipsis,
),
),
])
],
),
SizedBox(height: 50),
FutureBuilder(
future: SharedPreferences.getInstance(),
builder:
(context, AsyncSnapshot<SharedPreferences> snapshot) {
return snapshot.hasData
? Visibility(
visible: snapshot.data!.containsKey("username"),
child: ElevatedButton(
onPressed: () => Fluttertoast.showToast(
msg: "Press and hold for action"),
onLongPress: () => logout(context),
child: Text("Logout"),
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.resolveWith<
Color>((states) => Colors.red),
),
),
)
: Container();
})
],
),
),
),
),
),
);
}
TextFormField buildTextField(
TextEditingController _starsController, String hint, bool obscure) {
return TextFormField(
controller: _starsController,
obscureText: obscure,
decoration: InputDecoration(
hintText: hint,
contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 1.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 2.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
),
validator: (value) {
if (value == null) return "Enter a value";
if (value == "") return "Enter a value";
return null;
},
);
}
void logout(BuildContext context) {
bool isLogOutClicked = false;
showDialog(
context: context,
builder: (_) => StatefulBuilder(builder: (context, setState) {
return AlertDialog(
title: Text("Logout"),
content: Text("Are you sure you want to logout?"),
actions: [
TextButton(
onPressed: () async {
setState(() => isLogOutClicked = true);
SharedPreferences prefs =
await SharedPreferences.getInstance();
await prefs.remove("username");
await prefs.remove("password");
Scraper.cache = {};
Fluttertoast.showToast(msg: "Logout completed");
Navigator.of(context).pushNamedAndRemoveUntil(
"/credentials", (route) => false);
},
child: isLogOutClicked
? SizedBox(width: 80, child: LinearProgressIndicator())
: Text(
"Logout",
style: TextStyle(color: Colors.red),
),
),
ElevatedButton(
onPressed: () => Navigator.of(context).pop(),
child: Text("Cancel"),
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(states) => Colors.green),
),
),
],
);
}));
}
Future<void> cacheBirthDate() async {
Response res = await get(
Uri.parse("https://eduserve.karunya.edu/Student/PersonalInfo.aspx"),
headers: httpHeaders);
Beautifulsoup soup = Beautifulsoup(res.body);
String? dateString = soup
.find_all("input")
.where((element) => element.id == "ctl00_mainContent_TXTDOB_dateInput")
.first
.attributes["value"];
if (dateString != null) {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString("birthDay", dateString);
}
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/hallticket.dart
|
// Flutter imports:
import 'package:eduserveMinimal/service/download_hallticket.dart';
import 'package:flutter/material.dart';
class HallTicketView extends StatefulWidget {
@override
_HallTicketViewState createState() => _HallTicketViewState();
}
class _HallTicketViewState extends State<HallTicketView> {
List<String> exams = [];
String? selectedTerm = "Select the Examination";
Widget table = Container();
Widget mainDataWidget = Container();
bool dataLoaded = false;
String? selectedTermValue = "";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Download Hall Ticket"),
centerTitle: true,
// actions: [
// Visibility(
// visible: dataLoaded,
// child: IconButton(
// onPressed: () async {
// await Provider.of<AppState>(context, listen: false)
// .scraper
// .downloadHallTicket(
// term: selectedTermValue, download: true);
// },
// icon: Icon(Icons.save)))
// ],
),
body: SafeArea(
child: Column(
children: [
dropDown(context),
Visibility(visible: dataLoaded, child: mainDataWidget),
Expanded(
child: table,
),
],
),
),
);
}
FutureBuilder<List<dynamic>?> dropDown(BuildContext context) {
return FutureBuilder(
future: downloadHallTicket(),
builder: (context, AsyncSnapshot<List?> snapshot) {
if (!snapshot.hasData)
exams = ["Select the Examination"];
else
exams = List<String>.from(
snapshot.data!.map((e) => e.keys.first).toList());
return Padding(
padding: const EdgeInsets.all(20.0),
child: DropdownButton(
hint: Text("Select the Examination"),
icon: Icon(Icons.arrow_downward),
value: selectedTerm,
iconSize: 24,
elevation: 16,
underline: Container(
height: 2,
color: Colors.deepPurpleAccent,
),
onChanged: (String? value) async {
setState(() {
selectedTerm = value;
table = Center(child: CircularProgressIndicator());
});
if (value == "Select the Examination") {
setState(() {
table = mainDataWidget = Container();
});
return;
}
final terms = snapshot.data!
.map((e) => e.containsKey(value) ? e[value] : null)
.toList();
terms.removeWhere((element) => element == null);
selectedTermValue = terms.first["value"];
List<dynamic>? data =
await downloadHallTicket(term: terms.first["value"]);
if (data == null) {
return;
}
List mainData = [];
for (int i = 0; i < data[0].length; i += 2) {
mainData.add(data[0][i] + " " + data[0][i + 1]);
}
mainDataWidget = data.contains("No records to display.")
? Container()
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(
mainData.length,
(index) => Text(mainData[index],
style: TextStyle(fontSize: 17))),
);
setState(() {
table = data.contains("No records to display.")
? Text("No records to display.")
: buildTable(data);
dataLoaded = true;
});
},
items: exams.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
);
});
}
Widget buildTable(List data) {
List header = [
"Subject Code",
"Subject Name",
// "Eligibile",
];
List subjectData = data.contains("No records to display.") ? [] : data[1];
return Container(
margin: EdgeInsets.only(top: 2, left: 5, right: 5),
child: SingleChildScrollView(
child: Column(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
dataRowHeight: MediaQuery.of(context).size.height / 5,
columnSpacing: MediaQuery.of(context).size.width / 20,
headingRowColor: MaterialStateProperty.all(Colors.white70),
dividerThickness: 2,
columns: List.generate(
header.length,
(index) => DataColumn(
label: Text(
header[index].toString(),
style: TextStyle(color: Colors.black),
))),
rows: List.generate(
subjectData.length,
(index) => DataRow(
color: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
return subjectData[index].last == 'Y'
? Colors.green.withOpacity(0.2)
: Colors.orange.withOpacity(0.2);
}),
cells: List.generate(
subjectData[index].length - 1,
(index1) => DataCell(Container(
child: Text(
subjectData[index][index1].trim(),
style: TextStyle(fontSize: 17),
),
))))),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/cache_data.dart
|
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CacheDataView extends StatelessWidget {
const CacheDataView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Column(
children: [
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove("timetable");
Fluttertoast.showToast(msg: "Timetable data resetted!");
}, child: Text("Reset Timtable Data")),
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/fees.dart
|
// Flutter imports:
import 'package:eduserveMinimal/models/fees.dart';
import 'package:eduserveMinimal/service/fees_details.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// Package imports:
import 'package:auto_size_text/auto_size_text.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_fonts/google_fonts.dart';
// Project imports:
import 'package:eduserveMinimal/providers/theme.dart';
class FeesView extends StatelessWidget {
@override
Widget build(BuildContext context) {
double _width = MediaQuery.of(context).size.width;
return Scaffold(
body: SafeArea(
child: FutureBuilder(
future: getFeesDetails(),
builder: (context, AsyncSnapshot<Fees?> snapshot) {
if (snapshot.hasData) {
Fees fees = snapshot.data!;
List dues = fees.dues.length < 2 ? [0, 0] : fees.dues;
return Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 10, bottom: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
height: 50,
width: _width / 2.2,
decoration: BoxDecoration(
color:
ThemeProvider.currentThemeData!.primaryColor,
borderRadius: BorderRadius.circular(15),
),
child: Center(
child: AutoSizeText("Total Due: ${dues[0]}",
minFontSize: 15,
maxFontSize: 22,
overflow: TextOverflow.ellipsis,
style: GoogleFonts.comfortaa(
fontWeight: FontWeight.bold))),
),
),
Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
height: 50,
width: _width / 2.2,
decoration: BoxDecoration(
color:
ThemeProvider.currentThemeData!.primaryColor,
borderRadius: BorderRadius.circular(15),
),
child: Center(
child: AutoSizeText("Excess Fee: ${dues[1]}",
minFontSize: 15,
maxFontSize: 22,
overflow: TextOverflow.ellipsis,
style: GoogleFonts.comfortaa(
fontWeight: FontWeight.bold))),
),
),
],
),
),
Expanded(
child: ListView.builder(
itemCount: fees.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.all(5.0),
child: ListTile(
tileColor:
ThemeProvider.currentThemeData!.cardColor,
title: AutoSizeText(fees.values[index].description),
leading: AutoSizeText(
fees.values[index].date, // Date
minFontSize: 12,
maxFontSize: 18,
overflow: TextOverflow.ellipsis,
),
trailing: Column(
children: [
AutoSizeText(
"${fees.values[index].currency} ${fees.values[index].amountPaid}", // Amount
minFontSize: 18,
maxFontSize: 24,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Colors.red),
),
AutoSizeText(
fees.ids[index], // Reciept number
minFontSize: 12,
maxFontSize: 18,
overflow: TextOverflow.ellipsis,
),
],
),
onTap: () {
Clipboard.setData(ClipboardData(
text:
"${fees.values[index].description}\nReciept no. : ${fees.ids[index]}\nAmount: ${fees.values[index].amountPaid}\nDate Payed: ${fees.values[index].date}"));
Fluttertoast.showToast(
msg: "Copied to clipboard");
},
),
);
},
),
),
],
);
} else {
return Center(child: CircularProgressIndicator());
}
},
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/feedback_form.dart
|
// Flutter imports:
import 'package:eduserveMinimal/service/fill_feedback_form.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
// Project imports:
import 'package:eduserveMinimal/service/get_feedback_form.dart';
import 'package:url_launcher/url_launcher.dart';
class FeedbackForm extends StatefulWidget {
FeedbackForm({Key? key}) : super(key: key);
@override
_FeedbackFormState createState() => _FeedbackFormState();
}
class _FeedbackFormState extends State<FeedbackForm> {
Map feedbackRating = {};
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: getFeedbackForm(),
builder: (BuildContext context, AsyncSnapshot<List> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return ListView(
children: List.generate(snapshot.data!.length + 2, (index) {
if (index == 0)
return Column(
children: [
Center(
child: Text("Hourly Feedback",
style: TextStyle(fontSize: 30))),
Divider(),
],
);
if (index == snapshot.data!.length + 1)
return Column(
children: [
ElevatedButton(
// onPressed: null,
onPressed: () {
fillFeedbackForm(feedbackRating);
// .then(
// (value) => Navigator.of(context).pushNamed("/home"));
},
child: Text("Submit")),
Column(
children: [
Text("This feature is under development!"),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Please fill the form in "),
GestureDetector(
child: Text(
"eduserve page.",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
onTap: () async {
await launch(
"https://eduserve.karunya.edu/MIS/IQAC/HFBCollection.aspx");
},
),
],
),
Text("Sorry for the inconvenience 🙇"),
],
),
ElevatedButton(
onPressed: () {
Navigator.of(context).pushNamed("/home");
},
child: Text("Reload"),
),
],
);
feedbackRating[snapshot.data![index - 1].last.toString()] = 1;
return ExpansionTile(
title: Text(snapshot.data![index - 1][1].toString()),
subtitle:
Text("Hour ${snapshot.data![index - 1][0].toString()}"),
children: [
RatingBar.builder(
initialRating: 1,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: false,
itemCount: 5,
// itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
itemBuilder: (context, _) => Icon(
Icons.star,
color: Colors.amber,
),
onRatingUpdate: (rating) {
feedbackRating[snapshot.data![index - 1].last
.toString()] = rating.toInt();
},
)
],
);
}),
);
}
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Getting feedback form..."),
SizedBox(height: 20),
CircularProgressIndicator(),
],
),
);
},
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/settings.dart
|
// Flutter imports:
import 'package:eduserveMinimal/screens/home/pages/cache_data.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:new_version/new_version.dart';
// Package imports:
import 'package:package_info/package_info.dart';
import 'package:url_launcher/url_launcher.dart';
// Project imports:
import 'package:eduserveMinimal/screens/home/pages/credentials.dart';
import 'package:eduserveMinimal/screens/settings/pages/attribution.dart';
import 'package:eduserveMinimal/screens/settings/pages/developer.dart';
import 'package:eduserveMinimal/screens/settings/pages/themes.dart';
class Settings extends StatelessWidget {
static final thisAppPublishDate = "2020-12-20 19:38:07.569667";
final String eduserveURL =
"https://eduserve.karunya.edu/Login.aspx?ReturnUrl=%2f";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Settings"),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Themes"),
onPressed: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => Themes())),
),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Open EduServe"),
onPressed: () async {
await launch(eduserveURL);
},
),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Update credentials"),
onPressed: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => Credentials()));
},
),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Check updates"),
onPressed: () async {
PackageInfo info = await PackageInfo.fromPlatform();
if (info.packageName.contains("dev") ||
info.packageName.contains("stg"))
Fluttertoast.showToast(
msg: "You are running a non-production build!");
final newVersion = NewVersion(androidId: info.packageName);
newVersion.showAlertIfNecessary(context: context);
bool? canUpdate =
(await newVersion.getVersionStatus())?.canUpdate;
if (canUpdate ?? false)
Fluttertoast.showToast(
msg: "You are already on latest version!");
// launch(
// "https://github.com/hiruthic2002/eduserveMinimal/releases");
}),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Attributions"),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => AttributionScreen()))),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Manage Cache Data"),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => CacheDataView()))),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
child: Text("Manage Cache Data"),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(builder: (_) => CacheDataView()))),
),
Row(
children: [
Expanded(
child: ElevatedButton(
child: Text("About"),
onPressed: () async {
PackageInfo info = await PackageInfo.fromPlatform();
showAboutDialog(
context: context,
applicationVersion: info.version,
applicationLegalese: "Yo, nice!");
}),
),
Spacer(),
Expanded(
child: ElevatedButton(
child: Text("Author"),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => Developer()));
},
),
),
],
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(right: 5),
child: Text("♥️"),
),
GestureDetector(
child: Text("Contribute",
style: TextStyle(
decoration: TextDecoration.underline,
color: Colors.blue)),
onTap: () =>
launch("https://github.com/hiruthic2002/eduserveMinimal"),
),
Text(" to this project"),
],
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/timetable.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:eduserveMinimal/service/timetable.dart';
class TimeTable extends StatelessWidget {
final List days = [];
@override
Widget build(BuildContext context) {
return Scaffold(
body: FutureBuilder(
future: getTimetable(),
builder: (context, AsyncSnapshot<Map?> snapshot) {
if (snapshot.hasData) {
days.addAll(snapshot.data!.keys.toList());
if (days.contains("__error__"))
return Center(
child: Container(
child: Text(snapshot.data!["__error__"].toString()),
),
);
List dataCell = [];
snapshot.data!.forEach((key, value) {
List<DataCell> temp = [];
value.forEach((element) {
temp.add(
DataCell(
Container(
width: MediaQuery.of(context).size.width / 3,
child: Text(
(element.trim() == "") ? "YEET" : element,
style: TextStyle(fontSize: 17),
),
),
),
);
});
temp.insert(
0,
DataCell(
Text(
key,
style: TextStyle(fontSize: 10),
),
),
);
dataCell.add(temp);
});
return buildTimeTable(context, dataCell);
} else {
return Center(child: CircularProgressIndicator());
}
},
),
);
}
SafeArea buildTimeTable(BuildContext context, List dataCell) {
String? currentDay;
switch (DateTime.now().weekday) {
case 1:
currentDay = "MON";
break;
case 2:
currentDay = "TUE";
break;
case 3:
currentDay = "WED";
break;
case 4:
currentDay = "THU";
break;
case 5:
currentDay = "FRI";
break;
}
return SafeArea(
child: ListView(
scrollDirection: Axis.horizontal,
children: [
Container(
margin: EdgeInsets.only(top: 2, left: 5, right: 5),
child: SingleChildScrollView(
child: DataTable(
dataRowHeight: MediaQuery.of(context).size.height / 5,
columnSpacing: MediaQuery.of(context).size.width / 30,
headingRowColor: MaterialStateProperty.all(Colors.white70),
dividerThickness: 2,
columns: List.generate(
12,
(index) => DataColumn(
label: (index == 0)
? Text("Day/Hour",
style: TextStyle(
fontSize: 12, color: Colors.black))
: Text("Hour $index",
style: TextStyle(
fontSize: 15, color: Colors.black)))),
rows: List.generate(
days.length,
(index) => DataRow(
cells: dataCell[index],
selected: (currentDay == days[index]) ? true : false,
),
),
),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/pages.dart
|
export 'apply_leave.dart';
export 'credentials.dart';
export 'feedback_form.dart';
export 'fees.dart';
export 'hallticket.dart';
export 'home_page.dart';
export 'internals.dart';
export 'issues.dart';
export 'settings.dart';
export 'timetable.dart';
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/home
|
mirrored_repositories/eduserveMinimal/lib/screens/home/pages/apply_leave.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:eduserveMinimal/global/enum.dart';
import 'package:eduserveMinimal/providers/theme.dart';
class ApplyLeaveView extends StatefulWidget {
const ApplyLeaveView({Key? key, this.leaveType = LeaveType.Medical})
: super(key: key);
final LeaveType leaveType;
@override
State<ApplyLeaveView> createState() => _ApplyLeaveViewState();
}
class _ApplyLeaveViewState extends State<ApplyLeaveView>
with SingleTickerProviderStateMixin {
TabController? _tabController;
@override
void initState() {
_tabController = TabController(length: 2, vsync: this);
_tabController!.index = widget.leaveType == LeaveType.Medical ? 0 : 1;
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Apply Leave"),
centerTitle: true,
),
body: SafeArea(
child: Column(
children: [
TabBar(
controller: _tabController,
tabs: [
Tab(text: "Medical"),
Tab(text: "OnDuty"),
],
labelColor:
ThemeProvider.currentThemeData!.textTheme.bodyText1!.color,
),
Expanded(
child: TabBarView(controller: _tabController, children: [
MedicalLeaveWidget(),
OnDutyLeaveWidget(),
]),
),
],
),
),
);
}
}
class MedicalLeaveWidget extends StatelessWidget {
const MedicalLeaveWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: Text("Medical"),
);
}
}
class OnDutyLeaveWidget extends StatelessWidget {
const OnDutyLeaveWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: Text("On Duty"),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/settings
|
mirrored_repositories/eduserveMinimal/lib/screens/settings/widgets/semester_summary_graph.dart
|
import 'package:eduserveMinimal/global/widgets/dot_container.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class SemesterSummaryGraph extends StatelessWidget {
SemesterSummaryGraph({
Key? key,
required this.months,
required this.arrears,
required this.scgpa,
required this.cgpa,
}) : super(key: key);
final List months;
final List arrears;
final List scgpa;
final List cgpa;
@override
Widget build(BuildContext context) {
return Container(
height: 300,
decoration: BoxDecoration(),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Semester Summary", style: TextStyle(fontSize: 25)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
DotContainer(color: Colors.red, text: "Arrear"),
DotContainer(color: Colors.orange, text: "Semester CGPA"),
DotContainer(color: Colors.green, text: "CGPA"),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(10),
child: LineChart(
LineChartData(
lineTouchData: LineTouchData(enabled: true),
gridData: FlGridData(show: false),
borderData: FlBorderData(show: false),
minY: 0,
maxY: 10,
titlesData: FlTitlesData(
show: true,
rightTitles: SideTitles(showTitles: false),
leftTitles: SideTitles(showTitles: true, margin: 20),
topTitles: SideTitles(showTitles: false),
bottomTitles: SideTitles(
reservedSize: 30,
showTitles: true,
rotateAngle: -45,
getTitles: (index) {
if (index > months.length - 1) return "";
return months[index.toInt()];
},
),
),
lineBarsData: [
LineChartBarData(
isCurved: true,
barWidth: 5,
colors: [Colors.orange, Colors.orangeAccent],
spots: List.generate(
scgpa.length,
(index) => FlSpot(
index.toDouble(),
double.parse(scgpa[index]),
),
),
),
LineChartBarData(
isCurved: true,
barWidth: 5,
colors: [Colors.green, Colors.greenAccent],
spots: List.generate(
cgpa.length,
(index) => FlSpot(
index.toDouble(),
double.parse(cgpa[index]),
),
),
),
LineChartBarData(
isCurved: true,
barWidth: 5,
colors: [Colors.red, Colors.redAccent],
spots: List.generate(
arrears.length,
(index) => FlSpot(
index.toDouble(),
double.parse(arrears[index]),
),
),
belowBarData: BarAreaData(show: true, colors: [
Colors.red.withOpacity(0.1),
Colors.redAccent.withOpacity(0.1)
]),
),
],
),
),
),
),
],
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/settings
|
mirrored_repositories/eduserveMinimal/lib/screens/settings/pages/themes.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:eduserveMinimal/providers/theme.dart';
class Themes extends StatelessWidget {
const Themes({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Themes"),
centerTitle: true,
),
body: ListView(
children: List.generate(
ThemeMode.values.length,
(index) => ListTile(
title: Text(ThemeMode.values[index]
.toString()
.split(".")
.last
.toUpperCase()),
trailing: Visibility(
visible: Provider.of<ThemeProvider>(context, listen: false)
.themeMode ==
ThemeMode.values[index],
child: Icon(Icons.check_circle_outline, color: Colors.green)),
onTap: () {
Provider.of<ThemeProvider>(context, listen: false)
.setThemeMode(ThemeMode.values[index]);
},
),
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/settings
|
mirrored_repositories/eduserveMinimal/lib/screens/settings/pages/attribution.dart
|
// Flutter imports:
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:url_launcher/url_launcher.dart';
class AttributionScreen extends StatelessWidget {
const AttributionScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
List<Attribution> attributions = [
Attribution(
AttributionType.Animation,
"Alex Martov",
"https://lottiefiles.com/8654-unlocked",
"Lottie Files",
"https://lottiefiles.com"),
Attribution(
AttributionType.Animation,
"Emas Didik Prasetyo",
"https://lottiefiles.com/73194-happy-birthday",
"Lottie Files",
"https://lottiefiles.com"),
Attribution(
AttributionType.Animation,
"Sammie Ho",
"https://lottiefiles.com/62717-confetti",
"Lottie Files",
"https://lottiefiles.com"),
Attribution(
AttributionType.Animation,
"Shlomi Platzman",
"https://lottiefiles.com/24586-gifts-open",
"Lottie Files",
"https://lottiefiles.com"),
];
return Scaffold(
appBar: AppBar(
title: Text("Attributions"),
),
body: SafeArea(
child: ListView.builder(
itemCount: attributions.length,
itemBuilder: (context, index) => Row(
children: [
TextButton(
onPressed: () => launch(attributions[index].url),
child: Text(
describeEnum(attributions[index].type),
),
),
Text("from "),
Text(attributions[index].author),
Text(" by"),
TextButton(
onPressed: () => launch(attributions[index].sourceUrl),
child: Text(attributions[index].source)),
],
)),
),
);
}
}
enum AttributionType { Image, Animation }
class Attribution {
final AttributionType type;
final String author;
final String url;
final String source;
final String sourceUrl;
Attribution(this.type, this.author, this.url, this.source, this.sourceUrl);
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/settings
|
mirrored_repositories/eduserveMinimal/lib/screens/settings/pages/developer.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_launcher/url_launcher.dart';
class Developer extends StatelessWidget {
Developer({Key? key}) : super(key: key);
final Shader linearGradient = LinearGradient(
colors: <Color>[Colors.blueAccent, Colors.lightBlueAccent],
).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0));
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Author"),
centerTitle: true,
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(30.0),
child: Center(
child: CircleAvatar(
radius: 80,
backgroundImage: NetworkImage(
"https://avatars1.githubusercontent.com/u/56349092?s=400&u=bd905296ec34d032c6c6d87f5b89e0f7dc5f0956&v=4"),
backgroundColor: Colors.transparent,
onBackgroundImageError: (_, __) {
Image.asset("assets/placeholder_profile.png");
},
),
),
),
Spacer(),
Text(
"hiruthicSha",
style: GoogleFonts.kanit(
fontSize: 30,
foreground: Paint()..shader = linearGradient,
),
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
icon: Icon(Icons.email),
onPressed: () => launch("mailto:hiruthic@karunya.edu"),
),
SizedBox(width: 10),
Text(
"hiruthic@karunya.edu.in",
style: GoogleFonts.kanit(
fontSize: 25,
),
),
],
),
Spacer(),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.amberAccent,
),
child: Text(
"Request Feature",
style: GoogleFonts.kanit(fontSize: 25, color: Colors.black),
),
onPressed: () => launch(
"https://github.com/hiruthicShaSS/eduserveMinimal/issues/new?assignees=&labels=&template=feature_request.md&title="),
),
Spacer(),
buildSocialIcons()
],
),
),
),
);
}
}
Row buildSocialIcons() {
return Row(
children: [
IconButton(
icon: FaIcon(
FontAwesomeIcons.twitter,
size: 40,
color: Colors.blue,
),
onPressed: () => launch("https://twitter.com/_hiruthicSha"),
tooltip: "Twitter",
),
Spacer(),
IconButton(
icon: FaIcon(
FontAwesomeIcons.linkedin,
size: 40,
color: Colors.blueAccent,
),
onPressed: () => launch("https://in.linkedin.com/in/hiruthicsha/"),
tooltip: "LinkedIn",
),
Spacer(),
IconButton(
icon: FaIcon(
FontAwesomeIcons.github,
size: 40,
color: Colors.black,
),
onPressed: () => launch("https://github.com/hiruthicShaSS"),
tooltip: "GitHub",
),
Spacer(),
IconButton(
icon: FaIcon(
FontAwesomeIcons.globe,
size: 40,
color: Colors.blueAccent,
),
onPressed: () => launch("http://hiruthicsha.com"),
tooltip: "GitHub",
),
],
);
}
| 0
|
mirrored_repositories/eduserveMinimal/lib/screens/settings
|
mirrored_repositories/eduserveMinimal/lib/screens/settings/pages/user.dart
|
// Flutter imports:
import 'dart:math';
import 'package:eduserveMinimal/screens/settings/widgets/semester_summary_graph.dart';
import 'package:eduserveMinimal/service/semester_summary.dart';
import 'package:eduserveMinimal/service/student_info.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// Package imports:
import 'package:fluttertoast/fluttertoast.dart';
import 'package:shimmer/shimmer.dart';
class User extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: getInfo(),
builder: (context, AsyncSnapshot<Map> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
Map data = snapshot.data!;
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Hero(
tag: "hero-userImage",
child: CircleAvatar(
radius: 80,
backgroundImage:
MemoryImage(snapshot.data!["studentIMG"]),
backgroundColor: Colors.transparent,
onBackgroundImageError: (_, __) =>
Image.asset("assets/placeholder_profile.png"),
),
),
InkWell(
child: Image.memory(snapshot.data!["qrImage"]),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => Scaffold(
body: Center(
child: InteractiveViewer(
clipBehavior: Clip.none,
minScale: 1,
maxScale: 4,
child: AspectRatio(
aspectRatio: 1,
child: Image.memory(
snapshot.data!["qrImage"]),
),
),
),
),
),
);
},
),
],
),
Padding(
padding: const EdgeInsets.all(20),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
MainContainer(
title: "Arrears",
data: data["arrears"],
color: int.parse(data["arrears"]) > 0
? Colors.red
: null),
MainContainer(title: "CGPA", data: data["cgpa"]),
MainContainer(title: "SGPA", data: data["sgpa"]),
MainContainer(
title: "CREDITS", data: data["credits"]),
],
),
),
),
UserDetailWidget(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(data['reg'], style: TextStyle(fontSize: 30)),
Text(data['name'], style: TextStyle(fontSize: 20)),
],
),
),
UserDetailWidget(
child: Text(
data['programme'],
style: TextStyle(fontSize: 17),
)),
UserDetailWidget(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
data['kmail'],
style: TextStyle(fontSize: 17),
),
Text(
data['mobile'],
style: TextStyle(fontSize: 17),
),
],
),
IconButton(
onPressed: () {
Clipboard.setData(ClipboardData(
text:
"${data["kmail"]}\n${data["mobile"]}"));
Fluttertoast.showToast(
msg: "Copied to clipboard");
},
icon: Icon(Icons.copy)),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 10, left: 20),
child: Text("Misc", style: TextStyle(fontSize: 25)),
),
UserDetailWidget(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Non Academic Credits : ${data['nonAcademicCredits']}",
style: TextStyle(fontSize: 17),
),
Text(
"Mentor : ${data['mentor']}",
style: TextStyle(fontSize: 17),
),
Text(
"Semester : ${data['semester']}",
style: TextStyle(fontSize: 17),
),
Text(
"Above data represented here are result of ${data['resultOf']}",
style: TextStyle(fontSize: 17),
),
],
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: FutureBuilder(
future: getSemesterSummary(),
builder: (context,
AsyncSnapshot<Map<String, List<String>>>
snapshot) {
if (snapshot.connectionState ==
ConnectionState.done) {
Map data = snapshot.data!;
List<String> months = data["months"];
List<String> arrears = data["arrears"];
List<String> scgpa = data["scgpa"];
List<String> cgpa = data["cgpa"];
return SemesterSummaryGraph(
months: months,
arrears: arrears,
scgpa: scgpa,
cgpa: cgpa);
}
return Shimmer.fromColors(
baseColor: Colors.grey,
highlightColor: Colors.grey[900]!,
child: SemesterSummaryGraph(
months: List.generate(
4,
(index) =>
Random().nextInt(12).toString()),
arrears: List.generate(
4,
(index) =>
Random().nextInt(10).toString()),
scgpa: List.generate(
4,
(index) =>
Random().nextInt(10).toString()),
cgpa: List.generate(
4,
(index) =>
Random().nextInt(10).toString())),
);
}),
),
],
),
),
),
);
}
return Center(child: CircularProgressIndicator());
});
}
}
class UserDetailWidget extends StatelessWidget {
const UserDetailWidget({
Key? key,
required this.child,
}) : super(key: key);
final Widget child;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 10, bottom: 10, right: 20, left: 20),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.transparent.withOpacity(0.1),
borderRadius: BorderRadius.circular(10),
),
child: child,
),
);
}
}
class MainContainer extends StatelessWidget {
const MainContainer({
Key? key,
required this.title,
required this.data,
this.color,
}) : super(key: key);
final String title;
final String? data;
final Color? color;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(10),
child: Container(
padding: EdgeInsets.all(20),
width: 120,
decoration: BoxDecoration(
color: (color ?? Colors.transparent).withOpacity(0.3),
borderRadius: BorderRadius.circular(20),
),
child: Column(
children: [
Text(title, style: TextStyle(fontSize: 20)),
SizedBox(height: 10),
Text(data!),
],
),
),
);
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/providers/app_state.dart
|
// Flutter imports:
import 'package:eduserveMinimal/models/leave.dart';
import 'package:flutter/cupertino.dart';
// Package imports:
import 'package:shared_preferences/shared_preferences.dart';
// Project imports:
import 'package:eduserveMinimal/service/scrap.dart';
class AppState extends ChangeNotifier {
Scraper scraper = Scraper();
static SharedPreferences? prefs;
Map cache = {};
List? attendance = [];
Leave? leaveInfo = Leave();
AppState() {
initPlatformState();
}
Future<void> initPlatformState() async {
prefs = await SharedPreferences.getInstance();
}
}
| 0
|
mirrored_repositories/eduserveMinimal/lib
|
mirrored_repositories/eduserveMinimal/lib/providers/theme.dart
|
// Flutter imports:
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
// Package imports:
import 'package:shared_preferences/shared_preferences.dart';
class ThemeProvider extends ChangeNotifier {
ThemeMode themeMode = ThemeMode.system;
static ThemeData? currentThemeData;
static ThemeMode? currentThemeMode;
static Brightness? platformBrightness;
late SharedPreferences prefs;
static ThemeData dark = ThemeData(
brightness: Brightness.dark,
cardColor: Colors.transparent.withOpacity(0.2),
primaryColor: Colors.deepPurple,
colorScheme: ColorScheme.dark(secondary: Colors.deepPurpleAccent),
textTheme: TextTheme(
bodyText1: TextStyle(
color: Colors.white,
),
bodyText2: TextStyle(
color: Colors.white,
),
),
);
static ThemeData light = ThemeData(
brightness: Brightness.light,
cardColor: Colors.transparent.withOpacity(0.2),
primaryColor: Colors.lightBlueAccent,
colorScheme: ColorScheme.light(secondary: Colors.blueAccent),
textTheme: TextTheme(
bodyText1: TextStyle(
color: Colors.black,
),
bodyText2: TextStyle(
color: Colors.black,
),
),
);
ThemeProvider() {
init();
}
Future<void> init() async {
this.prefs = await SharedPreferences.getInstance();
String? theme = this.prefs.getString("theme");
if (theme == null)
this.themeMode = ThemeMode.system;
else if (theme == "ThemeMode.dark")
this.themeMode = ThemeMode.dark;
else if (theme == "ThemeMode.light") this.themeMode = ThemeMode.light;
currentThemeData = (theme == "ThemeMode.dark" ||
SchedulerBinding.instance!.window.platformBrightness ==
Brightness.dark)
? dark
: light;
platformBrightness = SchedulerBinding.instance!.window.platformBrightness;
// currentThemeData =
// SchedulerBinding.instance!.window.platformBrightness == Brightness.dark
// ? dark
// : light;
currentThemeMode = this.themeMode;
notifyListeners();
}
void setThemeMode(ThemeMode themeMode) {
this.themeMode = themeMode;
currentThemeData = themeMode == ThemeMode.dark ? dark : light;
currentThemeMode = themeMode;
notifyListeners();
this.prefs.setString("theme", themeMode.toString());
}
}
| 0
|
mirrored_repositories/eduserveMinimal
|
mirrored_repositories/eduserveMinimal/test/widget_test.dart
| 0
|
|
mirrored_repositories/dictionary_app
|
mirrored_repositories/dictionary_app/lib/homepage.dart
|
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
final List<Map<String, dynamic>> _allWords = [
{'id': 1, 'name': 'Abate', 'mean': 'v. to diminish in intensity'},
{
'id': 2,
'name': 'Aberrant',
'mean': 'adj. diverging from the standard type'
},
{'id': 3, 'name': 'Abjure', 'mean': 'v. to reject or renounce'},
{
'id': 4,
'name': 'Abscond',
'mean': 'v. to leave secretly, evading detection'
},
{
'id': 5,
'name': 'Abstain',
'mean': 'v. to voluntarily refrain from doing something'
},
{'id': 6, 'name': 'Acumen', 'mean': 'n. keen judgment and perception'},
{'id': 7, 'name': 'Admonish', 'mean': 'v. scold or to advise firmly'},
{
'id': 8,
'name': 'Adulterate',
'mean':
'v. to contaminate or make impure by introducing inferior elements'
},
{
'id': 9,
'name': 'Advocate',
'mean': 'v. to recommend, support, or advise'
},
{
'id': 10,
'name': 'Aesthetic',
'mean': 'adj. concerned with the nature of beauty and art'
},
{
'id': 11,
'name': 'Affectation',
'mean':
'n. fake or artificial behavior, often meant to impress or conceal the truth'
},
{
'id': 12,
'name': 'Aggrandize',
'mean': 'v. enlarge or increase, esp. wealth, power, reputation'
},
{'id': 13, 'name': 'Alacrity', 'mean': 'n. promptness and eagerness'},
{
'id': 14,
'name': 'Alleviate',
'mean': 'v. to relieve a problem or ease a burden'
},
{
'id': 15,
'name': 'Amalgamate',
'mean': 'v. to combine to or mix together'
},
{
'id': 16,
'name': 'Ambiguous',
'mean': 'adj. open to multiple interpretations'
},
{
'id': 17,
'name': 'Ambivalent',
'mean':
'adj. having mixed or contradictory feelings about someone or something'
},
{
'id': 18,
'name': 'Ameliorate',
'mean': 'v. to improve or mitigate a situation'
},
{
'id': 19,
'name': 'Amenable',
'mean': 'adj. easily convinced or persuaded'
},
{
'id': 20,
'name': 'Anachronism',
'mean': 'n. something appearing in a time period where it does not belong'
},
{'id': 21, 'name': 'Analogous', 'mean': 'n. appropriate for analogy'},
{
'id': 22,
'name': 'Anoint',
'mean': 'v. to use oil on a person in a religious ceremony'
},
{'id': 23, 'name': 'Anomaly', 'mean': 'n. an exception or unusual case'},
{'id': 24, 'name': 'Antipathy', 'mean': 'n. strong dislike or hatred'},
{
'id': 25,
'name': 'Antithetical',
'mean': 'adj. contrary to the very nature of'
},
{
'id': 26,
'name': 'Apathy',
'mean': 'n. state of total disinterest or unenthusiasm'
},
{
'id': 27,
'name': 'Appease',
'mean': 'v. to satisfy (an appetite, a need)'
},
{
'id': 28,
'name': 'Arbitrary',
'mean': 'adj. seemingly chosen or designated without reason or purpose'
},
{
'id': 29,
'name': 'Arcane',
'mean': 'adj. secret or known only to a select group'
},
{'id': 30, 'name': 'Archaic', 'mean': 'adj. no longer in the common usage'},
{
'id': 31,
'name': 'Arduous',
'mean': 'adj. difficult, taxing, requiring considerable effort'
},
{
'id': 32,
'name': 'Articulate',
'mean': 'adj. exhibiting considerable communication skills, well-spoken'
},
{'id': 33, 'name': 'Artless', 'mean': 'adj. natural, untrained'},
{'id': 34, 'name': 'Ascetic', 'mean': 'adj. austere or self-denying'},
{
'id': 35,
'name': 'Assuage',
'mean': 'v. to provide relief from an unpleasant feeling'
},
{'id': 36, 'name': 'Astonishment', 'mean': 'n. total surprise, shock'},
{'id': 37, 'name': 'Audacious', 'mean': 'adj. very bold or presumptuous'},
{'id': 38, 'name': 'Austere', 'mean': 'adj. severe, unadorned'},
{'id': 39, 'name': 'Avarice', 'mean': 'n. greed'},
{'id': 40, 'name': 'Aver', 'mean': 'v. to assert or allege'},
{'id': 41, 'name': 'Banal', 'mean': 'adj. boring, cliché'},
{
'id': 42,
'name': 'Belie',
'mean':
'v. give a false impression (intentional or unintentional) in word, appearance, or deed'
},
{'id': 43, 'name': 'Benign', 'mean': 'adj. gentle, harmless'},
{
'id': 44,
'name': 'Biased',
'mean': 'adj. prejudiced, displaying partiality'
},
{'id': 45, 'name': 'Bolster', 'mean': 'v. to shore up or support'},
{'id': 46, 'name': 'Bombastic', 'mean': 'adj. overblown, theatrical'},
{
'id': 47,
'name': 'Brazen',
'mean': 'adj. bold or open to the point of shocking / shameless'
},
{'id': 48, 'name': 'Bucolic', 'mean': 'adj. pastoral, rustic, countryfied'},
{
'id': 49,
'name': 'Burgeon',
'mean': 'v. flourish, bloom, expand or increase quickly'
},
{'id': 50, 'name': 'Cacophony', 'mean': 'n. loud and chaotic noise'},
{'id': 51, 'name': 'Calumny', 'mean': 'n. lie or slander'},
{'id': 52, 'name': 'Candid', 'mean': 'adj. honest, open'},
{
'id': 53,
'name': 'Canon',
'mean':
'n. sacred works/scripture; in this sense it is also used to refer to notable literary and artistic works of a culture or discipline'
},
{
'id': 54,
'name': 'Capacity',
'mean':
'n. the capability to perform a particular action or fulfill a given function'
},
{
'id': 55,
'name': 'Capricious',
'mean': 'adj. mercurial, unpredictable, whimsical'
},
{'id': 56, 'name': 'Castigate', 'mean': 'v. to scold or berate strongly'},
{
'id': 57,
'name': 'Catalyst',
'mean': 'n. something that speeds up a process or causes action'
},
{'id': 58, 'name': 'Caustic', 'mean': 'adj. bitterly sarcastic'},
{'id': 59, 'name': 'Censure', 'mean': 'v. to express intense condemnation'},
{
'id': 60,
'name': 'Chauvinist',
'mean':
'n. someone who believes prejudicially that their own group is the superior one'
},
{'id': 61, 'name': 'Chicanery', 'mean': 'n. trickery or deception'},
{'id': 62, 'name': 'Chronological', 'mean': 'adj. ordered by time'},
{
'id': 63,
'name': 'Coalesce',
'mean': 'v. to come together, esp. from disparate parts'
},
{
'id': 64,
'name': 'Cogent',
'mean': 'adj. clearly laid out and persuasive'
},
{
'id': 65,
'name': 'Commensurate',
'mean': 'adj. in accordance with, proportional'
},
{'id': 66, 'name': 'Compelling', 'mean': 'adj. captivating'},
{'id': 67, 'name': 'Comprehensive', 'mean': 'adj. complete and thorough'},
{'id': 68, 'name': 'Condone', 'mean': 'v. to approve or allow'},
{'id': 69, 'name': 'Confound', 'mean': 'v. to confuse or astonish'},
{
'id': 70,
'name': 'Connoisseur',
'mean':
'n. an expert in a particular subject matter area, usually relating to the fine arts or cultural pursuits'
},
{'id': 71, 'name': 'Consequential', 'mean': 'adj. as a result of'},
{'id': 72, 'name': 'Construe', 'mean': 'v. to interpret'},
{
'id': 73,
'name': 'Consumption',
'mean': 'n. utilization (esp. of a resource)'
},
{'id': 74, 'name': 'Contend', 'mean': 'v. assert or claim'},
{'id': 75, 'name': 'Contentious', 'mean': 'adj. involving conflict'},
{'id': 76, 'name': 'Contrite', 'mean': 'adj. remorseful'},
{
'id': 77,
'name': 'Convoluted',
'mean': 'adj. roundabout, not straightforward'
},
{'id': 78, 'name': 'Copious', 'mean': 'adj. plentiful or abundant'},
{
'id': 79,
'name': 'Cosmopolitan',
'mean': 'adj. of or relating to a city or urban area'
},
{
'id': 80,
'name': 'Covet',
'mean': 'v. to desire something that does not belong to you'
},
{'id': 81, 'name': 'craft', 'mean': 'n. cunning'},
{
'id': 82,
'name': 'craven',
'mean': 'adj. cowardly to the point of being shameful'
},
{'id': 83, 'name': 'credence', 'mean': 'n. belief or trust'},
{'id': 84, 'name': 'credulous', 'mean': 'adj. gullible, naïve'},
{
'id': 85,
'name': 'decorum',
'mean': 'n. appropriate behavior or good manners'
},
{'id': 86, 'name': 'deference', 'mean': 'n. respect or polite submission'},
{'id': 87, 'name': 'deflect', 'mean': 'v. divert or cause to ricochet'},
{'id': 88, 'name': 'deftness', 'mean': 'adj. skill, acumen'},
{
'id': 89,
'name': 'delineate',
'mean': 'v. to clearly demarcate a boundary'
},
{'id': 90, 'name': 'demur', 'mean': 'v. to object or raise concerns'},
{
'id': 91,
'name': 'denigrate',
'mean': 'v. say negative things about, particularly in a defamatory way'
},
{'id': 92, 'name': 'deride', 'mean': 'v. to mock or ridicule'},
{
'id': 93,
'name': 'derivative',
'mean':
'adj. imitates another work in a way that is unoriginal or uninspiring'
},
{
'id': 94,
'name': 'desiccate',
'mean': 'v. to suck out the vitality and passion'
},
{'id': 95, 'name': 'desultory', 'mean': 'adj. inconsistent or random'},
{'id': 96, 'name': 'detachment', 'mean': 'n. objectivity or aloofness'},
{
'id': 97,
'name': 'determinant',
'mean': 'n. a strong factor in an outcome'
},
{
'id': 98,
'name': 'diatribe',
'mean': 'n. a rant or angry speech denouncing someone or something'
},
{
'id': 99,
'name': 'didactic',
'mean':
'adj. educational or with an instructive purpose; often includes an element of moralizing'
},
{
'id': 100,
'name': 'diffident',
'mean': 'adj. shy, timid, or reserved due to a lack of confidence'
},
{
'id': 101,
'name': 'dilettante',
'mean': 'n. someone with an amateur, nonserious interest in something'
},
{'id': 102, 'name': 'dirge', 'mean': 'n. funeral or mourning lament'},
{
'id': 103,
'name': 'disabuse',
'mean':
'v. to dispel someone’s illusions or false impressions about something'
},
{'id': 104, 'name': 'discern', 'mean': 'v. to perceive'},
{'id': 105, 'name': 'discrepancy', 'mean': 'n. inconsistency'},
{
'id': 106,
'name': 'disinterested',
'mean': 'adj. not invested in the outcome'
},
{'id': 107, 'name': 'disparage', 'mean': 'v. to belittle'},
{
'id': 108,
'name': 'disparate',
'mean': 'adj. dissimilar to such a degree that comparison is not possible'
},
{'id': 109, 'name': 'dispassionate', 'mean': 'adj. impartial or cool'},
{
'id': 110,
'name': 'disregard',
'mean': 'v. to ignore or pay no attention to'
},
{
'id': 111,
'name': 'dissemble',
'mean':
'v. to mislead or conceal the truth, esp. with respect to one’s motives'
},
{
'id': 112,
'name': 'disseminate',
'mean': 'v. to spread widely (esp. information)'
},
{
'id': 113,
'name': 'dissonance',
'mean': 'n. a clash between two elements that don’t blend well'
},
{
'id': 114,
'name': 'diverge',
'mean': 'v. to split apart, esp. a road or path'
},
{
'id': 115,
'name': 'dogma',
'mean': 'n. the official beliefs or tenets of particular sect or group'
},
{'id': 116, 'name': 'dupe', 'mean': 'v. to deceive or fool'},
{
'id': 117,
'name': 'ebullient',
'mean': 'adj. cheerful, enthusiastic, excited'
},
{'id': 118, 'name': 'eccentric', 'mean': 'adj. quirky or unusual'},
{
'id': 119,
'name': 'eclectic',
'mean': 'adj. composed of a variety of styles, themes, motifs, etc.'
},
{'id': 120, 'name': 'efficacy', 'mean': 'n. effectiveness'},
{
'id': 121,
'name': 'elegy',
'mean': 'n. sad poem or song, often in remembrance of someone deceased'
},
{'id': 122, 'name': 'elicit', 'mean': 'v. to provoke a response'},
{
'id': 123,
'name': 'eloquence',
'mean': 'adj. persuasive and articulate speech'
},
{
'id': 124,
'name': 'eminent',
'mean': 'adj. well-known, respected, distinguished'
},
{'id': 125, 'name': 'empirical', 'mean': 'adj. based on evidence'},
{
'id': 126,
'name': 'emulate',
'mean': 'v. to imitate or attempt to equal in accomplishment'
},
{'id': 127, 'name': 'enervate', 'mean': 'v. to exhaust or drain of energy'},
{'id': 128, 'name': 'engender', 'mean': 'v. to cause or give rise to'},
{'id': 129, 'name': 'enhance', 'mean': 'v. intensify, increase, augment'},
{
'id': 130,
'name': 'entitlement',
'mean': 'n. belief that one deserves things one has not earned'
},
{'id': 131, 'name': 'ephemeral', 'mean': 'adj. short-lived or transient'},
{
'id': 132,
'name': 'equable',
'mean': 'adj. not given to much change or variation'
},
{
'id': 133,
'name': 'equivocate',
'mean': 'v. to use ambiguous language in order to mislead or deceive'
},
{'id': 134, 'name': 'erroneous', 'mean': 'adj. incorrect'},
{'id': 135, 'name': 'erudite', 'mean': 'adj. learned'},
{'id': 136, 'name': 'eschew', 'mean': 'v. avoid or abstain from'},
{'id': 137, 'name': 'esoteric', 'mean': 'adj. obscure, arcane'},
{
'id': 138,
'name': 'estimable',
'mean': 'adj. deserving respect, esteem, and admiration'
},
{
'id': 139,
'name': 'eulogy',
'mean':
'n. memorial speech for one who has passed, normally given at a funeral'
},
{'id': 140, 'name': 'exacerbate', 'mean': 'v. to make worse'},
{
'id': 141,
'name': 'exacting',
'mean': 'adj. challenging, demanding, grueling'
},
{'id': 142, 'name': 'exculpate', 'mean': 'v. to exonerate or vindicate'},
{'id': 143, 'name': 'exigent', 'mean': 'adj. urgent or pressing'},
{
'id': 144,
'name': 'exonerate',
'mean': 'v. to clear of charges of wrongdoing'
},
{
'id': 145,
'name': 'expatiate',
'mean': 'v. to elaborate on something in great detail'
},
{'id': 146, 'name': 'explicate', 'mean': 'v. to explain in detail'},
{'id': 147, 'name': 'exposition', 'mean': 'n. a thorough explanation'},
{'id': 148, 'name': 'extraneous', 'mean': 'adj. irrelevant or superfluous'},
{
'id': 149,
'name': 'extrapolate',
'mean':
'v. to estimate or conjecture about the future based on presently available information or facts'
},
{'id': 150, 'name': 'facetious', 'mean': 'adj. glib or flippant'},
{
'id': 151,
'name': 'facilitate',
'mean': 'v. to make something easier or simpler'
},
{
'id': 152,
'name': 'fallacious',
'mean': 'adj. relying on a fallacy and thus incorrect/misinformed'
},
{'id': 153, 'name': 'fastidious', 'mean': 'adj. invested in cleanliness'},
{
'id': 154,
'name': 'fluctuate',
'mean': 'v. to shift without apparent pattern'
},
{'id': 155, 'name': 'foment', 'mean': 'v. to foster unrest or discontent'},
{
'id': 156,
'name': 'forestall',
'mean': 'v. to hold off or try to prevent'
},
{'id': 157, 'name': 'fortuitous', 'mean': 'adj. fortunate and lucky'},
{'id': 158, 'name': 'frugal', 'mean': 'adj. economical, thrifty'},
{'id': 159, 'name': 'gainsay', 'mean': 'v. deny or oppose'},
{'id': 160, 'name': 'galvanize', 'mean': 'v. to prod someone into action'},
{'id': 161, 'name': 'garrulous', 'mean': 'adj. talkative'},
{
'id': 162,
'name': 'gauche',
'mean': 'adj. socially inept, inappropriate, or awkward'
},
{
'id': 163,
'name': 'germane',
'mean': 'adj. relevant to the matter at hand'
},
{
'id': 164,
'name': 'glib',
'mean': 'adj. talking volubly, but carelessly or insincerely'
},
{'id': 165, 'name': 'gregarious', 'mean': 'adj. sociable, genial'},
{'id': 166, 'name': 'guile', 'mean': 'n. craftiness and cunning'},
{'id': 167, 'name': 'hackneyed', 'mean': 'adj. cliché, trite, banal'},
{'id': 168, 'name': 'harangue', 'mean': 'n. diatribe or rant'},
{'id': 169, 'name': 'hedonism', 'mean': 'n. the pursuit of pleasure'},
{
'id': 170,
'name': 'hierarchical',
'mean': 'adj. arranged in rank order or hierarchy'
},
{'id': 171, 'name': 'homogenous', 'mean': 'adj. uniform, identical'},
{
'id': 172,
'name': 'hyperbole',
'mean': 'n. obvious exaggeration for effect'
},
{
'id': 173,
'name': 'iconoclast',
'mean':
'n. a person who attacks traditional religious and cultural institutions'
},
{
'id': 174,
'name': 'ideological',
'mean': 'adj. relating to a particular belief system or theory'
},
{'id': 175, 'name': 'imminent', 'mean': 'adj. about to happen'},
{'id': 176, 'name': 'immutable', 'mean': 'adj. unchangeable'},
{
'id': 177,
'name': 'impair',
'mean': 'v. to hinder or weaken someone or something'
},
{
'id': 178,
'name': 'impediment',
'mean': 'n. barrier, hindrance, or obstruction'
},
{
'id': 179,
'name': 'imperturbable',
'mean': 'adj. remaining calm under any circumstance'
},
{'id': 180, 'name': 'implacable', 'mean': 'adj. relentless'},
{
'id': 181,
'name': 'implicit',
'mean': 'adj. implied or insinuated without being directly stated'
},
{'id': 182, 'name': 'imprudence', 'mean': 'n. bad judgment'},
{'id': 183, 'name': 'impudent', 'mean': 'adj. disrespectful'},
{
'id': 184,
'name': 'inadvertent',
'mean': 'adj. by accident or unintentional'
},
{
'id': 185,
'name': 'Inchoate',
'mean': 'adj. rudimentary, in the beginning stages'
},
{
'id': 186,
'name': 'inconclusive',
'mean': 'adj. indeterminate or unresolved'
},
{
'id': 187,
'name': 'indebted',
'mean': 'adj. owing gratitude to someone or something'
},
{'id': 188, 'name': 'indefatigable', 'mean': 'adj. cannot be made tired'},
{'id': 189, 'name': 'indolent', 'mean': 'adj. lazy'},
{
'id': 190,
'name': 'infer',
'mean':
'v. to conclude from implicit evidence (as opposed to explicit facts)'
},
{'id': 191, 'name': 'ingenuous', 'mean': 'adj. naïve or innocent'},
{'id': 192, 'name': 'inimical', 'mean': 'adj. harmful or hostile'},
{'id': 193, 'name': 'Innocuous', 'mean': 'adj. harmless'},
{
'id': 194,
'name': 'inscrutable',
'mean': 'adj. enigmatic, incomprehensible'
},
{'id': 195, 'name': 'insipid', 'mean': 'adj. bland, uninspired, inane'},
{
'id': 196,
'name': 'insular',
'mean':
'adj. tight-knit and isolated; uninterested in matters outside one’s immediate sphere'
},
{'id': 197, 'name': 'intensive', 'mean': 'adj. concentrated and in-depth'},
{'id': 198, 'name': 'intermediary', 'mean': 'n. a go-between'},
{'id': 199, 'name': 'intimate', 'mean': 'adj. particularly private'},
{'id': 200, 'name': 'intractable', 'mean': 'adj. stubborn or obstinate'},
{
'id': 201,
'name': 'intransigent',
'mean': 'adj. uncompromising, obstinate'
},
{'id': 202, 'name': 'intrepid', 'mean': 'adj. bold and adventurous'},
{'id': 203, 'name': 'inveterate', 'mean': 'adj. ingrained, habitual'},
{
'id': 204,
'name': 'invulnerable',
'mean': 'adj. indestructible, impervious to harm'
},
{'id': 205, 'name': 'irascible', 'mean': 'adj. irritable, testy, touchy'},
{'id': 206, 'name': 'irresolute', 'mean': 'adj. wishy-washy, hesitant'},
{'id': 207, 'name': 'laconic', 'mean': 'adj. taciturn, reserved, succinct'},
{'id': 208, 'name': 'laud', 'mean': 'v. to praise'},
{'id': 209, 'name': 'laudable', 'mean': 'adj. praiseworthy'},
{'id': 210, 'name': 'litigation', 'mean': 'n. legal proceedings'},
{'id': 211, 'name': 'loquacious', 'mean': 'adj. talkative'},
{'id': 212, 'name': 'lucid', 'mean': 'adj. clear and coherent'},
{'id': 213, 'name': 'luminous', 'mean': 'adj. full of light'},
{
'id': 214,
'name': 'magnanimity',
'mean': 'n. generosity and nobility of spirit'
},
{'id': 215, 'name': 'maladroit', 'mean': 'adj. clumsy, awkward, inept'},
{'id': 216, 'name': 'malign', 'mean': 'adj. evil or harmful'},
{'id': 217, 'name': 'malleable', 'mean': 'adj. easily influenced'},
{'id': 218, 'name': 'maverick', 'mean': 'n. an unorthodox person or rebel'},
{'id': 219, 'name': 'mendacity', 'mean': 'n. untruthfulness, dishonesty'},
{'id': 220, 'name': 'mercurial', 'mean': 'adj. easily changeable, fickle'},
{
'id': 221,
'name': 'meticulous',
'mean': 'adj. paying close attention to detail'
},
{'id': 222, 'name': 'misanthrope', 'mean': 'n. person who hates humanity'},
{
'id': 223,
'name': 'mitigate',
'mean': 'v. to improve a painful, unpleasant, or negative situation'
},
{'id': 224, 'name': 'modest', 'mean': 'adj. not overly showy'},
{'id': 225, 'name': 'mollify', 'mean': 'v. placate'},
{'id': 226, 'name': 'monotony', 'mean': 'n. boredom and repetition'},
{'id': 227, 'name': 'mundane', 'mean': 'adj. everyday, boring'},
{'id': 228, 'name': 'munificent', 'mean': 'adj. very generous'},
{'id': 229, 'name': 'naïve', 'mean': 'adj. inexperienced or gullible'},
{
'id': 230,
'name': 'nascent',
'mean': 'adj. just beginning or in the early stages'
},
{
'id': 231,
'name': 'neglect',
'mean': 'v. to abandon or leave uncared-for'
},
{'id': 232, 'name': 'nonplussed', 'mean': 'adj. confused and baffled'},
{
'id': 233,
'name': 'notoriety',
'mean': 'n. fame for doing something negative or criminal'
},
{'id': 234, 'name': 'nuance', 'mean': 'n. subtle shades of difference'},
{'id': 235, 'name': 'obdurate', 'mean': 'adj. stubborn, obstinate'},
{'id': 236, 'name': 'obscure', 'mean': 'adj. mysterious or not well-known'},
{
'id': 237,
'name': 'obsequious',
'mean': 'adj. overly fawning and helpful in a way that is disingenuous'
},
{'id': 238, 'name': 'obstinate', 'mean': 'adj. stubborn, uncompromising'},
{'id': 239, 'name': 'obviate', 'mean': 'v. to prevent'},
{'id': 240, 'name': 'occlude', 'mean': 'v. to block or obstruct'},
{'id': 241, 'name': 'occult', 'mean': 'n. the mystical and supernatural'},
{'id': 242, 'name': 'offset', 'mean': 'v. to counterbalance or counteract'},
{
'id': 243,
'name': 'olfactory',
'mean': 'adj. relating to smell or the sense of smell'
},
{
'id': 244,
'name': 'omniscience',
'mean': 'n. the quality or state of being all-knowing'
},
{'id': 245, 'name': 'onerous', 'mean': 'adj. difficult or burdensome'},
{
'id': 246,
'name': 'opaque',
'mean': 'adj. not see-through; blocking light'
},
{
'id': 247,
'name': 'opportunism',
'mean':
'n. the practice of taking advantage of opportunities as they arise without particular concern for morality or ethics'
},
{'id': 248, 'name': 'opprobrium', 'mean': 'n. criticism or condemnation'},
{
'id': 249,
'name': 'oscillate',
'mean':
'v. to swing back and forth between two points, poles, or positions'
},
{
'id': 250,
'name': 'ostentatious',
'mean': 'adj. overly showy in a way that is gaudy or vulgar'
},
{'id': 251, 'name': 'outstrip', 'mean': 'v. to overtake or outrun'},
{'id': 252, 'name': 'overshadow', 'mean': 'v. to appear more notable than'},
{
'id': 253,
'name': 'painstaking',
'mean': 'adj. attentive to detail, meticulous'
},
{'id': 254, 'name': 'partial', 'mean': 'adj. incomplete'},
{
'id': 255,
'name': 'partisan',
'mean': 'n. a devoted supporter of a group, cause, or person'
},
{'id': 256, 'name': 'patent', 'mean': 'adj. blatant, obvious'},
{'id': 257, 'name': 'paucity', 'mean': 'n. scarcity, poverty'},
{
'id': 258,
'name': 'pedantic',
'mean': 'adj. overly concerned with irrelevant detail, fussy'
},
{
'id': 259,
'name': 'pedestrian',
'mean': 'adj. boring, monotonous, run-of-the-mill'
},
{'id': 260, 'name': 'perfidy', 'mean': 'n. treachery or deceit'},
{
'id': 261,
'name': 'perfunctory',
'mean': 'adj. done without much effort, care, or thought'
},
{
'id': 262,
'name': 'peripheral',
'mean': 'adj. on the edge or periphery; not centrally important'
},
{
'id': 263,
'name': 'permeate',
'mean': 'v. to pervade or penetrate throughout'
},
{
'id': 264,
'name': 'perseverance',
'mean': 'n. persistence in the face of obstacles'
},
{
'id': 265,
'name': 'peruse',
'mean': 'v. to read something informally or quickly'
},
{
'id': 266,
'name': 'pervasive',
'mean':
'adj. found everywhere, widespread; often has a negative connotation'
},
{'id': 267, 'name': 'phenomena', 'mean': 'n. things that happen'},
{'id': 268, 'name': 'phlegmatic', 'mean': 'adj. cool and unruffled'},
{
'id': 269,
'name': 'pith',
'mean': 'n. the essential substance of something'
},
{
'id': 270,
'name': 'placate',
'mean': 'v. to calm, esp. an angry or upset person'
},
{'id': 271, 'name': 'plastic', 'mean': 'adj. easily shaped or molded'},
{'id': 272, 'name': 'platitude', 'mean': 'n. a trite or cliché statement'},
{'id': 273, 'name': 'plausible', 'mean': 'adj. believable, reasonable'},
{
'id': 274,
'name': 'plethora',
'mean': 'n. a surplus or overabundance of something'
},
{'id': 275, 'name': 'plummet', 'mean': 'v. to fall quickly and far'},
{
'id': 276,
'name': 'polarize',
'mean': 'v. to cause a sharp division between two groups'
},
{
'id': 277,
'name': 'polemical',
'mean': 'adj. angry, hostile, harshly critical'
},
{'id': 278, 'name': 'pragmatic', 'mean': 'adj. practical'},
{'id': 279, 'name': 'precarious', 'mean': 'adj. uncertain or unstable'},
{'id': 280, 'name': 'preceded', 'mean': 'adj. went before'},
{
'id': 281,
'name': 'precipitate',
'mean': 'n. particulate matter formed within a solution'
},
{'id': 282, 'name': 'precursor', 'mean': 'n. a forerunner'},
{
'id': 283,
'name': 'prescient',
'mean': 'adj. knowing things before they happen, prophetic'
},
{
'id': 284,
'name': 'presumptuous',
'mean': 'adj. overly familiar; invades social boundaries'
},
{'id': 285, 'name': 'prevail', 'mean': 'v. to convince or persuade'},
{
'id': 286,
'name': 'prevaricate',
'mean': 'v. to evade or deceive without outright lying'
},
{'id': 287, 'name': 'pristine', 'mean': 'adj. untouched, clean, pure'},
{'id': 288, 'name': 'probity', 'mean': 'n. integrity and honor'},
{'id': 289, 'name': 'prodigal', 'mean': 'n. a reckless spender'},
{
'id': 290,
'name': 'prodigious',
'mean': 'adj. enormous, immense, gigantic'
},
{
'id': 291,
'name': 'profligate',
'mean': 'adj. extravagant and wasteful, esp. in an immoral way'
},
{
'id': 292,
'name': 'proliferate',
'mean': 'v. to multiply and spread rapidly'
},
{
'id': 293,
'name': 'propitiate',
'mean': 'v. to appease someone who is angry'
},
{
'id': 294,
'name': 'propriety',
'mean': 'n. appropriateness, manners, decorum'
},
{'id': 295, 'name': 'prospective', 'mean': 'adj. applicable to the future'},
{'id': 296, 'name': 'qualification', 'mean': 'n. a modifying statement'},
{
'id': 297,
'name': 'quotidian',
'mean': 'adj. relating to the everyday or mundane'
},
{
'id': 298,
'name': 'rationalize',
'mean':
'v. to attempt to justify with reasons that are only superficially valid'
},
{'id': 299, 'name': 'reconcile', 'mean': 'v. to repair a relationship'},
{'id': 300, 'name': 'recondite', 'mean': 'adj. arcane or obscure'},
{'id': 301, 'name': 'refute', 'mean': 'v. to rebut or disprove'},
{'id': 302, 'name': 'relentless', 'mean': 'adj. never stopping, constant'},
{
'id': 303,
'name': 'relevant',
'mean': 'adj. relating to the topic or issue at hand'
},
{'id': 304, 'name': 'reproach', 'mean': 'v. to scold or express criticism'},
{'id': 305, 'name': 'repudiate', 'mean': 'v. to renounce or disown'},
{
'id': 306,
'name': 'rescind',
'mean': 'v. to take back or retract (an offer or statement)'
},
{
'id': 307,
'name': 'respectively',
'mean': 'adv. in the sequential order previously given'
},
{'id': 308, 'name': 'reticent', 'mean': 'adj. introverted or silent'},
{'id': 309, 'name': 'reverent', 'mean': 'adj. solemn and respectful'},
{
'id': 310,
'name': 'rhetoric',
'mean': 'n. the art of effective communication (written or verbal)'
},
{'id': 311, 'name': 'salubrious', 'mean': 'adj. health-promoting'},
{
'id': 312,
'name': 'sanction',
'mean': 'n. punishments imposed for breaking a regulation'
},
{
'id': 313,
'name': 'satiate',
'mean': 'v. to completely satisfy (with respect to hunger or appetite)'
},
{
'id': 314,
'name': 'secular',
'mean':
'adj. of or relating to the world or worldly matters (as opposed to religious ones)'
},
{
'id': 315,
'name': 'sediment',
'mean': 'n. material that settles at the bottom of a body of water'
},
{'id': 316, 'name': 'sedulous', 'mean': 'adj. dedicated and careful'},
{
'id': 317,
'name': 'simultaneous',
'mean': 'adj. occurring at the same moment'
},
{'id': 318, 'name': 'solicitous', 'mean': 'adj. considerate, attentive'},
{'id': 319, 'name': 'soporific', 'mean': 'adj. makes sleepy'},
{'id': 320, 'name': 'sparse', 'mean': 'adj. scattered or scarce'},
{
'id': 321,
'name': 'specious',
'mean': 'adj. spurious; appearing true but actually false'
},
{'id': 322, 'name': 'sporadic', 'mean': 'adj. occasional or scattered'},
{'id': 323, 'name': 'spurious', 'mean': 'adj. fake or false'},
{'id': 324, 'name': 'stolid', 'mean': 'adj. calm and dependable'},
{
'id': 325,
'name': 'subjective',
'mean':
'adj. open to personal interpretation; not based in objective fact'
},
{
'id': 326,
'name': 'substantiate',
'mean': 'v. to corroborate or give evidence of something'
},
{
'id': 327,
'name': 'subversive',
'mean': 'adj. meant to undercut established institutions or norms'
},
{
'id': 328,
'name': 'sufficient',
'mean': 'adj. enough for a given purpose'
},
{'id': 329, 'name': 'superbly', 'mean': 'adv. excellently'},
{
'id': 330,
'name': 'supine',
'mean':
'adj. laying back with the face upward (opposite position to prone)'
},
{'id': 331, 'name': 'supplant', 'mean': 'v. to overtake or replace'},
{'id': 332, 'name': 'sycophant', 'mean': 'n. a fawning, insincere admirer'},
{
'id': 333,
'name': 'synthesize',
'mean': 'v. to combine disparate parts into a coherent whole'
},
{'id': 334, 'name': 'tacit', 'mean': 'adj. unspoken; implicit'},
{
'id': 335,
'name': 'taciturn',
'mean': 'adj. reticent or reserved; tending towards silence'
},
{
'id': 336,
'name': 'temperance',
'mean':
'n. moderation and restraint, sometimes used to specifically describe abstinence from alcohol'
},
{'id': 337, 'name': 'tenuous', 'mean': 'adj. weak, flimsy, insubstantial'},
{'id': 338, 'name': 'timorous', 'mean': 'adj. meek or timid'},
{'id': 339, 'name': 'tirade', 'mean': 'n. an angry rant'},
{'id': 340, 'name': 'torpor', 'mean': 'n. tiredness, lethargy'},
{'id': 341, 'name': 'tortuous', 'mean': 'adj. complicated'},
{
'id': 342,
'name': 'tractable',
'mean': 'adj. can be easily influenced or managed'
},
{
'id': 343,
'name': 'transient',
'mean': 'adj. passes quickly; short-lived'
},
{'id': 344, 'name': 'ubiquitous', 'mean': 'adj. ever-present or universal'},
{'id': 345, 'name': 'unadorned', 'mean': 'adj. plain; unembellished'},
{'id': 346, 'name': 'undermine', 'mean': 'v. to weaken or compromise'},
{'id': 347, 'name': 'underscore', 'mean': 'v. to emphasize'},
{
'id': 348,
'name': 'untenable',
'mean':
'adj. weak or unsupportable, esp. with respect to an opinion or situation'
},
{
'id': 349,
'name': 'vacillate',
'mean': 'v. to shift between multiple options or opinions'
},
{
'id': 350,
'name': 'venality',
'mean': 'n. the state of being capable of being bribed'
},
{
'id': 351,
'name': 'venerate',
'mean': 'v. to give a high degree of respect; may border on worship'
},
{'id': 352, 'name': 'veracity', 'mean': 'n. Truth and factual accuracy'},
{'id': 353, 'name': 'verbose', 'mean': 'adj. long-winded; loquacious'},
{
'id': 354,
'name': 'vexation',
'mean': 'n. state of being frustrated, irritated, or concerned.'
},
{
'id': 355,
'name': 'volatile',
'mean': 'adj. easily changeable or extreme; unstable'
},
{'id': 356, 'name': 'whimsical', 'mean': 'adj. fanciful or capricious'},
{'id': 357, 'name': 'zeal', 'mean': 'n. passion or fervor'},
];
List<Map<String, dynamic>> _foundWords = [];
@override
void initState() {
// TODO: implement initState
super.initState();
_foundWords = _allWords;
}
void _filter(String key) {
List<Map<String, dynamic>> results = [];
if (key.isEmpty) {
results = _allWords;
} else {
results = _allWords
.where((element) =>
element['name'].toLowerCase().contains(key.toLowerCase()))
.toList();
}
setState(() {
_foundWords = results;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.yellow.shade500,
appBar: AppBar(
backgroundColor: Colors.lightBlueAccent.shade400,
title: Text(
'GRE Vocabulary Application',
style: const TextStyle(
fontStyle: FontStyle.italic,
color: Colors.black,
fontWeight: FontWeight.bold,
letterSpacing: 1),
),
centerTitle: true,
),
body: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
children: [
TextField(
onChanged: (value) => _filter(value),
cursorColor: Colors.white,
decoration: const InputDecoration(
labelText: 'Search...',
labelStyle: TextStyle(
color: Colors.black,
letterSpacing: 3,
fontWeight: FontWeight.bold,
fontSize: 17),
suffixIcon: Icon(
Icons.search,
color: Colors.black,
),
icon: Icon(
Icons.list,
color: Colors.black,
)),
),
const SizedBox(
height: 5,
),
Expanded(
child: _foundWords.isNotEmpty
? ListView.builder(
itemCount: _foundWords.length,
itemBuilder: (context, index) {
return Card(
key: ValueKey(_foundWords[index]['id']),
color: Colors.lightBlueAccent.shade200,
elevation: 4,
margin: const EdgeInsets.symmetric(vertical: 10),
child: ListTile(
leading: const Icon(
Icons.stacked_line_chart,
color: Colors.black,
),
title: Text(
_foundWords[index]['name'],
style: const TextStyle(
fontWeight: FontWeight.bold,
letterSpacing: 1,
color: Colors.black,
fontSize: 18),
),
subtitle: Text(_foundWords[index]['mean'],
style: const TextStyle(
fontWeight: FontWeight.bold,
letterSpacing: 1,
color: Colors.black,
fontSize: 16)),
trailing: Text(
_allWords[index]['id'].toString(),
style: const TextStyle(
fontWeight: FontWeight.bold,
letterSpacing: 1,
color: Colors.black,
fontSize: 15,
backgroundColor: Colors.white)),
),
);
})
: const Center(
child: Text('Nothing Found'),
))
],
),
));
}
}
| 0
|
mirrored_repositories/dictionary_app
|
mirrored_repositories/dictionary_app/lib/main.dart
|
import 'package:flutter/material.dart';
import 'homepage.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage()
);
}
}
| 0
|
mirrored_repositories/dictionary_app
|
mirrored_repositories/dictionary_app/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vocabulary_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Irregular-Verb-Flutter-Apps
|
mirrored_repositories/Irregular-Verb-Flutter-Apps/lib/word.dart
|
import 'package:json_annotation/json_annotation.dart';
part 'word.g.dart';
@JsonSerializable()
class Word{
Word(this.base, this.pastSimple, this.pastPaticiple);
@JsonKey(name: 'Base')
String base;
@JsonKey(name: 'Past-simple')
String pastSimple;
@JsonKey(name: 'Past-Participle')
String pastPaticiple;
factory Word.fromJson(Map<String, dynamic> json) => _$WordFromJson(json);
Map<String, dynamic> toJson() => _$WordToJson(this);
}
| 0
|
mirrored_repositories/Irregular-Verb-Flutter-Apps
|
mirrored_repositories/Irregular-Verb-Flutter-Apps/lib/word.g.dart
|
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'word.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Word _$WordFromJson(Map<String, dynamic> json) => Word(
json['Base'] as String,
json['Past-simple'] as String,
json['Past-Participle'] as String,
);
Map<String, dynamic> _$WordToJson(Word instance) => <String, dynamic>{
'Base': instance.base,
'Past-simple': instance.pastSimple,
'Past-Participle': instance.pastPaticiple,
};
| 0
|
mirrored_repositories/Irregular-Verb-Flutter-Apps
|
mirrored_repositories/Irregular-Verb-Flutter-Apps/lib/main.dart
|
import 'dart:convert';
import 'package:flutter/material.dart';
import 'dart:async' show Future;
import 'package:irregular_verbs/word.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.orange,
),
home: Scaffold(
// appBar: AppBar(
// title: Text('Irregular Verbs List'),
// ),
body: IrregularVerbsList(),
),
);
}
}
class IrregularVerbsList extends StatefulWidget{
@override
State<StatefulWidget> createState() {
return _IrregularVerbsState();
}
}
class _IrregularVerbsState extends State<IrregularVerbsList>{
List _irrVerbList = <Word>[]; // Create a array list of type Word
final _savedList = <String>{}; // Create a Set of type String
final _biggerFont = const TextStyle(fontSize: 18);
late ListView listView;
@override
Widget build(BuildContext context) {
final future = loadIrregularVerbs();
future.then((value) => {
setState((){
_irrVerbList = value;
})
});
return Scaffold(
appBar: AppBar(
title: Text("All Irregular Verbs"),
actions: [IconButton(onPressed: _pushFavorite, icon: Icon(Icons.list))],
),
body: _buildWordList(),
);
}
Widget _buildWordList(){
return ListView.builder(
itemCount: _irrVerbList.length,
padding: const EdgeInsets.all(16),
itemBuilder: (BuildContext _context, int i){
if (i.isOdd){
return Divider();
}
final int index = i~/2;
return _buildRow(_irrVerbList[index]);
},
);
}
Widget _buildRow(Word verb){
final alreadySaved = _savedList.contains(verb.base);
return ListTile(
title: Text(
verb.base,
style: _biggerFont,
),
trailing: Icon(
alreadySaved ? Icons.favorite : Icons.favorite_border,
color: alreadySaved ? Colors.red : null,
),
onTap: (){ // Note: Flutter reactive calling setState
setState((){ // => triggers build to update UI
if (alreadySaved) {
_savedList.remove(verb.base);
} else{
_savedList.add(verb.base);
}
});
},
);
}
void _pushFavorite() {
Navigator.of(context).push(
MaterialPageRoute(builder: (BuildContext context) {
final tiles = _savedList.map(
(String word){
return ListTile(
title: Text(
word,
style: _biggerFont,
),
);
}
);
final divided = tiles.isNotEmpty
? ListTile.divideTiles(tiles: tiles, context: context).toList()
: <Widget>[];
return Scaffold(
appBar: AppBar(
title: Text('Favorite Words')
),
// Note: ListView can created by ListView.builder...
// Or create by ListView(children: list..)
body: ListView(children: divided,),
);
})
);
}
/**
* Load Irregular Verb list from json file
*/
Future<List<Word>> loadIrregularVerbs() async {
String data = await DefaultAssetBundle.of(context).loadString("assets/irregular_verbs.json");
final jsonResult = jsonDecode(data); //latest Dart
List<Word> posts = List<Word>.from(jsonResult.map((model)=> Word.fromJson(model)));
return posts;
}
}
| 0
|
mirrored_repositories/Irregular-Verb-Flutter-Apps
|
mirrored_repositories/Irregular-Verb-Flutter-Apps/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:irregular_verbs/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/adoptini-app
|
mirrored_repositories/adoptini-app/lib/app.dart
|
import 'package:adoptini_app/auth/domain/usecases/logout_usecase.dart';
import 'package:adoptini_app/auth/domain/usecases/register_usecase.dart';
import 'package:adoptini_app/auth/domain/usecases/start_app_usecase.dart';
import 'package:adoptini_app/auth/domain/usecases/update_user_location_usecase.dart';
import 'package:adoptini_app/auth/domain/usecases/update_user_usercase.dart';
import 'package:adoptini_app/auth/presentation/cubit/auth_cubit.dart';
import 'package:adoptini_app/auth/presentation/cubit/user/user_cubit.dart';
import 'package:adoptini_app/common/adoptini_router.dart';
import 'package:adoptini_app/core/home/domain/usecases/add_pet_to_favorites_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/add_pet_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/delete_pet_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/fetch_conversations_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/fetch_favorites_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/fetch_pet_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/listen_to_messages_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/remove_pet_from_favorites_usecase.dart';
import 'package:adoptini_app/core/home/domain/usecases/send_msg_about_pet_usercase.dart';
import 'package:adoptini_app/core/home/domain/usecases/send_msg_usecase.dart';
import 'package:adoptini_app/core/home/presentation/cubit/messages_cubit/messages_cubit.dart';
import 'package:adoptini_app/core/home/presentation/cubit/pet_cubit/pet_cubit.dart';
import 'package:adoptini_app/core/settings/domain/usecases/create_ticket_usecase.dart';
import 'package:adoptini_app/core/settings/domain/usecases/get_settings_usecase.dart';
import 'package:adoptini_app/core/settings/domain/usecases/set_settings_usecase.dart';
import 'package:adoptini_app/core/settings/presentation/cubit/settings_cubit/settings_cubit.dart';
import 'package:adoptini_app/core/settings/presentation/cubit/tickets_cubit/tickets_cubit.dart';
import 'package:adoptini_app/injectable.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'auth/domain/usecases/login_usecase.dart';
class App extends StatefulWidget {
const App({super.key});
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> with WidgetsBindingObserver {
final navigatorKey = GlobalKey<NavigatorState>();
@override
void initState() {
super.initState();
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
WidgetsBinding.instance.addObserver(this);
// ShakeDetector.autoStart(
// minimumShakeCount: 2,
// shakeSlopTimeMS: 500,
// shakeCountResetTime: 3000,
// onPhoneShake: () {
// showFlexibleBottomSheet(
// bottomSheetColor: Colors.transparent,
// bottomSheetBorderRadius: const BorderRadius.only(
// topLeft: Radius.circular(20),
// topRight: Radius.circular(20),
// ),
// isExpand: true,
// minHeight: 0,
// initHeight: 0.4,
// maxHeight: 1,
// context: navigatorKey.currentContext!,
// builder: (context, scrollController, bottomSheetOffset) {
// return ReportProblemSheet(
// bottomSheetOffset: bottomSheetOffset,
// scrollController: scrollController,
// );
// },
// anchors: [0, 0.9, 1],
// isSafeArea: true,
// );
// },
// );
}
@override
Widget build(BuildContext context) {
return MultiBlocProvider(
providers: [
BlocProvider<AuthCubit>(
create: (context) => AuthCubit(
locator.get<LoginUsecase>(),
locator.get<RegisterUsecase>(),
),
),
BlocProvider<UserCubit>(
create: (context) => UserCubit(
locator.get<StartAppUsecase>(),
locator.get<LogoutUseCase>(),
locator.get<UpdateUserLocationUsecase>(),
locator.get<UpdateUserUsecase>(),
),
),
BlocProvider<SettingsCubit>(
create: (context) => SettingsCubit(
locator.get<GetSettingsUseCase>(),
locator.get<SetSettingsUseCase>(),
)..getSettings(),
),
BlocProvider<TicketsCubit>(
create: (context) => TicketsCubit(
locator.get<CreateTicketUseCase>(),
),
),
BlocProvider<PetCubit>(
create: (context) => PetCubit(
locator.get<AddPetUsecase>(),
locator.get<FetchPetUsecase>(),
locator.get<AddPetToFavoritesUsecase>(),
locator.get<FetchFavoritesUsecase>(),
locator.get<RemovePetFromFavoritesUsecase>(),
locator.get<DeletePetUsecase>(),
),
),
BlocProvider<MessagesCubit>(
create: (context) => MessagesCubit(
locator.get<SendMsgAboutPetUsecase>(),
locator.get<FetchConversationsUsecase>(),
locator.get<MessagesUsecase>(),
locator.get<SendMsgUsecase>(),
),
),
],
child: Builder(
builder: (context) {
return ScreenUtilInit(
designSize: const Size(360, 640),
builder: (BuildContext context, Widget? child) {
return MaterialApp(
debugShowCheckedModeBanner: false,
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance),
],
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
initialRoute: AdoptiniRouter.splashScreen,
onGenerateRoute: AdoptiniRouter.onGenerateRoute,
navigatorKey: navigatorKey,
);
},
);
},
),
);
}
}
| 0
|
mirrored_repositories/adoptini-app
|
mirrored_repositories/adoptini-app/lib/injectable.dart
|
import 'package:adoptini_app/injectable.config.dart';
import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';
@InjectableInit()
Future<void> configInjections() async => GetIt.instance.init();
final locator = GetIt.I;
| 0
|
mirrored_repositories/adoptini-app
|
mirrored_repositories/adoptini-app/lib/locator.dart
|
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:get_it/get_it.dart';
final GetIt locator = GetIt.instance;
void setupLocator() {
locator.registerSingleton<FirebaseAuth>(FirebaseAuth.instance);
locator.registerSingleton<FirebaseFirestore>(FirebaseFirestore.instance);
locator.registerSingleton<FirebaseStorage>(FirebaseStorage.instance);
}
| 0
|
mirrored_repositories/adoptini-app
|
mirrored_repositories/adoptini-app/lib/injectable.config.dart
|
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// InjectableConfigGenerator
// **************************************************************************
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: lines_longer_than_80_chars
// coverage:ignore-file
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:adoptini_app/auth/data/datasources/local_user_db.dart' as _i12;
import 'package:adoptini_app/auth/data/datasources/location_service.dart'
as _i3;
import 'package:adoptini_app/auth/data/datasources/remote_user_db.dart' as _i8;
import 'package:adoptini_app/auth/data/repositories/auth_repo.dart' as _i36;
import 'package:adoptini_app/auth/domain/repositories/base_auth_repo.dart'
as _i35;
import 'package:adoptini_app/auth/domain/usecases/login_usecase.dart' as _i37;
import 'package:adoptini_app/auth/domain/usecases/logout_usecase.dart' as _i38;
import 'package:adoptini_app/auth/domain/usecases/register_usecase.dart'
as _i39;
import 'package:adoptini_app/auth/domain/usecases/start_app_usecase.dart'
as _i40;
import 'package:adoptini_app/auth/domain/usecases/update_user_location_usecase.dart'
as _i41;
import 'package:adoptini_app/auth/domain/usecases/update_user_usercase.dart'
as _i42;
import 'package:adoptini_app/core/home/data/datasources/remote_messages_db.dart'
as _i4;
import 'package:adoptini_app/core/home/data/datasources/remote_pet_db.dart'
as _i6;
import 'package:adoptini_app/core/home/data/repositories/messages_repo.dart'
as _i14;
import 'package:adoptini_app/core/home/data/repositories/pet_repo.dart' as _i16;
import 'package:adoptini_app/core/home/domain/repositories/base_messages_repo.dart'
as _i13;
import 'package:adoptini_app/core/home/domain/repositories/base_pet_repo.dart'
as _i15;
import 'package:adoptini_app/core/home/domain/usecases/add_pet_to_favorites_usecase.dart'
as _i33;
import 'package:adoptini_app/core/home/domain/usecases/add_pet_usecase.dart'
as _i34;
import 'package:adoptini_app/core/home/domain/usecases/delete_pet_usecase.dart'
as _i23;
import 'package:adoptini_app/core/home/domain/usecases/fetch_conversations_usecase.dart'
as _i24;
import 'package:adoptini_app/core/home/domain/usecases/fetch_favorites_usecase.dart'
as _i25;
import 'package:adoptini_app/core/home/domain/usecases/fetch_pet_usecase.dart'
as _i26;
import 'package:adoptini_app/core/home/domain/usecases/listen_to_messages_usecase.dart'
as _i28;
import 'package:adoptini_app/core/home/domain/usecases/remove_pet_from_favorites_usecase.dart'
as _i29;
import 'package:adoptini_app/core/home/domain/usecases/send_msg_about_pet_usercase.dart'
as _i30;
import 'package:adoptini_app/core/home/domain/usecases/send_msg_usecase.dart'
as _i31;
import 'package:adoptini_app/core/settings/data/datasources/settings_local_data_source.dart'
as _i17;
import 'package:adoptini_app/core/settings/data/datasources/ticket_data_source.dart'
as _i11;
import 'package:adoptini_app/core/settings/data/repositories/settings_repo.dart'
as _i19;
import 'package:adoptini_app/core/settings/data/repositories/ticket_repo.dart'
as _i21;
import 'package:adoptini_app/core/settings/domain/repositories/base_settings_repository.dart'
as _i18;
import 'package:adoptini_app/core/settings/domain/repositories/base_ticket_repository.dart'
as _i20;
import 'package:adoptini_app/core/settings/domain/usecases/create_ticket_usecase.dart'
as _i22;
import 'package:adoptini_app/core/settings/domain/usecases/get_settings_usecase.dart'
as _i27;
import 'package:adoptini_app/core/settings/domain/usecases/set_settings_usecase.dart'
as _i32;
import 'package:adoptini_app/utils/register_module.dart' as _i43;
import 'package:cloud_firestore/cloud_firestore.dart' as _i5;
import 'package:firebase_auth/firebase_auth.dart' as _i9;
import 'package:firebase_storage/firebase_storage.dart' as _i7;
import 'package:get_it/get_it.dart' as _i1;
import 'package:injectable/injectable.dart' as _i2;
import 'package:isar/isar.dart' as _i10;
extension GetItInjectableX on _i1.GetIt {
// initializes the registration of main-scope dependencies inside of GetIt
Future<_i1.GetIt> init({
String? environment,
_i2.EnvironmentFilter? environmentFilter,
}) async {
final gh = _i2.GetItHelper(
this,
environment,
environmentFilter,
);
final registerModule = _$RegisterModule();
gh.lazySingleton<_i3.BaseLocationService>(() => _i3.LocationService());
gh.lazySingleton<_i4.BaseRemoteMessagesDB>(
() => _i4.RemoteMessagesDB(gh<_i5.FirebaseFirestore>()));
gh.lazySingleton<_i6.BaseRemotePetDB>(() => _i6.RemotePetDB(
gh<_i5.FirebaseFirestore>(),
gh<_i7.FirebaseStorage>(),
));
gh.lazySingleton<_i8.BaseRemoteUserDB>(() => _i8.RemoteUserDB(
gh<_i5.FirebaseFirestore>(),
gh<_i9.FirebaseAuth>(),
));
await gh.factoryAsync<_i10.Isar>(
() => registerModule.isar,
preResolve: true,
);
gh.factory<_i11.TicketsDataSource>(() => _i11.ApiTicketsDataSource(
gh<_i5.FirebaseFirestore>(),
gh<_i7.FirebaseStorage>(),
));
gh.lazySingleton<_i12.BaseLocalUserDB>(
() => _i12.LocalUserDB(gh<_i10.Isar>()));
gh.lazySingleton<_i13.BaseMessagesRepo>(
() => _i14.MessagesRepo(gh<_i4.BaseRemoteMessagesDB>()));
gh.lazySingleton<_i15.BasePetRepo>(() => _i16.PetRepo(
gh<_i6.BaseRemotePetDB>(),
gh<_i3.BaseLocationService>(),
));
gh.factory<_i17.BaseSettingsLocalDataSource>(
() => _i17.SettingsLocalDataSource(isar: gh<_i10.Isar>()));
gh.factory<_i18.BaseSettingsRepository>(() => _i19.SettingsRepository(
settingsLocalDataSource: gh<_i17.BaseSettingsLocalDataSource>()));
gh.factory<_i20.BaseTicketsRepository>(
() => _i21.TicketsRepository(gh<_i11.TicketsDataSource>()));
gh.factory<_i22.CreateTicketUseCase>(
() => _i22.CreateTicketUseCase(gh<_i20.BaseTicketsRepository>()));
gh.factory<_i23.DeletePetUsecase>(
() => _i23.DeletePetUsecase(gh<_i15.BasePetRepo>()));
gh.factory<_i24.FetchConversationsUsecase>(
() => _i24.FetchConversationsUsecase(gh<_i13.BaseMessagesRepo>()));
gh.lazySingleton<_i25.FetchFavoritesUsecase>(
() => _i25.FetchFavoritesUsecase(gh<_i15.BasePetRepo>()));
gh.lazySingleton<_i26.FetchPetUsecase>(
() => _i26.FetchPetUsecase(gh<_i15.BasePetRepo>()));
gh.factory<_i27.GetSettingsUseCase>(() => _i27.GetSettingsUseCase(
settingsRepository: gh<_i18.BaseSettingsRepository>()));
gh.factory<_i28.MessagesUsecase>(
() => _i28.MessagesUsecase(gh<_i13.BaseMessagesRepo>()));
gh.factory<_i29.RemovePetFromFavoritesUsecase>(
() => _i29.RemovePetFromFavoritesUsecase(gh<_i15.BasePetRepo>()));
gh.factory<_i30.SendMsgAboutPetUsecase>(
() => _i30.SendMsgAboutPetUsecase(gh<_i13.BaseMessagesRepo>()));
gh.factory<_i31.SendMsgUsecase>(
() => _i31.SendMsgUsecase(gh<_i13.BaseMessagesRepo>()));
gh.factory<_i32.SetSettingsUseCase>(() => _i32.SetSettingsUseCase(
settingsRepository: gh<_i18.BaseSettingsRepository>()));
gh.factory<_i33.AddPetToFavoritesUsecase>(
() => _i33.AddPetToFavoritesUsecase(gh<_i15.BasePetRepo>()));
gh.factory<_i34.AddPetUsecase>(
() => _i34.AddPetUsecase(gh<_i15.BasePetRepo>()));
gh.lazySingleton<_i35.BaseAuthRepo>(() => _i36.AuthRepo(
gh<_i8.BaseRemoteUserDB>(),
gh<_i9.FirebaseAuth>(),
gh<_i12.BaseLocalUserDB>(),
));
gh.factory<_i37.LoginUsecase>(
() => _i37.LoginUsecase(gh<_i35.BaseAuthRepo>()));
gh.factory<_i38.LogoutUseCase>(
() => _i38.LogoutUseCase(gh<_i35.BaseAuthRepo>()));
gh.factory<_i39.RegisterUsecase>(() => _i39.RegisterUsecase(
gh<_i35.BaseAuthRepo>(),
gh<_i3.BaseLocationService>(),
));
gh.factory<_i40.StartAppUsecase>(
() => _i40.StartAppUsecase(gh<_i35.BaseAuthRepo>()));
gh.factory<_i41.UpdateUserLocationUsecase>(
() => _i41.UpdateUserLocationUsecase(gh<_i35.BaseAuthRepo>()));
gh.factory<_i42.UpdateUserUsecase>(
() => _i42.UpdateUserUsecase(gh<_i35.BaseAuthRepo>()));
return this;
}
}
class _$RegisterModule extends _i43.RegisterModule {}
| 0
|
mirrored_repositories/adoptini-app
|
mirrored_repositories/adoptini-app/lib/firebase_options.dart
|
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
return macos;
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyBeHYrajjPgcaSZDyjmlGDrAikbl-gzaMs',
appId: '1:704018466082:web:e4a6c19c110d9cf342d17b',
messagingSenderId: '704018466082',
projectId: 'adoptini-a15ed',
authDomain: 'adoptini-a15ed.firebaseapp.com',
storageBucket: 'adoptini-a15ed.appspot.com',
);
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyDtMoTS4eZE5MY7F0_20HQ8Y6gwpWjhQ_g',
appId: '1:704018466082:android:4a85f323f9bf7eb342d17b',
messagingSenderId: '704018466082',
projectId: 'adoptini-a15ed',
storageBucket: 'adoptini-a15ed.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyBgnndPvW_kFLPhmyGN0nyJER6JHpp5CZE',
appId: '1:704018466082:ios:c48957eac0129bec42d17b',
messagingSenderId: '704018466082',
projectId: 'adoptini-a15ed',
storageBucket: 'adoptini-a15ed.appspot.com',
iosBundleId: 'com.example.adoptiniApp',
);
static const FirebaseOptions macos = FirebaseOptions(
apiKey: 'AIzaSyBgnndPvW_kFLPhmyGN0nyJER6JHpp5CZE',
appId: '1:704018466082:ios:18c479db2fdcd55642d17b',
messagingSenderId: '704018466082',
projectId: 'adoptini-a15ed',
storageBucket: 'adoptini-a15ed.appspot.com',
iosBundleId: 'com.example.adoptiniApp.RunnerTests',
);
}
| 0
|
mirrored_repositories/adoptini-app
|
mirrored_repositories/adoptini-app/lib/main.dart
|
import 'package:adoptini_app/app.dart';
import 'package:adoptini_app/injectable.dart';
import 'package:adoptini_app/locator.dart';
import 'package:adoptini_app/utils/package_info_wrapper.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:geolocator/geolocator.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
void main() async {
// Bloc.observer = AppBlocObserver();
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
await Firebase.initializeApp();
await configInjections();
await Geolocator.requestPermission();
await dotenv.load(fileName: ".env");
setupLocator();
await PackageInfoWrapper.instance.init();
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
return true;
};
SentryFlutter.init(
(options) {
options.dsn = 'https://af4c188afe625de5df5f0ef2ddb6bf35@o4505891090726912.ingest.sentry.io/4505891092299776';
options.tracesSampleRate = 1.0;
},
appRunner: () => runApp(
EasyLocalization(
supportedLocales: const [
Locale('en'),
Locale('fr'),
Locale('ar'),
],
path: 'assets/translations',
fallbackLocale: const Locale('en'),
child: const App(),
),
),
);
}
| 0
|
mirrored_repositories/adoptini-app/lib/core/home/data
|
mirrored_repositories/adoptini-app/lib/core/home/data/models/message_model.dart
|
import 'package:adoptini_app/auth/data/models/user_model.dart';
import 'package:adoptini_app/core/home/domain/entities/message_entity.dart';
class MessageModel extends MessageEntity {
late final bool isRead;
MessageModel({
required String messageId,
required UserModel sender,
required String content,
required DateTime timestamp,
this.isRead = false,
}) : super(
messageId: messageId,
sender: sender,
content: content,
timestamp: timestamp,
);
factory MessageModel.fromMap(Map<String, dynamic> map) {
return MessageModel(
messageId: map['messageId'],
// sender: map['sender'],
sender: UserModel.fromMap(map["sender"]),
content: map['content'],
timestamp: map['timestamp'].toDate(),
isRead: map['isRead'] ?? false,
);
}
Map<String, dynamic> toMap() {
return {
'messageId': messageId,
'sender': sender.toMap(),
'content': content,
'timestamp': timestamp,
'isRead': isRead,
};
}
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.