Created the custom text input for the task text

This commit is contained in:
Mariano Uvalle 2019-03-31 18:34:00 -06:00
parent 897b9fa6a7
commit ebd92b43e9
3 changed files with 62 additions and 0 deletions

View file

@ -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',
),
);

View file

@ -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<NewTaskScreen> {
appBar: CustomAppBar(
title: 'Add task',
),
body: Padding(
padding: const EdgeInsets.only(top: 15.0, left: 20.0, right: 20.0),
child: Column(
children: <Widget>[
BigTextInput(
height: 95,
),
],
),
),
);
}
}

View file

@ -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,
),
),
),
),
),
);
}
}