Commit 3780e441 authored by laishanqi's avatar laishanqi

提交技术分享页面

parent d9791b06
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/laishanqi/netrain/Images.dart';
class Login extends StatelessWidget {
@override
Widget build(BuildContext context) {
var controller = TextEditingController();
return MaterialApp(
home: Scaffold(
body: Container(
margin: EdgeInsets.only(top: 108),
alignment: Alignment.center,
child: Column(
children: [
Image.asset(Images.logo_01),
Container(
margin: EdgeInsets.only(top: 91),
child: Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
Text(
"验证码登录",
style: TextStyle(
color: Color(0xff2893FF),
fontWeight: FontWeight.bold,
fontSize: 17),
),
Container(
height: 6,
),
Image.asset(Images.ic_login_mode)
],
),
Text("密码登录",
style: TextStyle(
color: Color(0xff949494),
fontWeight: FontWeight.bold,
fontSize: 17)),
],
),
),
Container(
margin: EdgeInsets.only(top: 26),
child: Stack(
children: [
Container(
child: TextField(
controller: controller,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 19),
hintText: "请输入手机号",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: BorderSide(
color: Color(0xffF1F1F1), width: 1)),
),
),
margin: EdgeInsets.only(left: 32, right: 32),
height: 47,
),
Positioned(
top: 12,
right: 50,
child: Text(
"获取验证码",
style: TextStyle(color: Color(0xff727272)),
))
],
),
),
Container(
child: TextField(
controller: controller,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 19),
hintText: "请输入密码",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: BorderSide(
color: Color(0xffF1F1F1), width: 1)),
),
),
margin: EdgeInsets.only(left: 32, right: 32,top: 11),
height: 47,
),
],
),
),
),
);
}
}
...@@ -28,7 +28,7 @@ class _LayoutGroupState extends State<LayoutPage> { ...@@ -28,7 +28,7 @@ class _LayoutGroupState extends State<LayoutPage> {
body: Container( body: Container(
decoration: BoxDecoration(color: Colors.white), decoration: BoxDecoration(color: Colors.white),
alignment: Alignment.center, alignment: Alignment.center,
child: ListView( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
...@@ -111,13 +111,37 @@ class _LayoutGroupState extends State<LayoutPage> { ...@@ -111,13 +111,37 @@ class _LayoutGroupState extends State<LayoutPage> {
), ),
), ),
), ),
FractionallySizedBox( Container(
height: 50,
width: 200,
decoration: BoxDecoration(color: Colors.blue),
child: FractionallySizedBox(
widthFactor: 1, widthFactor: 1,
child: Row(
children: [
Expanded(
flex: 1,
child: Container( child: Container(
decoration: BoxDecoration(color: Colors.grey), decoration: BoxDecoration(color: Colors.grey),
child: Text('宽度全屏'), child: Text('屏幕的二分之一'),
),
),
Expanded(
flex: 1,
child: Text('屏幕的二分之一'),
)
],
), ),
), ),
),
FractionallySizedBox(
widthFactor: 0.5,
child: Container(
decoration: BoxDecoration(color: Colors.grey),
child: Text('屏幕的二分之一'),
),
),
Stack( Stack(
children: [ children: [
ClipOval( ClipOval(
......
...@@ -5,12 +5,10 @@ import 'Images.dart'; ...@@ -5,12 +5,10 @@ import 'Images.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
@override @override
State createState() { State createState() => _HomePageState();
return _HomePage();
}
} }
class _HomePage extends State { class _HomePageState extends State {
var currentIndex = 0; var currentIndex = 0;
@override @override
...@@ -74,15 +72,24 @@ class _HomePage extends State { ...@@ -74,15 +72,24 @@ class _HomePage extends State {
Expanded( Expanded(
child: RefreshIndicator( child: RefreshIndicator(
onRefresh: handleRefresh, onRefresh: handleRefresh,
child: ListView.builder( child:
padding: EdgeInsets.all(0),
itemCount: 10, ListView.separated(itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context, int index) {
return _item(); return _item();
}, }, separatorBuilder: (BuildContext context, int index) {
), return Text("data");
}, itemCount: 5)
// ListView.builder(
// padding: EdgeInsets.all(0),
// itemCount: 10,
// itemBuilder: (BuildContext context, int index) {
// return _item();
// },
), ),
), ),
// ),
], ],
), ),
); );
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/TestPage.dart';
import 'package:netrain_flutter_app/laishanqi/Login.dart';
import 'laishanqi/Stateful_page.dart'; import 'laishanqi/Stateful_page.dart';
import 'laishanqi/Stateless_page.dart'; import 'laishanqi/Stateless_page.dart';
...@@ -7,9 +9,9 @@ import 'laishanqi/netrain/loginPage.dart'; ...@@ -7,9 +9,9 @@ import 'laishanqi/netrain/loginPage.dart';
import 'laishanqi/photo.dart'; import 'laishanqi/photo.dart';
void main() { void main() {
runApp(MyApp()); // runApp(MyApp());
runApp(Login());
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
// This widget is the root of your application. // This widget is the root of your application.
@override @override
...@@ -61,9 +63,9 @@ class _RouterNavigatorState extends State<RouterNavigator> { ...@@ -61,9 +63,9 @@ class _RouterNavigatorState extends State<RouterNavigator> {
}), }),
_item("less页面", LessGroupPage(), 'less'), _item("less页面", LessGroupPage(), 'less'),
_item("ful页面", FulGroupPage(), 'ful'), _item("ful页面", FulGroupPage(), 'ful'),
_item("layout页面", LayoutPage(), 'layout '), _item("layout页面", LayoutPage(), 'layout'),
_item("拍照页面", PhotoApp(), 'photo '), _item("拍照页面", PhotoApp(), 'photo'),
_item("登陆", LoginPage(), 'login '), _item("登陆", LoginPage(), 'login'),
], ],
), ),
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment