Advertisement
amirrulilham_

Flutter flow drawer ui

Feb 24th, 2023
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 24.83 KB | None | 0 0
  1. import '../flutter_flow/flutter_flow_icon_button.dart';
  2. import '../flutter_flow/flutter_flow_theme.dart';
  3. import '../flutter_flow/flutter_flow_util.dart';
  4. import 'package:easy_debounce/easy_debounce.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:google_fonts/google_fonts.dart';
  7. import 'package:provider/provider.dart';
  8.  
  9. import 'home_page_model.dart';
  10. export 'home_page_model.dart';
  11.  
  12. class HomePageWidget extends StatefulWidget {
  13.   const HomePageWidget({Key? key}) : super(key: key);
  14.  
  15.   @override
  16.   _HomePageWidgetState createState() => _HomePageWidgetState();
  17. }
  18.  
  19. class _HomePageWidgetState extends State<HomePageWidget> {
  20.   late HomePageModel _model;
  21.  
  22.   final scaffoldKey = GlobalKey<ScaffoldState>();
  23.   final _unfocusNode = FocusNode();
  24.  
  25.   @override
  26.   void initState() {
  27.     super.initState();
  28.     _model = createModel(context, () => HomePageModel());
  29.  
  30.     _model.textController ??= TextEditingController();
  31.   }
  32.  
  33.   @override
  34.   void dispose() {
  35.     _model.dispose();
  36.  
  37.     _unfocusNode.dispose();
  38.     super.dispose();
  39.   }
  40.  
  41.   @override
  42.   Widget build(BuildContext context) {
  43.     return Scaffold(
  44.       key: scaffoldKey,
  45.       backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
  46.       drawer: Drawer(
  47.         elevation: 16,
  48.         child: Container(
  49.           width: 100,
  50.           height: 100,
  51.           decoration: BoxDecoration(
  52.             gradient: LinearGradient(
  53.               colors: [Color(0xFFFFA726), Color(0xFFE65100)],
  54.               stops: [0, 1],
  55.               begin: AlignmentDirectional(-1, -1),
  56.               end: AlignmentDirectional(1, 1),
  57.             ),
  58.           ),
  59.           child: ListView(
  60.             padding: EdgeInsets.zero,
  61.             scrollDirection: Axis.vertical,
  62.             children: [
  63.               Padding(
  64.                 padding: EdgeInsetsDirectional.fromSTEB(15, 0, 15, 0),
  65.                 child: Wrap(
  66.                   spacing: 0,
  67.                   runSpacing: 0,
  68.                   alignment: WrapAlignment.start,
  69.                   crossAxisAlignment: WrapCrossAlignment.start,
  70.                   direction: Axis.horizontal,
  71.                   runAlignment: WrapAlignment.start,
  72.                   verticalDirection: VerticalDirection.down,
  73.                   clipBehavior: Clip.none,
  74.                   children: [
  75.                     Container(
  76.                       width: 100,
  77.                       height: 70,
  78.                       decoration: BoxDecoration(
  79.                         color: Color(0x00FFFFFF),
  80.                       ),
  81.                     ),
  82.                     Row(
  83.                       mainAxisSize: MainAxisSize.max,
  84.                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
  85.                       children: [
  86.                         ClipRRect(
  87.                           borderRadius: BorderRadius.circular(10),
  88.                           child: Image.network(
  89.                             'https://picsum.photos/seed/176/600',
  90.                             width: 65,
  91.                             height: 65,
  92.                             fit: BoxFit.cover,
  93.                           ),
  94.                         ),
  95.                         Text(
  96.                           'EPMC App',
  97.                           style:
  98.                               FlutterFlowTheme.of(context).bodyText1.override(
  99.                                     fontFamily: 'Montserrat',
  100.                                     color: FlutterFlowTheme.of(context)
  101.                                         .primaryBackground,
  102.                                     fontSize: 20,
  103.                                   ),
  104.                         ),
  105.                         FlutterFlowIconButton(
  106.                           borderColor: Colors.transparent,
  107.                           borderRadius: 30,
  108.                           borderWidth: 1,
  109.                           buttonSize: 60,
  110.                           icon: Icon(
  111.                             Icons.keyboard_backspace,
  112.                             color: Color(0xFFD43015),
  113.                             size: 30,
  114.                           ),
  115.                           onPressed: () async {
  116.                             Navigator.pop(context);
  117.                           },
  118.                         ),
  119.                       ],
  120.                     ),
  121.                     Container(
  122.                       width: 100,
  123.                       height: 30,
  124.                       decoration: BoxDecoration(
  125.                         color: Color(0x00FFFFFF),
  126.                       ),
  127.                     ),
  128.                     TextFormField(
  129.                       controller: _model.textController,
  130.                       onChanged: (_) => EasyDebounce.debounce(
  131.                         '_model.textController',
  132.                         Duration(milliseconds: 2000),
  133.                         () => setState(() {}),
  134.                       ),
  135.                       autofocus: true,
  136.                       obscureText: false,
  137.                       decoration: InputDecoration(
  138.                         hintText: 'Search...',
  139.                         hintStyle:
  140.                             FlutterFlowTheme.of(context).bodyText2.override(
  141.                                   fontFamily: 'Poppins',
  142.                                   color: Color(0xB2F1F4F8),
  143.                                 ),
  144.                         enabledBorder: OutlineInputBorder(
  145.                           borderSide: BorderSide(
  146.                             color: Color(0x4CFBFBFB),
  147.                             width: 1,
  148.                           ),
  149.                           borderRadius: BorderRadius.circular(10),
  150.                         ),
  151.                         focusedBorder: OutlineInputBorder(
  152.                           borderSide: BorderSide(
  153.                             color: Color(0x00000000),
  154.                             width: 1,
  155.                           ),
  156.                           borderRadius: BorderRadius.circular(10),
  157.                         ),
  158.                         errorBorder: OutlineInputBorder(
  159.                           borderSide: BorderSide(
  160.                             color: Color(0x00000000),
  161.                             width: 1,
  162.                           ),
  163.                           borderRadius: BorderRadius.circular(10),
  164.                         ),
  165.                         focusedErrorBorder: OutlineInputBorder(
  166.                           borderSide: BorderSide(
  167.                             color: Color(0x00000000),
  168.                             width: 1,
  169.                           ),
  170.                           borderRadius: BorderRadius.circular(10),
  171.                         ),
  172.                         filled: true,
  173.                         fillColor: Color(0x1AFBFBFB),
  174.                         prefixIcon: Icon(
  175.                           Icons.search,
  176.                           color: Color(0xB2F1F4F8),
  177.                           size: 20,
  178.                         ),
  179.                         suffixIcon: _model.textController!.text.isNotEmpty
  180.                             ? InkWell(
  181.                                 onTap: () async {
  182.                                   _model.textController?.clear();
  183.                                   setState(() {});
  184.                                 },
  185.                                 child: Icon(
  186.                                   Icons.clear,
  187.                                   color: Color(0xFFD43015),
  188.                                   size: 20,
  189.                                 ),
  190.                               )
  191.                             : null,
  192.                       ),
  193.                       style: FlutterFlowTheme.of(context).bodyText1,
  194.                       validator:
  195.                           _model.textControllerValidator.asValidator(context),
  196.                     ),
  197.                     Container(
  198.                       width: MediaQuery.of(context).size.width,
  199.                       height: 25,
  200.                       decoration: BoxDecoration(
  201.                         color: Color(0x00FFFFFF),
  202.                       ),
  203.                     ),
  204.                     Text(
  205.                       'Menu',
  206.                       style: FlutterFlowTheme.of(context).bodyText1.override(
  207.                             fontFamily: 'Poppins',
  208.                             color: Color(0xB2F1F4F8),
  209.                           ),
  210.                     ),
  211.                     ListTile(
  212.                       leading: Icon(
  213.                         Icons.dashboard_outlined,
  214.                         color: FlutterFlowTheme.of(context).primaryBackground,
  215.                       ),
  216.                       title: Text(
  217.                         'Dashboard',
  218.                         style: GoogleFonts.getFont(
  219.                           'Montserrat',
  220.                           color: Color(0xB2F1F4F8),
  221.                           fontWeight: FontWeight.w500,
  222.                           fontSize: 15,
  223.                         ),
  224.                       ),
  225.                       tileColor: Color(0xFFF5F5F5),
  226.                       dense: false,
  227.                     ),
  228.                     ListTile(
  229.                       leading: Icon(
  230.                         Icons.addchart_outlined,
  231.                         color: FlutterFlowTheme.of(context).primaryBackground,
  232.                       ),
  233.                       title: Text(
  234.                         'Project Details',
  235.                         style: GoogleFonts.getFont(
  236.                           'Montserrat',
  237.                           color: Color(0xB2F1F4F8),
  238.                           fontWeight: FontWeight.w500,
  239.                           fontSize: 15,
  240.                         ),
  241.                       ),
  242.                       tileColor: Color(0xFFF5F5F5),
  243.                       dense: false,
  244.                     ),
  245.                     ListTile(
  246.                       leading: Icon(
  247.                         Icons.library_add_check_outlined,
  248.                         color: FlutterFlowTheme.of(context).primaryBackground,
  249.                       ),
  250.                       title: Text(
  251.                         'Task',
  252.                         style: GoogleFonts.getFont(
  253.                           'Montserrat',
  254.                           color: Color(0xB2F1F4F8),
  255.                           fontWeight: FontWeight.w500,
  256.                           fontSize: 15,
  257.                         ),
  258.                       ),
  259.                       tileColor: Color(0xFFF5F5F5),
  260.                       dense: false,
  261.                     ),
  262.                     ListTile(
  263.                       leading: Icon(
  264.                         Icons.content_paste,
  265.                         color: FlutterFlowTheme.of(context).primaryBackground,
  266.                       ),
  267.                       title: Text(
  268.                         'Material',
  269.                         style: GoogleFonts.getFont(
  270.                           'Montserrat',
  271.                           color: Color(0xB2F1F4F8),
  272.                           fontWeight: FontWeight.w500,
  273.                           fontSize: 15,
  274.                         ),
  275.                       ),
  276.                       tileColor: Color(0xFFF5F5F5),
  277.                       dense: false,
  278.                     ),
  279.                     ListTile(
  280.                       leading: Icon(
  281.                         Icons.library_books_outlined,
  282.                         color: FlutterFlowTheme.of(context).primaryBackground,
  283.                       ),
  284.                       title: Text(
  285.                         'Drawing',
  286.                         style: GoogleFonts.getFont(
  287.                           'Montserrat',
  288.                           color: Color(0xB2F1F4F8),
  289.                           fontWeight: FontWeight.w500,
  290.                           fontSize: 15,
  291.                         ),
  292.                       ),
  293.                       tileColor: Color(0xFFF5F5F5),
  294.                       dense: false,
  295.                     ),
  296.                     Padding(
  297.                       padding: EdgeInsetsDirectional.fromSTEB(10, 15, 10, 15),
  298.                       child: Container(
  299.                         width: MediaQuery.of(context).size.width,
  300.                         height: 3,
  301.                         decoration: BoxDecoration(
  302.                           color: Color(0x1AFBFBFB),
  303.                         ),
  304.                       ),
  305.                     ),
  306.                     ListTile(
  307.                       leading: Icon(
  308.                         Icons.dashboard_outlined,
  309.                         color: FlutterFlowTheme.of(context).primaryBackground,
  310.                       ),
  311.                       title: Text(
  312.                         'Dilapidation Report',
  313.                         style: GoogleFonts.getFont(
  314.                           'Montserrat',
  315.                           color: Color(0xB2F1F4F8),
  316.                           fontWeight: FontWeight.w500,
  317.                           fontSize: 15,
  318.                         ),
  319.                       ),
  320.                       tileColor: Color(0xFFF5F5F5),
  321.                       dense: false,
  322.                     ),
  323.                     ListTile(
  324.                       leading: Icon(
  325.                         Icons.insights_rounded,
  326.                         color: FlutterFlowTheme.of(context).primaryBackground,
  327.                       ),
  328.                       title: Text(
  329.                         'Weekly Report',
  330.                         style: GoogleFonts.getFont(
  331.                           'Montserrat',
  332.                           color: Color(0xB2F1F4F8),
  333.                           fontWeight: FontWeight.w500,
  334.                           fontSize: 15,
  335.                         ),
  336.                       ),
  337.                       tileColor: Color(0xFFF5F5F5),
  338.                       dense: false,
  339.                     ),
  340.                     ListTile(
  341.                       leading: Icon(
  342.                         Icons.dashboard_outlined,
  343.                         color: FlutterFlowTheme.of(context).primaryBackground,
  344.                       ),
  345.                       title: Text(
  346.                         'Project Executive Report',
  347.                         style: GoogleFonts.getFont(
  348.                           'Montserrat',
  349.                           color: Color(0xB2F1F4F8),
  350.                           fontWeight: FontWeight.w500,
  351.                           fontSize: 15,
  352.                         ),
  353.                       ),
  354.                       tileColor: Color(0xFFF5F5F5),
  355.                       dense: false,
  356.                     ),
  357.                     ListTile(
  358.                       leading: Icon(
  359.                         Icons.calendar_today_outlined,
  360.                         color: FlutterFlowTheme.of(context).primaryBackground,
  361.                       ),
  362.                       title: Text(
  363.                         'Master Work Schedule',
  364.                         style: GoogleFonts.getFont(
  365.                           'Montserrat',
  366.                           color: Color(0xB2F1F4F8),
  367.                           fontWeight: FontWeight.w500,
  368.                           fontSize: 15,
  369.                         ),
  370.                       ),
  371.                       tileColor: Color(0xFFF5F5F5),
  372.                       dense: false,
  373.                     ),
  374.                     Padding(
  375.                       padding: EdgeInsetsDirectional.fromSTEB(10, 15, 10, 15),
  376.                       child: Container(
  377.                         width: MediaQuery.of(context).size.width,
  378.                         height: 3,
  379.                         decoration: BoxDecoration(
  380.                           color: Color(0x1AFBFBFB),
  381.                         ),
  382.                       ),
  383.                     ),
  384.                     ListTile(
  385.                       leading: Icon(
  386.                         Icons.payments_outlined,
  387.                         color: FlutterFlowTheme.of(context).primaryBackground,
  388.                       ),
  389.                       title: Text(
  390.                         'Payment',
  391.                         style: GoogleFonts.getFont(
  392.                           'Montserrat',
  393.                           color: Color(0xB2F1F4F8),
  394.                           fontWeight: FontWeight.w500,
  395.                           fontSize: 15,
  396.                         ),
  397.                       ),
  398.                       tileColor: Color(0xFFF5F5F5),
  399.                       dense: false,
  400.                     ),
  401.                     ListTile(
  402.                       leading: Icon(
  403.                         Icons.group_work_outlined,
  404.                         color: FlutterFlowTheme.of(context).primaryBackground,
  405.                       ),
  406.                       title: Text(
  407.                         'Work Inspection',
  408.                         style: GoogleFonts.getFont(
  409.                           'Montserrat',
  410.                           color: Color(0xB2F1F4F8),
  411.                           fontWeight: FontWeight.w500,
  412.                           fontSize: 15,
  413.                         ),
  414.                       ),
  415.                       tileColor: Color(0xFFF5F5F5),
  416.                       dense: false,
  417.                     ),
  418.                     ListTile(
  419.                       leading: Icon(
  420.                         Icons.warning_amber_outlined,
  421.                         color: FlutterFlowTheme.of(context).primaryBackground,
  422.                       ),
  423.                       title: Text(
  424.                         'Warranty',
  425.                         style: GoogleFonts.getFont(
  426.                           'Montserrat',
  427.                           color: Color(0xB2F1F4F8),
  428.                           fontWeight: FontWeight.w500,
  429.                           fontSize: 15,
  430.                         ),
  431.                       ),
  432.                       tileColor: Color(0xFFF5F5F5),
  433.                       dense: false,
  434.                     ),
  435.                     ListTile(
  436.                       leading: Icon(
  437.                         Icons.style,
  438.                         color: FlutterFlowTheme.of(context).primaryBackground,
  439.                       ),
  440.                       title: Text(
  441.                         'Site Memo',
  442.                         style: GoogleFonts.getFont(
  443.                           'Montserrat',
  444.                           color: Color(0xB2F1F4F8),
  445.                           fontWeight: FontWeight.w500,
  446.                           fontSize: 15,
  447.                         ),
  448.                       ),
  449.                       tileColor: Color(0xFFF5F5F5),
  450.                       dense: false,
  451.                     ),
  452.                     Container(
  453.                       width: MediaQuery.of(context).size.width,
  454.                       height: 25,
  455.                       decoration: BoxDecoration(
  456.                         color: Color(0x00FFFFFF),
  457.                       ),
  458.                     ),
  459.                     Padding(
  460.                       padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 25),
  461.                       child: Container(
  462.                         width: MediaQuery.of(context).size.width,
  463.                         decoration: BoxDecoration(
  464.                           color: Color(0x1AFBFBFB),
  465.                           borderRadius: BorderRadius.circular(10),
  466.                         ),
  467.                         child: Padding(
  468.                           padding:
  469.                               EdgeInsetsDirectional.fromSTEB(10, 10, 10, 10),
  470.                           child: Container(
  471.                             width: MediaQuery.of(context).size.width,
  472.                             decoration: BoxDecoration(
  473.                               color: Color(0x00FFFFFF),
  474.                             ),
  475.                             child: Column(
  476.                               mainAxisSize: MainAxisSize.max,
  477.                               crossAxisAlignment: CrossAxisAlignment.start,
  478.                               children: [
  479.                                 Text(
  480.                                   'New Features Available!',
  481.                                   style: FlutterFlowTheme.of(context)
  482.                                       .bodyText1
  483.                                       .override(
  484.                                         fontFamily: 'Poppins',
  485.                                         color: FlutterFlowTheme.of(context)
  486.                                             .primaryBackground,
  487.                                         fontSize: 12,
  488.                                       ),
  489.                                 ),
  490.                                 Padding(
  491.                                   padding: EdgeInsetsDirectional.fromSTEB(
  492.                                       0, 2, 0, 0),
  493.                                   child: Text(
  494.                                     'Check out the new  dashboard view.\nPages and exports now load faster.',
  495.                                     style: FlutterFlowTheme.of(context)
  496.                                         .bodyText1
  497.                                         .override(
  498.                                           fontFamily: 'Poppins',
  499.                                           fontSize: 8,
  500.                                           fontWeight: FontWeight.normal,
  501.                                           lineHeight: 1.2,
  502.                                         ),
  503.                                   ),
  504.                                 ),
  505.                                 Padding(
  506.                                   padding: EdgeInsetsDirectional.fromSTEB(
  507.                                       0, 10, 0, 15),
  508.                                   child: ClipRRect(
  509.                                     borderRadius: BorderRadius.circular(8),
  510.                                     child: Image.network(
  511.                                       'https://picsum.photos/seed/427/600',
  512.                                       width: MediaQuery.of(context).size.width,
  513.                                       height: 130,
  514.                                       fit: BoxFit.cover,
  515.                                     ),
  516.                                   ),
  517.                                 ),
  518.                                 Padding(
  519.                                   padding: EdgeInsetsDirectional.fromSTEB(
  520.                                       10, 0, 10, 0),
  521.                                   child: Row(
  522.                                     mainAxisSize: MainAxisSize.max,
  523.                                     children: [
  524.                                       Text(
  525.                                         'Dismiss',
  526.                                         style: FlutterFlowTheme.of(context)
  527.                                             .bodyText1
  528.                                             .override(
  529.                                               fontFamily: 'Poppins',
  530.                                               color: Color(0x9AF1F4F8),
  531.                                               fontSize: 10,
  532.                                               fontWeight: FontWeight.w600,
  533.                                             ),
  534.                                       ),
  535.                                       Padding(
  536.                                         padding: EdgeInsetsDirectional.fromSTEB(
  537.                                             15, 0, 0, 0),
  538.                                         child: Text(
  539.                                           'What\'s new?',
  540.                                           style: FlutterFlowTheme.of(context)
  541.                                               .bodyText1
  542.                                               .override(
  543.                                                 fontFamily: 'Poppins',
  544.                                                 color:
  545.                                                     FlutterFlowTheme.of(context)
  546.                                                         .primaryBackground,
  547.                                                 fontSize: 10,
  548.                                                 fontWeight: FontWeight.w600,
  549.                                               ),
  550.                                         ),
  551.                                       ),
  552.                                     ],
  553.                                   ),
  554.                                 ),
  555.                               ],
  556.                             ),
  557.                           ),
  558.                         ),
  559.                       ),
  560.                     ),
  561.                   ],
  562.                 ),
  563.               ),
  564.             ],
  565.           ),
  566.         ),
  567.       ),
  568.       appBar: AppBar(
  569.         backgroundColor: FlutterFlowTheme.of(context).primaryColor,
  570.         automaticallyImplyLeading: false,
  571.         title: Text(
  572.           'Page Title',
  573.           style: FlutterFlowTheme.of(context).title2.override(
  574.                 fontFamily: 'Poppins',
  575.                 color: Colors.white,
  576.                 fontSize: 22,
  577.               ),
  578.         ),
  579.         actions: [],
  580.         centerTitle: false,
  581.         elevation: 2,
  582.       ),
  583.       body: SafeArea(
  584.         child: GestureDetector(
  585.           onTap: () => FocusScope.of(context).requestFocus(_unfocusNode),
  586.           child: Column(
  587.             mainAxisSize: MainAxisSize.max,
  588.             children: [],
  589.           ),
  590.         ),
  591.       ),
  592.     );
  593.   }
  594. }
  595.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement