Flutter 金融应用程序的 UI

Posted 萌小肆聊编程

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Flutter 金融应用程序的 UI相关的知识,希望对你有一定的参考价值。

本文主要介绍金融应用程序的 UI

Flutter 金融应用程序的 UI

在本教程中,我将向您展示如何使用 Flutter 和 android studio

class CreditCard extends StatelessWidget {


  @override
  Widget build(BuildContext context) {
    final bottom = MediaQuery.of(context).viewInsets.bottom;
    return Scaffold(
      resizeToAvoidBottomPadding: false,
      resizeToAvoidBottomInset: false,
      body: SingleChildScrollView(
        padding: EdgeInsets.only(bottom: bottom),
        reverse: true,
        child: SafeArea(
          child: Padding(
            padding: const EdgeInsets.fromLTRB(12.0,12.0,12.0,0),
            child: Column(
              children: <Widget>[
               Card(
                 child: Stack(
                   children: <Widget>[
                     Image.asset("assets/credit_card.png",fit: BoxFit.fill,),
                     Padding(
                       padding: const EdgeInsets.all(18.0),
                       child: Column(
                         mainAxisAlignment: MainAxisAlignment.center,
                         crossAxisAlignment: CrossAxisAlignment.stretch,
                         children: <Widget>[
                           Padding(
                             padding: const EdgeInsets.symmetric(vertical:16.0, horizontal: 8.0),
                             child: Text(
                                 "**** **** **** 6543",
                               style: TextStyle(
                                 fontSize: 28.0,
                                 color: Colors.white
                               ),
                             ),
                           ),
                           SizedBox(
                             height: 20.0,
                           ),
                           Row(
                             children: <Widget>[
                               Column(
                                 children: <Widget>[
                                   Text(
                                     "Expiry",
                                     style: TextStyle(
                                       color: Colors.white,
                                       fontSize: 22.0
                                     ),
                                   ),
                                   SizedBox(
                                     height: 10.0,
                                   ),
                                   Text(
                                     "MM/YY",
                                     style: TextStyle(
                                       color: Colors.white,
                                       fontSize: 18.0,
                                     ),
                                   )
                                 ],
                               ),
                               SizedBox(
                                 width: 50.0,
                               ),
                               Column(
                                 children: <Widget>[
                                   Text(
                                     "CVV",
                                     style: TextStyle(
                                         color: Colors.white,
                                         fontSize: 22.0
                                     ),
                                   ),
                                   SizedBox(
                                     height: 10.0,
                                   ),
                                   Text(
                                     "****",
                                     style: TextStyle(
                                       color: Colors.white,
                                       fontSize: 18.0,
                                     ),
                                   )
                                 ],
                               )
                             ],
                           ),
                           SizedBox(
                             height: 8.0,
                           ),
                           Text(
                             "Card Holder",
                             style: TextStyle(
                               color: Colors.white,
                               fontSize: 28.0
                             ),
                             textAlign: TextAlign.end,

                           ),

                         ],
                       ),
                     ),
                   ],
                 ),
                 elevation: 5.0,
                 clipBehavior: Clip.antiAliasWithSaveLayer,
                 semanticContainer: true,
                 shape: RoundedRectangleBorder(
                   borderRadius: BorderRadius.circular(12.0)
                 ),
               ),
                SizedBox(
                  height: 20.0,
                ),
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child:Column(
                    children: <Widget>[
                      TextFormField(
                        decoration: InputDecoration(
                          border: OutlineInputBorder(
                            borderRadius: BorderRadius.circular(8.0),
                            borderSide: BorderSide(),
                          ),
                          labelText: "Credit Card Number",
                          labelStyle: TextStyle(
                            fontSize: 18.0
                          )
                        ),
                      ),
                      SizedBox(
                        height: 20.0,
                      ),
                      TextFormField(
                        decoration: InputDecoration(
                            border: OutlineInputBorder(
                              borderRadius: BorderRadius.circular(8.0),
                              borderSide: BorderSide(),
                            ),
                            labelText: "Credit Card Expiry Date",
                            labelStyle: TextStyle(
                                fontSize: 18.0
                            )
                        ),
                      ),
                      SizedBox(
                        height: 20.0,
                      ),
                      TextFormField(
                        decoration: InputDecoration(
                            border: OutlineInputBorder(
                              borderRadius: BorderRadius.circular(8.0),
                              borderSide: BorderSide(),
                            ),
                            labelText: "Credit Card Code",
                            labelStyle: TextStyle(
                                fontSize: 18.0
                            )
                        ),
                      ),
                      SizedBox(
                        height: 20.0,
                      ),
                      TextFormField(
                        decoration: InputDecoration(
                            border: OutlineInputBorder(
                              borderRadius: BorderRadius.circular(8.0),
                              borderSide: BorderSide(),
                            ),
                            labelText: "Credit Card Hodler Name",
                            labelStyle: TextStyle(
                                fontSize: 18.0
                            )
                        ),
                      ),
                      SizedBox(
                        height: 20.0,
                      ),
                      FlatButton(
                        color: Colors.pink,
                        onPressed: (){},
                        shape: StadiumBorder(),
                        child: Padding(
                          padding: const EdgeInsets.symmetric(horizontal: 50.0, vertical: 12.0),
                          child: Text(
                              "Pay",
                            style: TextStyle(
                              color: Colors.white,
                              fontSize: 22.0
                            ),

                          ),
                        ),
                      )
                    ],
                  )
                )
              ],
            ),
          ),
        ),
      ),
    );
  }
}


以上是关于Flutter 金融应用程序的 UI的主要内容,如果未能解决你的问题,请参考以下文章

如何在集成了 Flutter 模块的 Android 应用上运行 UI 测试?

Flutter:从 UI 调用异步代码的最佳实践

抖音实战Flutter

Flutterflutter doctor 报错Android license status unknown. Run `flutter doctor --android-licenses‘(代码片段

从为移动设备开发的相同代码库为 Flutter Web 开发单独的 UI

错误记录Flutter 混合开发获取 BinaryMessenger 报错 ( FlutterActivityAndFragmentDelegate.getFlutterEngine() )(代码片段