Mr_HO1A

Home

Feb 19th, 2019
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 4.50 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. // Search Result Class
  4. import './search.dart';
  5.  
  6.  
  7. void main() => runApp(home());
  8.  
  9. class home extends StatefulWidget {
  10.   @override
  11.   _homeState createState() => _homeState();
  12. }
  13.  
  14. class _homeState extends State<home> {
  15.  
  16.   @override
  17.   Widget build(BuildContext context) {
  18.     SystemChrome.setPreferredOrientations([
  19.       DeviceOrientation.portraitUp,
  20.       DeviceOrientation.portraitDown,
  21.     ]);
  22.     return new MaterialApp(
  23.       theme: ThemeData(primaryColor: Colors.greenAccent),
  24.       routes: <String, WidgetBuilder>{
  25.         "/search":(BuildContext context)=>new search(titleName: "State Bank",)
  26.       },
  27.       home: new Scaffold(
  28.         resizeToAvoidBottomPadding: false,
  29.         body: new Stack(
  30.           fit: StackFit.passthrough,
  31.           children: <Widget>[
  32.             new Container(
  33.               child: new Column(
  34.                 children: <Widget>[
  35.                   Padding(
  36.                     padding: EdgeInsets.only(bottom: 280.0),
  37.                   ),
  38.                   new Container(
  39.                     padding: EdgeInsets.all(8.0),
  40.                     child: Image(
  41.                       image:
  42.                           AssetImage("assets/images/homeBackgroundImage.png"),
  43.                     ),
  44.                   ),
  45.                 ],
  46.               ),
  47.             ),
  48.             new SafeArea(
  49.               child: new Center(
  50.                 child: new Column(
  51.                   crossAxisAlignment: CrossAxisAlignment.center,
  52.                   mainAxisAlignment: MainAxisAlignment.start,
  53.                   children: <Widget>[
  54.                     Padding(
  55.                       padding: EdgeInsets.only(top: 15.0),
  56.                     ),
  57.                     Image(
  58.                       image: AssetImage("assets/images/cisco.png"),
  59.                       width: 150.0,
  60.                       height: 29.0,
  61.                     ),
  62.                     Padding(
  63.                       padding: EdgeInsets.only(top: 100.0),
  64.                     ),
  65.                     Text(
  66.                       "Enter Search Query",
  67.                       style: TextStyle(fontSize: 20.0),
  68.                     ),
  69.                     Padding(
  70.                       padding: EdgeInsets.only(top: 10.0),
  71.                     ),
  72.                     FractionallySizedBox(
  73.                       widthFactor: 0.75,
  74.                       child: TextField(
  75.                         enabled: true,
  76.                         decoration: InputDecoration(
  77.                           contentPadding: EdgeInsets.only(top: 20.0, left: 8.0),
  78.                           border: OutlineInputBorder(
  79.                             borderRadius: BorderRadius.all(Radius.circular(0)),
  80.                           ),
  81.                           enabledBorder: OutlineInputBorder(
  82.                               borderSide: BorderSide(
  83.                             color: Colors.greenAccent,
  84.                           )),
  85.                           disabledBorder: UnderlineInputBorder(
  86.                               borderSide: BorderSide(color: Colors.brown)),
  87.                         ),
  88.                         textAlign: TextAlign.center,
  89.                       ),
  90.                     ),
  91.                     Padding(
  92.                       padding: EdgeInsets.only(top: 10.0),
  93.                     ),
  94.                     RaisedButton(
  95.                       onPressed: (){
  96.                         Navigator.pushNamed(context, "/search");
  97.                       },
  98.                       elevation: 1,
  99.                       child: Text(
  100.                         "Search",
  101.                         style: TextStyle(color: Colors.white),
  102.                       ),
  103.                       color: Colors.greenAccent,
  104.                     ),
  105.                   ],
  106.                 ),
  107.               ),
  108.             ),
  109.             Positioned(
  110.               child: Align(
  111.                 alignment: FractionalOffset.bottomCenter,
  112.                 child: Container(
  113.                   padding: EdgeInsets.all(8.0),
  114.                   decoration: BoxDecoration(color: Colors.greenAccent),
  115.                   child: Row(
  116.                     children: <Widget>[
  117.                       new Text(
  118.                         "FAQ",
  119.                         style: TextStyle(color: Colors.white, fontSize: 28.0),
  120.                       )
  121.                     ],
  122.                   ),
  123.                 ),
  124.               ),
  125.             )
  126.           ],
  127.         ),
  128.       ),
  129.     );
  130.   }
  131. }
Add Comment
Please, Sign In to add comment