main_text_field 0.0.11 main_text_field: ^0.0.11 copied to clipboard
A customizable Flutter form field widget for inputs like text, email, password, and phone, offering validation, appearance options, and keyboard interaction support.
import 'package:flutter/material.dart';
import 'package:main_text_field/main_text_field.dart';
import 'package:smart_localize/smart_localize.dart';
import 'home_screen.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
MainWidgetsUtil.init(context, designSize: const Size(375, 812));
});
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
supportedLocales: const [
Locale('en'),
Locale('ar'),
],
locale: const Locale('ar'),
localeResolutionCallback: (locale, supportedLocales) =>
locale ?? const Locale('ar'),
localizationsDelegates: context.smartLocalizeDelegates,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const HomeScreen(),
);
}
}