Guest User

Flutter 4programmers

a guest
Jul 25th, 2019
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 6.82 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:line_icons/line_icons.dart';
  3.  
  4. class ConfigScreen extends StatefulWidget {
  5.   @override
  6.   _ConfigScreenState createState() => _ConfigScreenState();
  7. }
  8.  
  9. class _ConfigScreenState extends State<ConfigScreen> {
  10.   @override
  11.   Widget build(BuildContext context) {
  12.     return Scaffold(
  13.       backgroundColor: Color(0xfff2f3fa),
  14.       appBar: AppBar(
  15.         iconTheme: IconThemeData(color: Color(0xff71808f)),
  16.         title: Text('Konfiguracja'),
  17.         brightness: Brightness.light,
  18.         elevation: 0.0,
  19.       ),
  20.       body: Builder(
  21.         builder: (context) => Container(
  22.           margin: EdgeInsets.all(15.0),
  23.           child: Form(
  24.             child: SingleChildScrollView(
  25.               child: Column(
  26.                 children: <Widget>[
  27.                   Padding(
  28.                     padding: EdgeInsets.all(8.0),
  29.                     child: TextField(
  30.                       autofocus: false,
  31.                       decoration: InputDecoration(
  32.                         icon: Icon(LineIcons.envelope),
  33.                         filled: true,
  34.                         fillColor: Colors.white,
  35.                         border: InputBorder.none,
  36.                         hintText: 'Email',
  37.                         contentPadding: const EdgeInsets.only(
  38.                             left: 14.0, bottom: 8.0, top: 8.0),
  39.                         enabledBorder: OutlineInputBorder(
  40.                           borderSide: BorderSide(
  41.                             color: Color(0xffced4da),
  42.                             width: 0.7,
  43.                           ),
  44.                           borderRadius: BorderRadius.circular(15.0),
  45.                         ),
  46.                         focusedBorder: OutlineInputBorder(
  47.                           borderSide: BorderSide(
  48.                             color: Color(0xffced4da),
  49.                             width: 0.7,
  50.                           ),
  51.                           borderRadius: BorderRadius.circular(15.0),
  52.                         ),
  53.                       ),
  54.                       textInputAction: TextInputAction.next,
  55.                     ),
  56.                   ),
  57.                   Padding(
  58.                     padding: EdgeInsets.all(8.0),
  59.                     child: TextField(
  60.                       obscureText: true,
  61.                       autofocus: false,
  62.                       decoration: InputDecoration(
  63.                         icon: Icon(LineIcons.key),
  64.                         filled: true,
  65.                         fillColor: Colors.white,
  66.                         border: InputBorder.none,
  67.                         hintText: 'Hasło',
  68.                         contentPadding: const EdgeInsets.only(
  69.                             left: 14.0, bottom: 8.0, top: 8.0),
  70.                         enabledBorder: OutlineInputBorder(
  71.                           borderSide: BorderSide(
  72.                             color: Color(0xffced4da),
  73.                             width: 0.7,
  74.                           ),
  75.                           borderRadius: BorderRadius.circular(15.0),
  76.                         ),
  77.                         focusedBorder: OutlineInputBorder(
  78.                           borderSide: BorderSide(
  79.                             color: Color(0xffced4da),
  80.                             width: 0.7,
  81.                           ),
  82.                           borderRadius: BorderRadius.circular(15.0),
  83.                         ),
  84.                       ),
  85.                       textInputAction: TextInputAction.next,
  86.                     ),
  87.                   ),
  88.                   Padding(
  89.                     padding: EdgeInsets.all(8.0),
  90.                     child: TextField(
  91.                       autofocus: false,
  92.                       decoration: InputDecoration(
  93.                         icon: Icon(LineIcons.globe),
  94.                         filled: true,
  95.                         fillColor: Colors.white,
  96.                         border: InputBorder.none,
  97.                         hintText: 'Adres do PaneluOptimo',
  98.                         contentPadding: const EdgeInsets.only(
  99.                             left: 14.0, bottom: 8.0, top: 8.0),
  100.                         enabledBorder: OutlineInputBorder(
  101.                           borderSide: BorderSide(
  102.                             color: Color(0xffced4da),
  103.                             width: 0.7,
  104.                           ),
  105.                           borderRadius: BorderRadius.circular(15.0),
  106.                         ),
  107.                         focusedBorder: OutlineInputBorder(
  108.                           borderSide: BorderSide(
  109.                             color: Color(0xffced4da),
  110.                             width: 0.7,
  111.                           ),
  112.                           borderRadius: BorderRadius.circular(15.0),
  113.                         ),
  114.                       ),
  115.                       textInputAction: TextInputAction.next,
  116.                     ),
  117.                   ),
  118.                   Padding(
  119.                     padding: EdgeInsets.all(8.0),
  120.                     child: ButtonTheme(
  121.                       minWidth: double.infinity,
  122.                       child: RaisedButton(
  123.                         elevation: 6.0,
  124.                         color: Color(0xff888c8f),
  125.                         textColor: Colors.white,
  126.                         child: Row(
  127.                           mainAxisAlignment: MainAxisAlignment.center,
  128.                           children: <Widget>[
  129.                             Icon(LineIcons.save),
  130.                             Text(
  131.                               'ZAPISZ',
  132.                               style: TextStyle(fontFamily: 'Poppins_Bold'),
  133.                             )
  134.                           ],
  135.                         ),
  136.                         shape: RoundedRectangleBorder(
  137.                             borderRadius: BorderRadius.circular(15.0)),
  138.                         onPressed: () {
  139.                           Scaffold.of(context).showSnackBar(
  140.                             SnackBar(
  141.                               backgroundColor: Colors.green,
  142.                               content: Row(
  143.                                   mainAxisAlignment: MainAxisAlignment.center,
  144.                                   children: <Widget>[
  145.                                     Icon(LineIcons.check),
  146.                                     Text(
  147.                                       'Ustawienia zapisane!',
  148.                                       style:
  149.                                           TextStyle(fontFamily: 'Poppins_Bold'),
  150.                                     ),
  151.                                   ]),
  152.                             ),
  153.                           );
  154.                         },
  155.                       ),
  156.                     ),
  157.                   ),
  158.                 ],
  159.               ),
  160.             ),
  161.           ),
  162.         ),
  163.       ),
  164.     );
  165.   }
  166. }
Advertisement
Add Comment
Please, Sign In to add comment