Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-102
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-102
2021-102
Commits
c8d1e8d2
Commit
c8d1e8d2
authored
May 15, 2021
by
mojitha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added login and sign up screens
parent
419b51c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
440 additions
and
124 deletions
+440
-124
MobileClient/meta.txt
MobileClient/meta.txt
+0
-1
MobileClient/mobile_client/lib/main.dart
MobileClient/mobile_client/lib/main.dart
+5
-104
MobileClient/mobile_client/lib/screens/home.dart
MobileClient/mobile_client/lib/screens/home.dart
+39
-0
MobileClient/mobile_client/lib/screens/login.dart
MobileClient/mobile_client/lib/screens/login.dart
+118
-0
MobileClient/mobile_client/lib/screens/signUp.dart
MobileClient/mobile_client/lib/screens/signUp.dart
+259
-0
MobileClient/mobile_client/pubspec.lock
MobileClient/mobile_client/pubspec.lock
+19
-19
No files found.
MobileClient/meta.txt
deleted
100644 → 0
View file @
419b51c6
Testing branch now mojitha
\ No newline at end of file
MobileClient/mobile_client/lib/main.dart
View file @
c8d1e8d2
import
'package:flutter/material.dart'
;
import
'package:mobile_client/screens/login.dart'
;
import
'screens/login.dart'
;
void
main
(
)
{
runApp
(
MyApp
());
}
class
MyApp
extends
StatelessWidget
{
// 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
.
blue
,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity:
VisualDensity
.
adaptivePlatformDensity
,
),
home:
MyHomePage
(
title:
'Flutter Demo Home Page'
),
);
}
}
class
MyHomePage
extends
StatefulWidget
{
MyHomePage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final
String
title
;
@override
_MyHomePageState
createState
()
=>
_MyHomePageState
();
}
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
int
_counter
=
0
;
void
_incrementCounter
()
{
setState
(()
{
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter
++;
});
}
@override
Widget
build
(
BuildContext
context
)
{
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return
Scaffold
(
appBar:
AppBar
(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title:
Text
(
widget
.
title
),
),
body:
Center
(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child:
Column
(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
'You have pushed the button this many times:'
,
),
Text
(
'
$_counter
'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline4
,
),
],
),
),
floatingActionButton:
FloatingActionButton
(
onPressed:
_incrementCounter
,
tooltip:
'Increment'
,
child:
Icon
(
Icons
.
add
),
),
// This trailing comma makes auto-formatting nicer for build methods.
theme:
ThemeData
(
primaryColor:
Colors
.
blue
[
700
],
fontFamily:
'Montserrat'
),
home:
LogInForm
()
);
}
}
MobileClient/mobile_client/lib/screens/home.dart
0 → 100644
View file @
c8d1e8d2
import
'package:flutter/material.dart'
;
class
FirstRoute
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'First Route'
),
),
body:
Center
(
child:
ElevatedButton
(
child:
Text
(
'Open route'
),
onPressed:
()
{
// Navigate to second route when tapped.
},
),
),
);
}
}
class
SecondRoute
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
"Second Route"
),
),
body:
Center
(
child:
ElevatedButton
(
onPressed:
()
{
// Navigate back to first route when tapped.
},
child:
Text
(
'Go back!'
),
),
),
);
}
}
MobileClient/mobile_client/lib/screens/login.dart
0 → 100644
View file @
c8d1e8d2
import
'package:flutter/material.dart'
;
// Create a Form widget.
class
LogInForm
extends
StatefulWidget
{
@override
LogInFormState
createState
()
{
return
LogInFormState
();
}
}
// Create a corresponding State class.
// This class holds data related to the form.
class
LogInFormState
extends
State
<
LogInForm
>
{
// Create a global key that uniquely identifies the Form widget
// and allows validation of the form.
final
_formKey
=
GlobalKey
<
FormState
>();
// text inputs
String
email
=
''
,
password
=
''
;
// set initial widget state
@override
void
initState
()
{
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
// Build a Form widget using the _formKey created above.
return
Scaffold
(
resizeToAvoidBottomInset:
false
,
backgroundColor:
Colors
.
white
,
appBar:
AppBar
(
title:
Text
(
'Log In'
,
style:
TextStyle
(
fontSize:
24
)),
flexibleSpace:
Container
(
decoration:
new
BoxDecoration
(
gradient:
new
LinearGradient
(
colors:
[
Colors
.
black
,
Colors
.
black
,
],
begin:
const
FractionalOffset
(
0.0
,
0.0
),
end:
const
FractionalOffset
(
1.0
,
0.0
),
stops:
[
0.0
,
1.0
],
tileMode:
TileMode
.
clamp
),
),
),
),
body:
Form
(
key:
_formKey
,
child:
Center
(
heightFactor:
300
,
child:
Stack
(
children:
[
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'Email'
,
// helperText: 'max 50 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
email
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'Password'
,
// helperText: 'max 50 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
password
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextButton
(
child:
Container
(
margin:
EdgeInsets
.
all
(
16.0
),
child:
Text
(
'Log In'
,
style:
TextStyle
(
color:
Colors
.
blueGrey
,
fontSize:
18
),
),
),
onPressed:
()
=>
{
},
))
]))
])
),
)
);
}
}
\ No newline at end of file
MobileClient/mobile_client/lib/screens/signUp.dart
0 → 100644
View file @
c8d1e8d2
import
'dart:io'
;
import
'dart:convert'
;
import
'package:flutter/material.dart'
;
// Create a Form widget.
class
SignUpForm
extends
StatefulWidget
{
@override
SignUpFormState
createState
()
{
return
SignUpFormState
();
}
}
// Create a corresponding State class.
// This class holds data related to the form.
class
SignUpFormState
extends
State
<
SignUpForm
>
{
// Create a global key that uniquely identifies the Form widget
// and allows validation of the form.
final
_formKey
=
GlobalKey
<
FormState
>();
// picture parameters
Future
<
File
>
file
;
String
status
=
''
;
String
base64Image
;
File
tmpFile
;
String
errMessage
=
'Error Uploading Image'
;
// text inputs
String
picture
=
''
,
firstName
=
''
,
lastName
=
''
,
emailAddress
=
''
,
nICNumber
=
''
,
contactNo
=
''
,
address
=
''
;
// set initial widget state
@override
void
initState
()
{
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
// Build a Form widget using the _formKey created above.
return
Scaffold
(
resizeToAvoidBottomInset:
false
,
backgroundColor:
Colors
.
white
,
appBar:
AppBar
(
title:
Text
(
'Sign Up'
,
style:
TextStyle
(
fontSize:
24
)),
flexibleSpace:
Container
(
decoration:
new
BoxDecoration
(
gradient:
new
LinearGradient
(
colors:
[
Colors
.
black
,
Colors
.
black
,
],
begin:
const
FractionalOffset
(
0.0
,
0.0
),
end:
const
FractionalOffset
(
1.0
,
0.0
),
stops:
[
0.0
,
1.0
],
tileMode:
TileMode
.
clamp
),
),
),
),
body:
Form
(
key:
_formKey
,
child:
Stack
(
children:
[
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
32.0
,
16.0
,
16.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
margin:
EdgeInsets
.
all
(
8.0
),
child:
FutureBuilder
<
File
>(
future:
file
,
builder:
(
BuildContext
context
,
AsyncSnapshot
<
File
>
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
done
&&
null
!=
snapshot
.
data
)
{
tmpFile
=
snapshot
.
data
;
base64Image
=
base64Encode
(
snapshot
.
data
.
readAsBytesSync
());
return
Flexible
(
child:
ClipOval
(
child:
Image
.
file
(
snapshot
.
data
,
fit:
BoxFit
.
fill
,
width:
96.0
,
height:
96.0
,
),
));
}
else
if
(
null
!=
snapshot
.
error
)
{
return
const
Text
(
'Error Picking Image'
,
textAlign:
TextAlign
.
center
,
);
}
else
{
return
const
CircleAvatar
(
backgroundColor:
Colors
.
lightBlueAccent
,
minRadius:
48.0
,
child:
Text
(
'MA'
,
style:
TextStyle
(
color:
Colors
.
white
)),
);
}
},
),
),
],
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'FirstName'
,
// helperText: 'max 50 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
firstName
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'LastName'
,
// helperText: 'max 50 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
lastName
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'Email Address'
,
// helperText: 'max 30 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
emailAddress
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'NIC No.'
,
// helperText: 'max 30 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
nICNumber
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
textInputAction:
TextInputAction
.
next
,
decoration:
InputDecoration
(
hintText:
'Contact No.'
,
// helperText: 'max 10 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
contactNo
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextFormField
(
maxLines:
4
,
decoration:
InputDecoration
(
hintText:
'Address'
,
// helperText: 'max 100 chars.',
contentPadding:
EdgeInsets
.
all
(
8.0
),
border:
UnderlineInputBorder
(),
filled:
true
,
fillColor:
Colors
.
white10
,
),
style:
TextStyle
(
fontWeight:
FontWeight
.
normal
,
fontSize:
18
,
color:
Colors
.
blueGrey
,
),
onChanged:
(
value
)
{
setState
(()
=>
address
=
value
);
},
)),
Container
(
margin:
EdgeInsets
.
fromLTRB
(
16.0
,
8.0
,
16.0
,
8.0
),
child:
TextButton
(
child:
Container
(
margin:
EdgeInsets
.
all
(
16.0
),
child:
Text
(
'Sign Up'
,
style:
TextStyle
(
color:
Colors
.
blueGrey
,
fontSize:
18
),
),
),
onPressed:
()
=>
{
},
)
)
]))
])
)
);
}
}
\ No newline at end of file
MobileClient/mobile_client/pubspec.lock
View file @
c8d1e8d2
...
...
@@ -7,42 +7,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0
-nullsafety.1
"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0
-nullsafety.1
"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0
-nullsafety.3
"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0
-nullsafety.1
"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0
-nullsafety.1
"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0
-nullsafety.3
"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
...
...
@@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0
-nullsafety.1
"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
...
...
@@ -73,21 +73,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10
-nullsafety.1
"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0
-nullsafety.3
"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0
-nullsafety.1
"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
...
...
@@ -99,55 +99,55 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0
-nullsafety.2
"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0
-nullsafety.1
"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0
-nullsafety.1
"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0
-nullsafety.1
"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0
-nullsafety.1
"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19
-nullsafety.2
"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0
-nullsafety.3
"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0
-nullsafety.3
"
version: "2.1.0"
sdks:
dart: ">=2.1
0.0-110 <2.11
.0"
dart: ">=2.1
2.0-0.0 <3.0
.0"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment