Skip to content

Instantly share code, notes, and snippets.

@eEQK
Created June 6, 2021 13:48
Show Gist options
  • Save eEQK/777892f64e0aa5d36e0995ed5ca00f68 to your computer and use it in GitHub Desktop.
Save eEQK/777892f64e0aa5d36e0995ed5ca00f68 to your computer and use it in GitHub Desktop.
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