liuyuqi-dellpc 2 years ago
parent
commit
f864724b30
5 changed files with 32 additions and 32 deletions
  1. 2 2
      lib/models/config.dart
  2. 3 3
      lib/pages/home_page.dart
  3. 13 15
      lib/pages/login_page.dart
  4. 12 10
      lib/views/login_card.dart
  5. 2 2
      lib/views/social_icon.dart

+ 2 - 2
lib/models/config.dart

@@ -12,8 +12,8 @@ class Config {
   static const kPrimaryColor = Color(0xFF3382CC);
   static final kShadowColor = const Color(0xFFB7B7B7).withOpacity(.16);
   static final kActiveShadowColor = const Color(0xFF4056C6).withOpacity(.15);
-  static final kFaceBookColor = const Color(0xFF102397);
-  static final kGoogleColor = const Color(0xFFff4f38);
+  static const kFaceBookColor = Color(0xFF102397);
+  static const kGoogleColor = Color(0xFFff4f38);
 // Text Style
   static const kHeadingTextStyle = TextStyle(
     fontSize: 22,

+ 3 - 3
lib/pages/home_page.dart

@@ -15,10 +15,10 @@ class _HomePageState extends State<HomePage> {
   Widget build(BuildContext context) {
     return Scaffold(
       appBar: AppBar(
-        actions: [],
-        title: Text("xxx"),
+        actions: const [],
+        title: const Text("xxx"),
       ),
-      body: Text("x"),
+      body: const Text("x"),
     );
   }
 }

+ 13 - 15
lib/pages/login_page.dart

@@ -62,21 +62,19 @@ class _LoginPageState extends State<LoginPage> {
                       ],
                     ),
                     InkWell(
-                      child: Container(
-                        child: Material(
-                          color: Colors.transparent,
-                          child: InkWell(
-                              onTap: () {},
-                              child: const Center(
-                                child: Text(
-                                  "SIGNIN",
-                                  style: TextStyle(
-                                      color: Colors.white,
-                                      fontSize: 18,
-                                      letterSpacing: 1),
-                                ),
-                              )),
-                        ),
+                      child: Material(
+                        color: Colors.transparent,
+                        child: InkWell(
+                            onTap: () {},
+                            child: const Center(
+                              child: Text(
+                                "SIGNIN",
+                                style: TextStyle(
+                                    color: Colors.white,
+                                    fontSize: 18,
+                                    letterSpacing: 1),
+                              ),
+                            )),
                       ),
                     ),
                     SizedBox(

+ 12 - 10
lib/views/login_card.dart

@@ -1,14 +1,16 @@
 import 'package:flutter/material.dart';
 
 class CardLogin extends StatelessWidget {
+
   bool passwordInvisible = true;
   CardLogin({super.key});
 
   @override
   Widget build(BuildContext context) {
+    
     return Container(
       width: double.infinity,
-      padding: EdgeInsets.only(bottom: 1),
+      padding: const EdgeInsets.only(bottom: 1),
       decoration: BoxDecoration(
         color: Colors.white,
         borderRadius: BorderRadius.circular(8),
@@ -26,30 +28,30 @@ class CardLogin extends StatelessWidget {
         ],
       ),
       child: Padding(
-        padding: EdgeInsets.only(left: 16, right: 16, top: 16),
+        padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
         child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
-          Text("Login", style: TextStyle(fontSize: 45, letterSpacing: .6)),
-          SizedBox(
+          const Text("Login", style: TextStyle(fontSize: 45, letterSpacing: .6)),
+          const SizedBox(
             height: 30,
           ),
-          Text(
+          const Text(
             "Username",
             style: TextStyle(fontSize: 26),
           ),
-          TextField(
+          const TextField(
               decoration: InputDecoration(
             hintText: "Username",
             hintStyle: TextStyle(color: Colors.grey, fontSize: 12),
           )),
-          SizedBox(
+          const SizedBox(
             height: 30,
           ),
-          Text("Password", style: TextStyle(fontSize: 26)),
+          const Text("Password", style: TextStyle(fontSize: 26)),
           TextFormField(
             obscureText: true,
             decoration: InputDecoration(
               hintText: "********",
-              hintStyle: TextStyle(color: Colors.grey, fontSize: 12),
+              hintStyle: const TextStyle(color: Colors.grey, fontSize: 12),
               suffixIcon: IconButton(
                 icon: Icon(passwordInvisible
                     ? Icons.visibility_off
@@ -58,7 +60,7 @@ class CardLogin extends StatelessWidget {
               ),
             ),
           ),
-          SizedBox(
+          const SizedBox(
             height: 35,
           )
         ]),

+ 2 - 2
lib/views/social_icon.dart

@@ -22,13 +22,13 @@ class SocialIcon extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return Padding(
-      padding: EdgeInsets.only(left: 14),
+      padding: const EdgeInsets.only(left: 14),
       child: Container(
         width: 45,
         height: 45,
         decoration: BoxDecoration(shape: BoxShape.circle, color: color),
         child: RawMaterialButton(
-          shape: CircleBorder(),
+          shape: const CircleBorder(),
           onPressed: () {
             press();
           },