Skip to content

Commit

Permalink
manage size text field and button
Browse files Browse the repository at this point in the history
  • Loading branch information
naufal-yafi committed Jan 7, 2023
1 parent 15d8d48 commit dc8777a
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 74 deletions.
4 changes: 3 additions & 1 deletion lib/pages/listArticle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class ListArticle extends StatelessWidget {
color: neutral_100,
),
title: TextField(
style: body2RegulerShade50,
cursorColor: neutral_50,
decoration: InputDecoration(
hintText: "Cari topik kesukaanmu disini...",
hintStyle: TextStyle(
Expand Down Expand Up @@ -226,7 +228,7 @@ class ListArticle extends StatelessWidget {
height: 8,
),
Text(
"Saya",
"Profil",
style: tab == 2
? label1RegulerShade50
: label1RegulerShade200,
Expand Down
35 changes: 16 additions & 19 deletions lib/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class Login extends StatelessWidget {
cursorColor: neutral_50,
obscureText: stylePassword,
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
contentPadding: textFieldSize,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primary)),
border: InputBorder.none,
Expand All @@ -65,24 +64,22 @@ class Login extends StatelessWidget {
}

btnLogin() {
return SizedBox(
height: 52,
child: ElevatedButton(
onPressed: () {
if (condition == 'baca') {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
} else {
Navigator.push(context,
MaterialPageRoute(builder: (context) => WritePage()));
}
},
child: Text(
'Masuk',
style: body1Reguler,
),
style: ElevatedButton.styleFrom(backgroundColor: primary),
return ElevatedButton(
onPressed: () {
if (condition == 'baca') {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
} else {
Navigator.push(
context, MaterialPageRoute(builder: (context) => WritePage()));
}
},
child: Text(
'Masuk',
style: body2RegulerShade50,
),
style: ElevatedButton.styleFrom(
backgroundColor: primary, padding: btnSize),
);
}

Expand Down
9 changes: 6 additions & 3 deletions lib/pages/read.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ class _ReadingPageState extends State<ReadingPage> {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
},
icon: const Icon(Icons.subdirectory_arrow_left),
icon: const Icon(
Icons.subdirectory_arrow_left,
size: 14,
),
label: Text(
"Baca Artikel Lainnya",
style: body1Reguler,
style: body2RegulerShade50,
),
style:
ElevatedButton.styleFrom(backgroundColor: primary, padding: btnSize),
Expand All @@ -88,7 +91,7 @@ class _ReadingPageState extends State<ReadingPage> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'read ${title}',
title: 'arK | Baca',
home: Scaffold(
body: Stack(
children: [
Expand Down
42 changes: 19 additions & 23 deletions lib/pages/signup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ class Signup extends StatelessWidget {
color: neutral_800,
borderRadius: const BorderRadius.all(Radius.circular(5))),
child: TextField(
style: TextStyle(color: neutral_50),
style: body2BoldShade50,
cursorColor: neutral_50,
obscureText: stylePassword,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(
vertical: 20, horizontal: 20),
contentPadding: textFieldSize,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primary)),
border: InputBorder.none,
Expand All @@ -81,12 +80,11 @@ class Signup extends StatelessWidget {
color: neutral_800,
borderRadius: const BorderRadius.all(Radius.circular(5))),
child: TextField(
style: TextStyle(color: neutral_50),
style: body2BoldShade50,
cursorColor: neutral_50,
obscureText: stylePassword,
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(
vertical: 20, horizontal: 20),
contentPadding: textFieldSize,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primary)),
border: InputBorder.none,
Expand All @@ -100,24 +98,22 @@ class Signup extends StatelessWidget {
}

btnLogin() {
return SizedBox(
height: 52,
child: ElevatedButton(
onPressed: () {
if (condition == 'baca') {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
} else {
Navigator.push(context,
MaterialPageRoute(builder: (context) => WritePage()));
}
},
child: Text(
'Daftar',
style: body1Reguler,
),
style: ElevatedButton.styleFrom(backgroundColor: primary),
return ElevatedButton(
onPressed: () {
if (condition == 'baca') {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HomePage()));
} else {
Navigator.push(
context, MaterialPageRoute(builder: (context) => WritePage()));
}
},
child: Text(
'Daftar',
style: body2RegulerShade50,
),
style: ElevatedButton.styleFrom(
backgroundColor: primary, padding: btnSize),
);
}

Expand Down
22 changes: 12 additions & 10 deletions lib/pages/starting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ class StartingUp extends StatelessWidget {
width: MediaQuery.of(context).size.width,
child: ElevatedButton.icon(
onPressed: () {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => Login("baca")));
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const HomePage()));
Navigator.push(context,
MaterialPageRoute(builder: (context) => Login("baca")));
},
icon: const Icon(Icons.menu_book),
icon: const Icon(
Icons.menu_book,
size: 18,
),
label: Text(
"Baca Artikel",
style: body1Reguler,
style: body2RegulerShade50,
),
style: ElevatedButton.styleFrom(
backgroundColor: primary, padding: btnSize),
Expand All @@ -95,10 +94,13 @@ class StartingUp extends StatelessWidget {
MaterialPageRoute(
builder: (context) => Login("tulis")));
},
icon: const Icon(Icons.create),
icon: Icon(
Icons.create,
size: 18,
),
label: Text(
"Tulis Artikelmu",
style: body1Reguler,
style: body2RegulerShade50,
),
style: OutlinedButton.styleFrom(
foregroundColor: neutral_50,
Expand Down
17 changes: 8 additions & 9 deletions lib/pages/write.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ class WritePage extends StatelessWidget {
height: 40,
child: ElevatedButton.icon(
onPressed: () {},
icon: const Icon(
icon: Icon(
Icons.upload,
size: 14,
color: neutral_50,
),
label: const Text(
label: Text(
"Unggah",
style: TextStyle(fontSize: 14),
style: body2RegulerShade50,
),
style: ElevatedButton.styleFrom(backgroundColor: primary),
),
Expand Down Expand Up @@ -76,11 +77,10 @@ class WritePage extends StatelessWidget {
child: TextField(
style: TextStyle(color: neutral_50),
cursorColor: neutral_50,
minLines: 15,
minLines: 8,
maxLines: null,
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
contentPadding: const EdgeInsets.all(20),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primary)),
border: InputBorder.none,
Expand All @@ -104,7 +104,7 @@ class WritePage extends StatelessWidget {
),
Container(
margin: const EdgeInsets.only(top: 8),
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(color: neutral_800),
borderRadius: const BorderRadius.all(Radius.circular(5))),
Expand Down Expand Up @@ -155,8 +155,7 @@ class WritePage extends StatelessWidget {
style: TextStyle(color: neutral_50),
cursorColor: neutral_50,
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
contentPadding: textFieldSize,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primary)),
border: InputBorder.none,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/writerAccount.dart
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class WriterAccountPage extends StatelessWidget {
height: 8,
),
Text(
"Saya",
"Profil",
style: tab == 2
? label1RegulerShade50
: label1RegulerShade200,
Expand Down Expand Up @@ -412,7 +412,7 @@ class WriterAccountPage extends StatelessWidget {
}

return MaterialApp(
title: 'arK | Artikel Kulo',
title: 'arK | Penulis',
home: Scaffold(
backgroundColor: neutral_900,
appBar: AppBar(
Expand Down
12 changes: 5 additions & 7 deletions lib/pages/yourAccount.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class YourAccountPage extends StatelessWidget {
children: <Widget>[
//! SECONDARY BUTTON
SizedBox(
height: 50,
width: MediaQuery.of(context).size.width * 0.42,
child: OutlinedButton(
onPressed: () {},
Expand All @@ -50,13 +49,13 @@ class YourAccountPage extends StatelessWidget {
),
style: OutlinedButton.styleFrom(
foregroundColor: neutral_50,
side: BorderSide(color: neutral_50)),
side: BorderSide(color: neutral_50),
padding: btnSize),
),
),
//! SECONDARY BUTTON
//! PRIMARY BUTTON
SizedBox(
height: 50,
width: MediaQuery.of(context).size.width * 0.42,
child: ElevatedButton(
onPressed: () {
Expand All @@ -82,8 +81,7 @@ class YourAccountPage extends StatelessWidget {
],
),
style: ElevatedButton.styleFrom(
backgroundColor: primary,
),
backgroundColor: primary, padding: btnSize),
),
),
//! PRIMARY BUTTON
Expand Down Expand Up @@ -300,7 +298,7 @@ class YourAccountPage extends StatelessWidget {
height: 8,
),
Text(
"Saya",
"Profil",
style: tab == 2
? label1RegulerShade50
: label1RegulerShade200,
Expand Down Expand Up @@ -342,7 +340,7 @@ class YourAccountPage extends StatelessWidget {
}

return MaterialApp(
title: 'arK | Artikel Kulo',
title: 'arK | Profil',
home: Scaffold(
backgroundColor: neutral_900,
appBar: AppBar(
Expand Down
1 change: 1 addition & 0 deletions lib/style/design_system.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

EdgeInsets btnSize = const EdgeInsets.symmetric(vertical: 24);
EdgeInsets textFieldSize = const EdgeInsets.fromLTRB(20, 10, 10, 10);

//! Color Scheme
Color neutral_900 = const Color(0xff252525);
Expand Down

0 comments on commit dc8777a

Please sign in to comment.