|
@@ -1,8 +1,10 @@
|
1
|
1
|
|
2
|
2
|
import 'package:farmer_client/models/Store.dart';
|
3
|
3
|
import 'package:farmer_client/services/user.dart';
|
|
4
|
+import 'package:farmer_client/widgets/Cell.dart';
|
4
|
5
|
import 'package:farmer_client/widgets/GradientButton.dart';
|
5
|
6
|
import 'package:flutter/material.dart';
|
|
7
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
6
|
8
|
import 'package:get/get.dart';
|
7
|
9
|
|
8
|
10
|
void main() {
|
|
@@ -16,7 +18,6 @@ class MyApp extends StatelessWidget {
|
16
|
18
|
@override
|
17
|
19
|
Widget build(BuildContext context) {
|
18
|
20
|
Store().init();
|
19
|
|
-
|
20
|
21
|
return MaterialApp(
|
21
|
22
|
title: 'Flutter Demo',
|
22
|
23
|
theme: ThemeData(
|
|
@@ -75,6 +76,15 @@ class _MyHomePageState extends State<MyHomePage> {
|
75
|
76
|
@override
|
76
|
77
|
Widget build(BuildContext context) {
|
77
|
78
|
|
|
79
|
+ ScreenUtil.init(
|
|
80
|
+ BoxConstraints(
|
|
81
|
+ maxWidth: MediaQuery.of(context).size.width,
|
|
82
|
+ maxHeight: MediaQuery.of(context).size.height),
|
|
83
|
+ designSize: const Size(375, 812),
|
|
84
|
+ context: context,
|
|
85
|
+ minTextAdapt: true,
|
|
86
|
+ orientation: Orientation.portrait);
|
|
87
|
+
|
78
|
88
|
// var find = Get.find(tag: 'user');
|
79
|
89
|
|
80
|
90
|
// This method is rerun every time setState is called, for instance as done
|
|
@@ -116,10 +126,36 @@ class _MyHomePageState extends State<MyHomePage> {
|
116
|
126
|
'$_counter',
|
117
|
127
|
style: Theme.of(context).textTheme.headline4,
|
118
|
128
|
),
|
119
|
|
- GradientButton(
|
120
|
|
- colors: const [Colors.orange, Colors.red],
|
121
|
|
- child: const Text("Submit"),
|
122
|
|
- onPressed: onTap,
|
|
129
|
+ Cell(
|
|
130
|
+ margin: EdgeInsets.symmetric(horizontal: 13.w),
|
|
131
|
+ header: Text("+86", style: TextStyle(fontSize: 19.sp),),
|
|
132
|
+ child: TextField(
|
|
133
|
+ style: TextStyle(
|
|
134
|
+ fontSize: 17.sp,
|
|
135
|
+ ),
|
|
136
|
+ decoration: const InputDecoration(
|
|
137
|
+ isCollapsed:true,
|
|
138
|
+ contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
139
|
+ labelText: "请输入手机号码",
|
|
140
|
+ border: InputBorder.none,
|
|
141
|
+ // border: OutlineInputBorder(
|
|
142
|
+ // // borderSide: BorderSide.none,
|
|
143
|
+ // // gapPadding: 0,
|
|
144
|
+ // ),
|
|
145
|
+ floatingLabelBehavior: FloatingLabelBehavior.never,
|
|
146
|
+ )
|
|
147
|
+ ),
|
|
148
|
+ footer: ElevatedButton(
|
|
149
|
+ onPressed: () => {},
|
|
150
|
+ child: Text("获取验证码", style: TextStyle(fontSize: 15.sp),),
|
|
151
|
+ style: ElevatedButton.styleFrom(
|
|
152
|
+ primary: const Color(0xFFFF703B),
|
|
153
|
+ elevation: 0,
|
|
154
|
+ shape: const RoundedRectangleBorder(
|
|
155
|
+ borderRadius: BorderRadius.all(Radius.circular(10))
|
|
156
|
+ )
|
|
157
|
+ ),
|
|
158
|
+ ),
|
123
|
159
|
),
|
124
|
160
|
],
|
125
|
161
|
),
|