Created
May 4, 2023 15:38
-
-
Save rubywai/4e518f8ed213c388de492de79ab35605 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //debug release profile | |
| //assets file binary network | |
| //container | |
| // Material , Cupertino | |
| //Stateless .Stateful | |
| //row column wrap container stack | |
| //listview gridview | |
| import 'package:flutter/material.dart'; | |
| //asset file network memory | |
| void main() { | |
| runApp( MaterialApp(debugShowCheckedModeBanner: false, | |
| theme: ThemeData.light().copyWith( | |
| inputDecorationTheme: const InputDecorationTheme( | |
| border: OutlineInputBorder( | |
| borderSide: BorderSide(color: Colors.blue) | |
| ), | |
| focusedBorder: OutlineInputBorder( | |
| borderRadius: BorderRadius.all(Radius.circular(20)), | |
| borderSide: BorderSide(color: Colors.green) | |
| ), | |
| enabledBorder: OutlineInputBorder( | |
| borderSide: BorderSide(color: Colors.indigo) | |
| ) | |
| ) | |
| ), | |
| home: Home())); | |
| } | |
| //List ListView.builder() ListView.separeate() | |
| //gridview | |
| class Home extends StatefulWidget { | |
| @override | |
| State<Home> createState() => _HomeState(); | |
| } | |
| class _HomeState extends State<Home> { | |
| TextEditingController _nameController = TextEditingController(); | |
| TextEditingController _phoneController = TextEditingController(); | |
| TextEditingController _passwordController = TextEditingController(); | |
| String _info = ''; | |
| //positioned | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: const Text('Stack Lesson'), | |
| ), | |
| body: Center( | |
| child: Padding( | |
| padding: const EdgeInsets.symmetric(horizontal: 40,vertical: 8), | |
| child: SingleChildScrollView( | |
| child: Column( | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: [ | |
| TextField( | |
| controller: _nameController, | |
| decoration: const InputDecoration( | |
| prefixIcon: Icon(Icons.person), | |
| labelText: 'Enter your name', | |
| ), | |
| ), | |
| const SizedBox(height: 10,), | |
| TextField( | |
| controller: _phoneController, | |
| decoration: const InputDecoration( | |
| labelText: 'Enter you phone number', | |
| prefixIcon: Icon(Icons.phone) | |
| ), | |
| ), | |
| const SizedBox(height: 10,), | |
| TextField( | |
| obscureText: true, | |
| controller: _passwordController, | |
| decoration: const InputDecoration( | |
| suffixIcon: Icon(Icons.visibility), | |
| prefixIcon: Icon(Icons.lock), | |
| labelText: 'Enter your password' | |
| ), | |
| ), | |
| SizedBox(height: 10,), | |
| TextField( | |
| textAlign: TextAlign.center, | |
| maxLines: 6, | |
| minLines: 3, | |
| decoration: InputDecoration( | |
| ), | |
| ), | |
| Padding( | |
| padding: const EdgeInsets.all(8.0), | |
| child: Text(_info,style: const TextStyle(fontSize: 20,color: Colors.black),), | |
| ), | |
| OutlinedButton(onPressed: (){ | |
| setState(() { | |
| _info = "Name is ${_nameController.text} \n Phone is ${_phoneController.text}\n" | |
| "Password is ${_passwordController.text}"; | |
| }); | |
| }, child: const Text('Generate Profile')) | |
| ], | |
| ), | |
| ), | |
| ), | |
| ) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment