side_inputs 0.0.1
side_inputs: ^0.0.1 copied to clipboard
A new Flutter package project.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:side_inputs/side_inputs.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:i_sizing/i_sizing.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
accentColor: const Color(0xFF3FA99D),
appBarTheme: const AppBarTheme(color: Color(0xFF3FA99D)),
// primaryColor: Colors.black,
primarySwatch: Colors.grey,
errorColor: const Color(0xffA93F3F),
fixTextFieldOutlineLabel: true,
textSelectionTheme: TextSelectionThemeData(
cursorColor: Colors.black,
)),
home: const HomePage(),
);
}
}
class HomePage extends HookWidget {
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
final _controller = useTextEditingController();
final i = 1.i(mediaSize: size);
return Scaffold(
body: Container(
child: Form(
key: formKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SideText(
text: 'This is the best fried chicken I have had all day.',
border: false,
),
SideText(
text: 'This is the best fried chicken I have had all day. With borders',
),
EmailInput(
inputKey: 'email',
isValid: false,
autoValidate: true,
onEditCompleteDone: false,
onChanged: (_) {},
),
EmailInput(
inputKey : 'email',
isValid: false,
autoValidate: true,
onEditCompleteDone: false,
),
NameInput(inputKey: 'name', isValid: false, autoValidate: true),
],
),
),
),
);
}
}
final GlobalKey<FormState> formKey = GlobalKey<FormState>();