Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…g_app into avinath1998-master
  • Loading branch information
dewmal committed Mar 23, 2020
2 parents 8d6af1a + 693fe7c commit bb2a256
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 45 deletions.
76 changes: 41 additions & 35 deletions lib/page/screen/user_register_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {

String _name;
String _age;
String _email;
String _email = "";
String _mobileNumber;
String _address;
String _citizenStatus = "Yes";
String _nic = "";
String _country = "Sri Lanka";
String _country = "Afghanistan";
String _passport = "";
String _gender;
String _gender = "Female";

final AsyncMemoizer<List<String>> _memorizier = AsyncMemoizer<List<String>>();

Expand Down Expand Up @@ -273,35 +273,35 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
SizedBox(
height: 15.0,
),
TextFormField(
validator: (val) {
if (val.isEmpty || !val.contains("@")) {
return AppLocalizations.of(context).translate(
"user_register_screen_invalid_email");
}
},
onSaved: (val) {
setState(() {
_email = val;
});
},
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
labelText: AppLocalizations.of(context)
.translate("user_register_screen_email"),
icon: Icon(
Icons.email,
color: TrackerColors.primaryColor,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15.0),
borderSide: BorderSide(
color: TrackerColors.primaryColor,
),
))),
SizedBox(
height: 15.0,
),
// TextFormField(
// validator: (val) {
// if (val.isEmpty || !val.contains("@")) {
// return AppLocalizations.of(context).translate(
// "user_register_screen_invalid_email");
// }
// },
// onSaved: (val) {
// setState(() {
// _email = val;
// });
// },
// keyboardType: TextInputType.emailAddress,
// decoration: InputDecoration(
// labelText: AppLocalizations.of(context)
// .translate("user_register_screen_email"),
// icon: Icon(
// Icons.email,
// color: TrackerColors.primaryColor,
// ),
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(15.0),
// borderSide: BorderSide(
// color: TrackerColors.primaryColor,
// ),
// ))),
// SizedBox(
// height: 15.0,
// ),
TextFormField(
validator: (val) {
if (val.isEmpty) {
Expand Down Expand Up @@ -350,6 +350,8 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
onChanged: (value) {
setState(() {
_citizenStatus = value;
_passport = "";
_country = "Sri Lanka";
});
},
),
Expand All @@ -368,6 +370,7 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
onChanged: (value) {
setState(() {
_citizenStatus = value;
_nic = "";
});
},
),
Expand Down Expand Up @@ -507,7 +510,7 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
TextFormField(
validator: (val) {
if (val.isEmpty) {
"Passport number is invalid";
return "Passport number is invalid";
}
},
onSaved: (val) {
Expand Down Expand Up @@ -572,8 +575,8 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
Icon(Icons.person),
Expanded(
child: Container(
margin: const EdgeInsets.only(left: 15.0),
height: 60.0,
margin: const EdgeInsets.only(left: 15.0),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: Padding(
Expand Down Expand Up @@ -620,6 +623,7 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
SizedBox(
height: 15.0,
),

AnimatedTrackerButton(
child: _currentBtnChild,
active: _registerBtnStatus,
Expand Down Expand Up @@ -650,7 +654,9 @@ class _UserRegisterScreenState extends State<UserRegisterScreen> {
_registerBtnHeight = 50.0;
_registerBtnStatus = false;
});

if (_citizenStatus == "Yes") {
_country = "Sri Lanka";
}
List<ReportedCase> _cases =
Provider.of<RegisteredCasesModel>(context, listen: false).reportedCases;
// Position position = await Geolocator()
Expand Down
112 changes: 102 additions & 10 deletions lib/page/screen/welcome_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
"Next",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
);

Widget _btnChild;
String _appName = "Sri Lanka COVID-19";
String _version = "1.0.0";

@override
void initState() {
super.initState();

_btnChild = _nextBtnChild;
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
setState(() {
_appName = packageInfo.appName;
Expand Down Expand Up @@ -264,27 +266,21 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
AnimatedTrackerButton(
width: _nextBtnWidth,
height: _nextBtnHeight,
child: _nextBtnChild,
child: _btnChild,
onPressed: () {
setState(() {
_nextBtnWidth = 100.0;
_nextBtnHeight = 60.0;
_nextBtnChild = _registerCircleProgress;

_btnChild = _registerCircleProgress;
SharedPreferences.getInstance().then((pref) {
String language = AppLocalizations.of(context)
.locale
.languageCode;
pref.setString("language", language);
print("Languge $language");
Future.delayed(Duration(seconds: 1), () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootScreen()));
});
});
});
_showDialog();
},
)
],
Expand All @@ -296,4 +292,100 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
),
);
}

void _showDialog() {
Future.delayed(Duration(seconds: 1), () {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(context).pop();
setState(() {
_nextBtnWidth = 400.0;
_nextBtnHeight = 20.0;
_btnChild = _nextBtnChild;
});
},
child: Text("I Decline",
style: TextStyle(color: Colors.black45)),
),
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.all(Radius.circular(20.0))),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootScreen()));
},
color: TrackerColors.primaryColor,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"I Accept",
style: TextStyle(color: Colors.white),
),
),
),
],
)
],
contentPadding: const EdgeInsets.all(0),
content: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.black12,
style: BorderStyle.solid,
width: 3.0))),
height: 400,
child: SingleChildScrollView(
child: Scrollbar(
child: Container(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Terms of Service",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
fontSize: 20.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 20.0,
),
Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.normal),
),
],
),
),
),
),
),
);
});
});
}
}

0 comments on commit bb2a256

Please sign in to comment.