Skip to content

Commit

Permalink
implementation of better brand guidelines (text box is now similar to…
Browse files Browse the repository at this point in the history
… dashboard)
  • Loading branch information
aguilaair committed Aug 10, 2020
1 parent e7270f4 commit af1cc22
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 97 deletions.
2 changes: 1 addition & 1 deletion lib/pages/deployPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _DeployPageState extends State<DeployPage> {
Container(
width: MediaQuery.of(context).size.width,
child: Text(
"Sign Up",
"Set wifi",
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 30,
Expand Down
120 changes: 29 additions & 91 deletions lib/widget/SSIDInput.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:connectivity/connectivity.dart';
import 'package:flutter/material.dart';
import 'package:gategoDeploy/controller/WifiInfo.dart';
import 'package:gategoDeploy/widget/textInput.dart';
import 'package:location_permissions/location_permissions.dart';
import 'package:get/get.dart';

Expand Down Expand Up @@ -48,101 +49,38 @@ class _SSIDInputState extends State<SSIDInput> {
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 50, left: 10, right: 10),
child: Row(
children: [
Expanded(
child: TextField(
onChanged: (val) => c.setSSID(val),
controller: controller,
style: TextStyle(
color: Theme.of(context).primaryColor,
),
decoration: InputDecoration(
focusColor: Theme.of(context).primaryColor,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
width: 1,
style: BorderStyle.solid),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
width: 1,
style: BorderStyle.solid),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
width: 1,
style: BorderStyle.solid),
),
fillColor: Colors.lightBlueAccent,
labelText: 'Network Name',
labelStyle: TextStyle(
color: Theme.of(context).primaryColor,
),
),
),
),
IconButton(
icon: Icon(
Icons.sync,
color: Theme.of(context).primaryColor,
size: 30,
),
onPressed: () => wifi(),
)
],
),
SizedBox(
height: 50,
),
Padding(
padding: const EdgeInsets.only(top: 20, left: 10, right: 10),
child: Container(
height: 60,
width: MediaQuery.of(context).size.width,
child: TextField(
onChanged: (val) => c.setPSK(val),
style: TextStyle(
color: Theme.of(context).primaryColor,
),
obscureText: true,
decoration: InputDecoration(
focusColor: Theme.of(context).primaryColor,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
width: 1,
style: BorderStyle.solid),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
width: 1,
style: BorderStyle.solid),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
width: 1,
style: BorderStyle.solid),
),
labelText: 'Password',
labelStyle: TextStyle(
color: Theme.of(context).primaryColor,
),
Row(
children: [
Expanded(
child: TextInput(
setData: c.setSSID,
icon: Icons.wifi,
text: "Network Name",
c: controller,
),
),
),
IconButton(
icon: Icon(
Icons.sync,
color: Theme.of(context).primaryColor,
size: 30,
),
onPressed: () => wifi(),
)
],
),
SizedBox(
height: 20,
),
TextInput(
setData: c.setPSK,
icon: Icons.vpn_key,
text: "Password",
obscureText: true,
)
],
);
}
Expand Down
23 changes: 18 additions & 5 deletions lib/widget/textInput.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ import 'package:flutter/material.dart';

class TextInput extends StatefulWidget {
final Function setData;
const TextInput(this.setData, {Key key}) : super(key: key);
final TextEditingController c;
final IconData icon;
final String text;
final bool obscureText;
const TextInput(
{this.setData,
this.icon,
this.text,
this.obscureText = false,
Key key,
this.c})
: super(key: key);

@override
_TextInputState createState() => _TextInputState();
Expand Down Expand Up @@ -41,13 +52,12 @@ class _TextInputState extends State<TextInput> {
@override
void dispose() {
super.dispose();
controller.dispose();
_focusNode.dispose();
}

@override
Widget build(BuildContext context) {
final padding = 16.0;
final padding = 8.0;
var size = MediaQuery.of(context).size.width - padding * 2;
return Center(
child: Padding(
Expand All @@ -72,7 +82,7 @@ class _TextInputState extends State<TextInput> {
width: 10,
),
Icon(
Icons.wifi,
widget.icon,
size: 25,
color: colorIcon,
),
Expand All @@ -82,14 +92,17 @@ class _TextInputState extends State<TextInput> {
borderRadius:
BorderRadius.horizontal(right: Radius.circular(15)),
child: TextField(
controller: widget.c,
focusNode: _focusNode,
obscureText: widget.obscureText,
onChanged: widget.setData,
decoration: InputDecoration(
fillColor: Color(0xfff5f5f5),
focusColor: Color(0xfff5f5f5),
hoverColor: Color(0xfff5f5f5),
filled: true,
border: InputBorder.none,
hintText: "Network",
hintText: widget.text,
hintStyle: TextStyle(
color: Color(0xff727272),
fontWeight: FontWeight.w300),
Expand Down

0 comments on commit af1cc22

Please sign in to comment.