Skip to content

Instantly share code, notes, and snippets.

@eEQK
Created June 6, 2021 13:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(body: Test()),
);
}
}
class Test extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
elevation: 3,
borderRadius: BorderRadius.circular(25),
color: Colors.black,
child: TextFormField(
autocorrect: false,
validator: (value) =>
(value?.isEmpty ?? false) ? 'Field is required' : null,
autovalidateMode: AutovalidateMode.always,
decoration: InputDecoration(
filled: true,
fillColor: Colors.amber,
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment