mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
LoginPage: Add GitJournal header
+ cleanup the code a little
This commit is contained in:
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:gitjournal/widgets/scroll_view_without_animation.dart';
|
||||||
|
|
||||||
//import 'Widget/bezierContainer.dart';
|
//import 'Widget/bezierContainer.dart';
|
||||||
|
|
||||||
@ -57,11 +57,12 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(left: 0, top: 10, bottom: 10),
|
|
||||||
child: const Icon(Icons.keyboard_arrow_left, color: Colors.black),
|
child: const Icon(Icons.keyboard_arrow_left, color: Colors.black),
|
||||||
),
|
),
|
||||||
const Text('Back',
|
const Text(
|
||||||
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500))
|
'Back',
|
||||||
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -82,12 +83,13 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
obscureText: isPassword,
|
obscureText: isPassword,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
fillColor: Color(0xfff3f3f4),
|
fillColor: Color(0xfff3f3f4),
|
||||||
filled: true,
|
filled: true,
|
||||||
))
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -99,18 +101,20 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||||
boxShadow: <BoxShadow>[
|
boxShadow: <BoxShadow>[
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.grey.shade200,
|
color: Colors.grey.shade200,
|
||||||
offset: const Offset(2, 4),
|
offset: const Offset(2, 4),
|
||||||
blurRadius: 5,
|
blurRadius: 5,
|
||||||
spreadRadius: 2)
|
spreadRadius: 2,
|
||||||
],
|
)
|
||||||
gradient: const LinearGradient(
|
],
|
||||||
begin: Alignment.centerLeft,
|
gradient: const LinearGradient(
|
||||||
end: Alignment.centerRight,
|
begin: Alignment.centerLeft,
|
||||||
colors: [Color(0xfffbb448), Color(0xfff7892b)])),
|
end: Alignment.centerRight,
|
||||||
|
colors: [Color(0xfffbb448), Color(0xfff7892b)]),
|
||||||
|
),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Login',
|
'Login',
|
||||||
style: TextStyle(fontSize: 20, color: Colors.white),
|
style: TextStyle(fontSize: 20, color: Colors.white),
|
||||||
@ -229,27 +233,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _title() {
|
Widget _title() {
|
||||||
return RichText(
|
var textTheme = Theme.of(context).textTheme;
|
||||||
textAlign: TextAlign.center,
|
var style = textTheme.headline2.copyWith(fontFamily: "Lato");
|
||||||
text: TextSpan(
|
return Text('GitJournal', style: style);
|
||||||
text: 'd',
|
|
||||||
style: GoogleFonts.portLligatSans(
|
|
||||||
textStyle: Theme.of(context).textTheme.headline4,
|
|
||||||
fontSize: 30,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
color: const Color(0xffe46b10),
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
const TextSpan(
|
|
||||||
text: 'ev',
|
|
||||||
style: TextStyle(color: Colors.black, fontSize: 30),
|
|
||||||
),
|
|
||||||
const TextSpan(
|
|
||||||
text: 'rnz',
|
|
||||||
style: TextStyle(color: Color(0xffe46b10), fontSize: 30),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _emailPasswordWidget() {
|
Widget _emailPasswordWidget() {
|
||||||
@ -275,12 +261,12 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
child: BezierContainer()),*/
|
child: BezierContainer()),*/
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
child: SingleChildScrollView(
|
child: ScrollViewWithoutAnimation(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(height: height * .2),
|
SizedBox(height: height * .12),
|
||||||
_title(),
|
_title(),
|
||||||
const SizedBox(height: 50),
|
const SizedBox(height: 50),
|
||||||
_emailPasswordWidget(),
|
_emailPasswordWidget(),
|
||||||
@ -301,7 +287,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(top: 40, left: 0, child: _backButton()),
|
Positioned(top: 15, left: 0, child: SafeArea(child: _backButton())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
@ -6,7 +6,7 @@ class ScrollViewWithoutAnimation extends StatelessWidget {
|
|||||||
|
|
||||||
ScrollViewWithoutAnimation({
|
ScrollViewWithoutAnimation({
|
||||||
@required this.child,
|
@required this.child,
|
||||||
this.scrollDirection,
|
this.scrollDirection = Axis.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Reference in New Issue
Block a user