From ebd92b43e9ba1125a21e56af1059cb55e2fe9b9a Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Sun, 31 Mar 2019 18:34:00 -0600 Subject: [PATCH] Created the custom text input for the task text --- lib/src/App.dart | 1 + lib/src/screens/new_task_screen.dart | 11 ++++++ lib/src/widgets/big_text_input.dart | 50 ++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 lib/src/widgets/big_text_input.dart diff --git a/lib/src/App.dart b/lib/src/App.dart index d821dfc..10442ad 100644 --- a/lib/src/App.dart +++ b/lib/src/App.dart @@ -16,6 +16,7 @@ class App extends StatelessWidget { accentColor: Color(0xFF707070), canvasColor: Color.fromRGBO(23, 25, 29, 1.0), cardColor: Color.fromRGBO(36, 39, 44, 1.0), + cursorColor: Color.fromRGBO(112, 112, 112, 1), fontFamily: 'IBM Plex Sans', ), ); diff --git a/lib/src/screens/new_task_screen.dart b/lib/src/screens/new_task_screen.dart index 78594aa..0e2c221 100644 --- a/lib/src/screens/new_task_screen.dart +++ b/lib/src/screens/new_task_screen.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../blocs/new_task_bloc.dart'; import '../widgets/custom_app_bar.dart'; +import '../widgets/big_text_input.dart'; class NewTaskScreen extends StatefulWidget { @override @@ -16,6 +17,16 @@ class _NewTaskScreenState extends State { appBar: CustomAppBar( title: 'Add task', ), + body: Padding( + padding: const EdgeInsets.only(top: 15.0, left: 20.0, right: 20.0), + child: Column( + children: [ + BigTextInput( + height: 95, + ), + ], + ), + ), ); } } diff --git a/lib/src/widgets/big_text_input.dart b/lib/src/widgets/big_text_input.dart new file mode 100644 index 0000000..770c751 --- /dev/null +++ b/lib/src/widgets/big_text_input.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; + +class BigTextInput extends StatelessWidget { + final double height; + final double width; + + BigTextInput({ + this.height, + this.width, + }); + + Widget build(BuildContext context) { + return Material( + child: ConstrainedBox( + constraints: BoxConstraints( + minWidth: 100, + minHeight: 50, + ), + child: Container( + width: width, + height: height, + decoration: BoxDecoration( + color: Theme.of(context).cardColor, + borderRadius: BorderRadius.circular(8.0), + ), + child: TextField( + maxLines: 3, + maxLength: 220, + maxLengthEnforced: true, + cursorColor: Theme.of(context).cursorColor, + textInputAction: TextInputAction.done, + style: TextStyle( + color: Colors.white, + fontSize: 16, + ), + decoration: InputDecoration( + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0), + counterStyle: TextStyle(color: Colors.white), + hintText: 'Do something...', + hintStyle: TextStyle( + color: Theme.of(context).cursorColor, + ), + ), + ), + ), + ), + ); + } +}