Skip to content

Instantly share code, notes, and snippets.

@eEQK
Created Jun 6, 2021
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