├── Glass_Button_Custom ├── UI.PNG ├── custom_glass_button.dart └── glass_page.dart ├── Login_Instagram_Clone ├── UI.png ├── assets │ └── images │ │ ├── fb_icon.png │ │ └── instagram_icon.png └── insta_login.dart ├── Login_Simple ├── UI.png └── login.dart ├── Login_Simple_2 ├── UI.png └── login_page.dart ├── Login_Simple_3 ├── UI.png ├── assets │ ├── bg.png │ ├── facebook.png │ ├── github.png │ └── twitter.png └── login_page.dart ├── Login_Simple_4 ├── UI.png └── login.dart ├── Login_Simple_5 ├── UI.png ├── custom_clipper.dart ├── images │ ├── facebook.png │ ├── google.png │ └── twitter.png └── login_page.dart ├── Notes_Simple ├── UI.jpg ├── notes.dart └── notes_page.dart ├── README.md ├── SignUp_Simple ├── UI.png └── signup.dart └── Snake_Game ├── Screenshot_1696233623.png └── snake_game_page.dart /Glass_Button_Custom/UI.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Glass_Button_Custom/UI.PNG -------------------------------------------------------------------------------- /Glass_Button_Custom/custom_glass_button.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class CustomGlassButton extends StatelessWidget { 6 | final Widget child; 7 | final bool isPressed; 8 | 9 | const CustomGlassButton( 10 | {Key? key, required this.isPressed, required this.child}) 11 | : super(key: key); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return ClipRRect( 16 | borderRadius: BorderRadius.circular(25), 17 | child: BackdropFilter( 18 | filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15), 19 | child: Container( 20 | decoration: BoxDecoration( 21 | color: Colors.white.withOpacity(isPressed ? 0.4 : 0.3), 22 | borderRadius: BorderRadius.circular(25), 23 | border: Border.all(width: 2, color: Colors.white30), 24 | boxShadow: [ 25 | BoxShadow( 26 | blurRadius: 25, 27 | color: Colors.black.withOpacity(0.1), 28 | spreadRadius: -5, 29 | ) 30 | ]), 31 | child: Center(child: child), 32 | ), 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Glass_Button_Custom/glass_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:youtube_tutorial_1/custom_glass_button.dart'; 5 | 6 | class GlassPage extends StatefulWidget { 7 | @override 8 | State createState() => _GlassPageState(); 9 | } 10 | 11 | class _GlassPageState extends State { 12 | bool isOn = false; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | body: Container( 18 | decoration: const BoxDecoration( 19 | image: DecorationImage( 20 | image: NetworkImage( 21 | "https://i.pinimg.com/originals/d9/6c/93/d96c9383beb63a6457c96eefc3511379.jpg"), 22 | fit: BoxFit.cover, 23 | )), 24 | child: Center( 25 | child: InkWell( 26 | onTap: () { 27 | setState(() { 28 | if (isOn) { 29 | isOn = false; 30 | } else { 31 | isOn = true; 32 | } 33 | }); 34 | }, 35 | child: SizedBox( 36 | height: 200, 37 | width: 300, 38 | child: CustomGlassButton( 39 | child: Text( 40 | isOn ? "OFF" : "ON", 41 | style: const TextStyle( 42 | fontSize: 75, 43 | color: Colors.white54, 44 | ), 45 | ), 46 | isPressed: isOn, 47 | )), 48 | ), 49 | )), 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Login_Instagram_Clone/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Instagram_Clone/UI.png -------------------------------------------------------------------------------- /Login_Instagram_Clone/assets/images/fb_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Instagram_Clone/assets/images/fb_icon.png -------------------------------------------------------------------------------- /Login_Instagram_Clone/assets/images/instagram_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Instagram_Clone/assets/images/instagram_icon.png -------------------------------------------------------------------------------- /Login_Instagram_Clone/insta_login.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class InstaLogin extends StatefulWidget { 4 | @override 5 | State createState() => _InstaLoginState(); 6 | } 7 | 8 | class _InstaLoginState extends State { 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: SafeArea( 13 | child: Column( 14 | mainAxisAlignment: MainAxisAlignment.center, 15 | children: [ 16 | _topWidget(), 17 | Flexible(child: Container(), flex: 2), 18 | Padding( 19 | padding: const EdgeInsets.symmetric(horizontal: 16), 20 | child: _centerWidget(), 21 | ), 22 | Flexible(child: Container(), flex: 2), 23 | const Divider(thickness: 2), 24 | Padding( 25 | padding: const EdgeInsets.symmetric(vertical: 12), 26 | child: _bottomWidget(), 27 | ), 28 | ], 29 | ), 30 | ), 31 | ); 32 | } 33 | 34 | Widget _topWidget() { 35 | return DropdownButton( 36 | value: "English (United States)", 37 | items: const [ 38 | DropdownMenuItem( 39 | child: Text("English (United States)"), 40 | value: "English (United States)", 41 | ), 42 | ], 43 | onChanged: (v) {}, 44 | ); 45 | } 46 | 47 | Widget _centerWidget() { 48 | return Column( 49 | children: [ 50 | Image.asset( 51 | "assets/images/instagram_icon.png", 52 | height: 64, 53 | ), 54 | const SizedBox(height: 24), 55 | TextField( 56 | decoration: InputDecoration( 57 | hintText: "Email", 58 | border: OutlineInputBorder( 59 | borderSide: Divider.createBorderSide(context), 60 | ), 61 | focusedBorder: OutlineInputBorder( 62 | borderSide: Divider.createBorderSide(context), 63 | ), 64 | enabledBorder: OutlineInputBorder( 65 | borderSide: Divider.createBorderSide(context), 66 | ), 67 | filled: true, 68 | contentPadding: const EdgeInsets.all(8), 69 | ), 70 | ), 71 | const SizedBox(height: 24), 72 | TextField( 73 | decoration: InputDecoration( 74 | hintText: "Password", 75 | border: OutlineInputBorder( 76 | borderSide: Divider.createBorderSide(context), 77 | ), 78 | focusedBorder: OutlineInputBorder( 79 | borderSide: Divider.createBorderSide(context), 80 | ), 81 | enabledBorder: OutlineInputBorder( 82 | borderSide: Divider.createBorderSide(context), 83 | ), 84 | filled: true, 85 | suffixIcon: const Icon(Icons.remove_red_eye), 86 | contentPadding: const EdgeInsets.all(8), 87 | ), 88 | obscureText: true, 89 | ), 90 | const SizedBox(height: 24), 91 | SizedBox( 92 | height: 48, 93 | width: double.infinity, 94 | child: ElevatedButton( 95 | onPressed: () {}, 96 | child: const Text("Log in"), 97 | ), 98 | ), 99 | const SizedBox(height: 24), 100 | Row( 101 | mainAxisAlignment: MainAxisAlignment.center, 102 | children: const [ 103 | Text("Forgot your login details?"), 104 | Text(" Get help logging in", 105 | style: TextStyle(fontWeight: FontWeight.bold)), 106 | ], 107 | ), 108 | const SizedBox(height: 24), 109 | Row( 110 | children: const [ 111 | Flexible(child: Divider(thickness: 2)), 112 | Text(" OR "), 113 | Flexible(child: Divider(thickness: 2)), 114 | ], 115 | ), 116 | const SizedBox(height: 24), 117 | Row( 118 | mainAxisAlignment: MainAxisAlignment.center, 119 | children: [ 120 | Image.asset("assets/images/fb_icon.png", height: 32), 121 | const Text(" Log in with Facebook"), 122 | ], 123 | ) 124 | ], 125 | ); 126 | } 127 | 128 | Widget _bottomWidget() { 129 | return Row( 130 | mainAxisAlignment: MainAxisAlignment.center, 131 | children: const [ 132 | Text("Don't have an account"), 133 | Text(" Sign up", style: TextStyle(fontWeight: FontWeight.bold)), 134 | ], 135 | ); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Login_Simple/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple/UI.png -------------------------------------------------------------------------------- /Login_Simple/login.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class LoginPage extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return SafeArea( 9 | child: Scaffold( 10 | body: Container( 11 | margin: EdgeInsets.all(24), 12 | child: Column( 13 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 14 | children: [ 15 | _header(context), 16 | _inputField(context), 17 | _forgotPassword(context), 18 | _signup(context), 19 | ], 20 | ), 21 | ), 22 | ), 23 | ); 24 | } 25 | 26 | _header(context) { 27 | return Column( 28 | children: [ 29 | Text( 30 | "Welcome Back", 31 | style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold), 32 | ), 33 | Text("Enter your credential to login"), 34 | ], 35 | ); 36 | } 37 | 38 | _inputField(context) { 39 | return Column( 40 | crossAxisAlignment: CrossAxisAlignment.stretch, 41 | children: [ 42 | TextField( 43 | decoration: InputDecoration( 44 | hintText: "Username", 45 | border: OutlineInputBorder( 46 | borderRadius: BorderRadius.circular(18), 47 | borderSide: BorderSide.none), 48 | fillColor: Theme.of(context).primaryColor.withOpacity(0.1), 49 | filled: true, 50 | prefixIcon: Icon(Icons.person)), 51 | ), 52 | SizedBox(height: 10), 53 | TextField( 54 | decoration: InputDecoration( 55 | hintText: "Password", 56 | border: OutlineInputBorder( 57 | borderRadius: BorderRadius.circular(18), 58 | borderSide: BorderSide.none), 59 | fillColor: Theme.of(context).primaryColor.withOpacity(0.1), 60 | filled: true, 61 | prefixIcon: Icon(Icons.person), 62 | ), 63 | obscureText: true, 64 | ), 65 | SizedBox(height: 10), 66 | ElevatedButton( 67 | onPressed: () {}, 68 | child: Text( 69 | "Login", 70 | style: TextStyle(fontSize: 20), 71 | ), 72 | style: ElevatedButton.styleFrom( 73 | shape: StadiumBorder(), 74 | padding: EdgeInsets.symmetric(vertical: 16), 75 | ), 76 | ) 77 | ], 78 | ); 79 | } 80 | 81 | _forgotPassword(context) { 82 | return TextButton(onPressed: () {}, child: Text("Forgot password?")); 83 | } 84 | 85 | _signup(context) { 86 | return Row( 87 | mainAxisAlignment: MainAxisAlignment.center, 88 | children: [ 89 | Text("Dont have an account? "), 90 | TextButton(onPressed: () {}, child: Text("Sign Up")) 91 | ], 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Login_Simple_2/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_2/UI.png -------------------------------------------------------------------------------- /Login_Simple_2/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoginPage extends StatefulWidget { 4 | @override 5 | State createState() => _LoginPageState(); 6 | } 7 | 8 | class _LoginPageState extends State { 9 | TextEditingController usernameController = TextEditingController(); 10 | TextEditingController passwordController = TextEditingController(); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | decoration: const BoxDecoration( 16 | gradient: LinearGradient( 17 | begin: Alignment.topRight, 18 | end: Alignment.bottomLeft, 19 | colors: [ 20 | Colors.blue, 21 | Colors.red, 22 | ], 23 | )), 24 | child: Scaffold( 25 | backgroundColor: Colors.transparent, 26 | body: _page(), 27 | ), 28 | ); 29 | } 30 | 31 | Widget _page() { 32 | return Padding( 33 | padding: const EdgeInsets.all(32.0), 34 | child: Center( 35 | child: Column( 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | children: [ 38 | _icon(), 39 | const SizedBox(height: 50), 40 | _inputField("Username", usernameController), 41 | const SizedBox(height: 20), 42 | _inputField("Password", passwordController, isPassword: true), 43 | const SizedBox(height: 50), 44 | _loginBtn(), 45 | const SizedBox(height: 20), 46 | _extraText(), 47 | ], 48 | ), 49 | ), 50 | ); 51 | } 52 | 53 | Widget _icon() { 54 | return Container( 55 | decoration: BoxDecoration( 56 | border: Border.all(color: Colors.white, width: 2), 57 | shape: BoxShape.circle), 58 | child: const Icon(Icons.person, color: Colors.white, size: 120), 59 | ); 60 | } 61 | 62 | Widget _inputField(String hintText, TextEditingController controller, 63 | {isPassword = false}) { 64 | var border = OutlineInputBorder( 65 | borderRadius: BorderRadius.circular(18), 66 | borderSide: const BorderSide(color: Colors.white)); 67 | 68 | return TextField( 69 | style: const TextStyle(color: Colors.white), 70 | controller: controller, 71 | decoration: InputDecoration( 72 | hintText: hintText, 73 | hintStyle: const TextStyle(color: Colors.white), 74 | enabledBorder: border, 75 | focusedBorder: border, 76 | ), 77 | obscureText: isPassword, 78 | ); 79 | } 80 | 81 | Widget _loginBtn() { 82 | return ElevatedButton( 83 | onPressed: () { 84 | debugPrint("Username : " + usernameController.text); 85 | debugPrint("Password : " + passwordController.text); 86 | }, 87 | child: const SizedBox( 88 | width: double.infinity, 89 | child: Text( 90 | "Sign in ", 91 | textAlign: TextAlign.center, 92 | style: TextStyle(fontSize: 20), 93 | )), 94 | style: ElevatedButton.styleFrom( 95 | shape: const StadiumBorder(), 96 | primary: Colors.white, 97 | onPrimary: Colors.blue, 98 | padding: const EdgeInsets.symmetric(vertical: 16), 99 | ), 100 | ); 101 | } 102 | 103 | Widget _extraText() { 104 | return const Text( 105 | "Can't access to your account?", 106 | textAlign: TextAlign.center, 107 | style: TextStyle(fontSize: 16, color: Colors.white), 108 | ); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Login_Simple_3/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_3/UI.png -------------------------------------------------------------------------------- /Login_Simple_3/assets/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_3/assets/bg.png -------------------------------------------------------------------------------- /Login_Simple_3/assets/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_3/assets/facebook.png -------------------------------------------------------------------------------- /Login_Simple_3/assets/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_3/assets/github.png -------------------------------------------------------------------------------- /Login_Simple_3/assets/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_3/assets/twitter.png -------------------------------------------------------------------------------- /Login_Simple_3/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoginPage extends StatefulWidget { 4 | const LoginPage({super.key}); 5 | 6 | @override 7 | State createState() => _LoginPageState(); 8 | } 9 | 10 | class _LoginPageState extends State { 11 | late Color myColor; 12 | late Size mediaSize; 13 | TextEditingController emailController = TextEditingController(); 14 | TextEditingController passwordController = TextEditingController(); 15 | bool rememberUser = false; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | myColor = Theme.of(context).primaryColor; 20 | mediaSize = MediaQuery.of(context).size; 21 | return Container( 22 | decoration: BoxDecoration( 23 | color: myColor, 24 | image: DecorationImage( 25 | image: const AssetImage("assets/images/bg.png"), 26 | fit: BoxFit.cover, 27 | colorFilter: 28 | ColorFilter.mode(myColor.withOpacity(0.2), BlendMode.dstATop), 29 | ), 30 | ), 31 | child: Scaffold( 32 | backgroundColor: Colors.transparent, 33 | body: Stack(children: [ 34 | Positioned(top: 80, child: _buildTop()), 35 | Positioned(bottom: 0, child: _buildBottom()), 36 | ]), 37 | ), 38 | ); 39 | } 40 | 41 | Widget _buildTop() { 42 | return SizedBox( 43 | width: mediaSize.width, 44 | child: const Column( 45 | mainAxisSize: MainAxisSize.min, 46 | children: [ 47 | Icon( 48 | Icons.location_on_sharp, 49 | size: 100, 50 | color: Colors.white, 51 | ), 52 | Text( 53 | "GO MAP", 54 | style: TextStyle( 55 | color: Colors.white, 56 | fontWeight: FontWeight.bold, 57 | fontSize: 40, 58 | letterSpacing: 2), 59 | ) 60 | ], 61 | ), 62 | ); 63 | } 64 | 65 | Widget _buildBottom() { 66 | return SizedBox( 67 | width: mediaSize.width, 68 | child: Card( 69 | shape: const RoundedRectangleBorder( 70 | borderRadius: BorderRadius.only( 71 | topLeft: Radius.circular(30), 72 | topRight: Radius.circular(30), 73 | )), 74 | child: Padding( 75 | padding: const EdgeInsets.all(32.0), 76 | child: _buildForm(), 77 | ), 78 | ), 79 | ); 80 | } 81 | 82 | Widget _buildForm() { 83 | return Column( 84 | crossAxisAlignment: CrossAxisAlignment.start, 85 | children: [ 86 | Text( 87 | "Welcome", 88 | style: TextStyle( 89 | color: myColor, fontSize: 32, fontWeight: FontWeight.w500), 90 | ), 91 | _buildGreyText("Please login with your information"), 92 | const SizedBox(height: 60), 93 | _buildGreyText("Email address"), 94 | _buildInputField(emailController), 95 | const SizedBox(height: 40), 96 | _buildGreyText("Password"), 97 | _buildInputField(passwordController, isPassword: true), 98 | const SizedBox(height: 20), 99 | _buildRememberForgot(), 100 | const SizedBox(height: 20), 101 | _buildLoginButton(), 102 | const SizedBox(height: 20), 103 | _buildOtherLogin(), 104 | ], 105 | ); 106 | } 107 | 108 | Widget _buildGreyText(String text) { 109 | return Text( 110 | text, 111 | style: const TextStyle(color: Colors.grey), 112 | ); 113 | } 114 | 115 | Widget _buildInputField(TextEditingController controller, 116 | {isPassword = false}) { 117 | return TextField( 118 | controller: controller, 119 | decoration: InputDecoration( 120 | suffixIcon: isPassword ? Icon(Icons.remove_red_eye) : Icon(Icons.done), 121 | ), 122 | obscureText: isPassword, 123 | ); 124 | } 125 | 126 | Widget _buildRememberForgot() { 127 | return Row( 128 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 129 | children: [ 130 | Row( 131 | children: [ 132 | Checkbox( 133 | value: rememberUser, 134 | onChanged: (value) { 135 | setState(() { 136 | rememberUser = value!; 137 | }); 138 | }), 139 | _buildGreyText("Remember me"), 140 | ], 141 | ), 142 | TextButton( 143 | onPressed: () {}, child: _buildGreyText("I forgot my password")) 144 | ], 145 | ); 146 | } 147 | 148 | Widget _buildLoginButton() { 149 | return ElevatedButton( 150 | onPressed: () { 151 | debugPrint("Email : ${emailController.text}"); 152 | debugPrint("Password : ${passwordController.text}"); 153 | }, 154 | style: ElevatedButton.styleFrom( 155 | shape: const StadiumBorder(), 156 | elevation: 20, 157 | shadowColor: myColor, 158 | minimumSize: const Size.fromHeight(60), 159 | ), 160 | child: const Text("LOGIN"), 161 | ); 162 | } 163 | 164 | Widget _buildOtherLogin() { 165 | return Center( 166 | child: Column( 167 | children: [ 168 | _buildGreyText("Or Login with"), 169 | const SizedBox(height: 10), 170 | Row( 171 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 172 | children: [ 173 | Tab(icon: Image.asset("assets/images/facebook.png")), 174 | Tab(icon: Image.asset("assets/images/twitter.png")), 175 | Tab(icon: Image.asset("assets/images/github.png")), 176 | ], 177 | ) 178 | ], 179 | ), 180 | ); 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /Login_Simple_4/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_4/UI.png -------------------------------------------------------------------------------- /Login_Simple_4/login.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoginPage extends StatefulWidget { 4 | const LoginPage({super.key}); 5 | 6 | @override 7 | State createState() => _LoginPageState(); 8 | } 9 | 10 | class _LoginPageState extends State { 11 | late TextEditingController emailController, passwordController; 12 | 13 | @override 14 | void initState() { 15 | emailController = TextEditingController(); 16 | passwordController = TextEditingController(); 17 | super.initState(); 18 | } 19 | 20 | @override 21 | void dispose() { 22 | emailController.dispose(); 23 | passwordController.dispose(); 24 | super.dispose(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | body: Container( 31 | width: double.infinity, 32 | decoration: BoxDecoration( 33 | gradient: LinearGradient(colors: [ 34 | Colors.green, 35 | Colors.greenAccent.shade100, 36 | ])), 37 | padding: const EdgeInsets.all(16), 38 | child: Column( 39 | crossAxisAlignment: CrossAxisAlignment.start, 40 | children: [ 41 | const SizedBox(height: 80), 42 | _buildHeader(), 43 | const SizedBox(height: 20), 44 | Expanded(child: _buildInputFields()) 45 | ], 46 | ), 47 | ), 48 | ); 49 | } 50 | 51 | Widget _buildHeader() { 52 | return const Padding( 53 | padding: EdgeInsets.all(8.0), 54 | child: Column( 55 | crossAxisAlignment: CrossAxisAlignment.start, 56 | children: [ 57 | Text( 58 | "Welcome Back", 59 | style: TextStyle(color: Colors.white, fontSize: 30), 60 | ), 61 | Text( 62 | "Login", 63 | style: TextStyle( 64 | color: Colors.white, 65 | fontSize: 40, 66 | fontWeight: FontWeight.bold, 67 | letterSpacing: 2), 68 | ), 69 | ], 70 | ), 71 | ); 72 | } 73 | 74 | Widget _buildInputFields() { 75 | return Container( 76 | width: double.infinity, 77 | decoration: const BoxDecoration( 78 | color: Colors.white60, 79 | borderRadius: BorderRadius.only( 80 | topLeft: Radius.circular(60), 81 | topRight: Radius.circular(60), 82 | )), 83 | padding: const EdgeInsets.all(20), 84 | child: SingleChildScrollView( 85 | child: Column( 86 | children: [ 87 | const SizedBox(height: 32), 88 | Column( 89 | children: [ 90 | _buildTextField("Enter email here", emailController), 91 | const SizedBox(height: 16), 92 | _buildTextField("Password", passwordController, isPass: true), 93 | ], 94 | ), 95 | const SizedBox(height: 32), 96 | TextButton( 97 | onPressed: () {}, 98 | child: const Text( 99 | "Forgot Password", 100 | style: TextStyle(color: Colors.grey), 101 | )), 102 | const SizedBox(height: 32), 103 | _buildButton("Login", Colors.green, () { 104 | debugPrint("Email : ${emailController.text}"); 105 | debugPrint("Password : ${passwordController.text}"); 106 | }), 107 | const SizedBox(height: 32), 108 | const Text( 109 | "Or sign in with", 110 | style: TextStyle(color: Colors.grey), 111 | ), 112 | const SizedBox(height: 32), 113 | Row( 114 | children: [ 115 | Expanded(child: _buildButton("Facebook", Colors.blue, () {})), 116 | const SizedBox(width: 32), 117 | Expanded(child: _buildButton("Google", Colors.red, () {})), 118 | ], 119 | ) 120 | ], 121 | ), 122 | ), 123 | ); 124 | } 125 | 126 | Widget _buildTextField(String hint, TextEditingController controller, 127 | {isPass = false}) { 128 | return Container( 129 | padding: const EdgeInsets.all(10), 130 | decoration: const BoxDecoration( 131 | color: Colors.white, 132 | border: Border(bottom: BorderSide(color: Colors.grey))), 133 | child: TextField( 134 | controller: controller, 135 | decoration: InputDecoration( 136 | hintText: hint, 137 | hintStyle: const TextStyle(color: Colors.grey), 138 | border: InputBorder.none), 139 | style: const TextStyle(color: Colors.black), 140 | obscureText: isPass, 141 | ), 142 | ); 143 | } 144 | 145 | Widget _buildButton(String buttonText, Color color, Function()? onPressed) { 146 | return ElevatedButton( 147 | onPressed: onPressed, 148 | style: ElevatedButton.styleFrom( 149 | shape: const StadiumBorder(), 150 | elevation: 2, 151 | backgroundColor: color, 152 | minimumSize: const Size.fromHeight(60), 153 | ), 154 | child: Text(buttonText, 155 | style: const TextStyle(fontSize: 16, color: Colors.white))); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /Login_Simple_5/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_5/UI.png -------------------------------------------------------------------------------- /Login_Simple_5/custom_clipper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomClipperWidget extends CustomClipper { 4 | @override 5 | Path getClip(Size size) { 6 | final path = Path(); 7 | path.lineTo(0, size.height * 0.8); 8 | path.quadraticBezierTo( 9 | size.width * 0.7, size.height, size.width, size.height * 0.90); 10 | path.lineTo(size.width, 0); 11 | return path; 12 | } 13 | 14 | @override 15 | bool shouldReclip(covariant CustomClipper oldClipper) { 16 | return false; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Login_Simple_5/images/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_5/images/facebook.png -------------------------------------------------------------------------------- /Login_Simple_5/images/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_5/images/google.png -------------------------------------------------------------------------------- /Login_Simple_5/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Login_Simple_5/images/twitter.png -------------------------------------------------------------------------------- /Login_Simple_5/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_login_app/custom_clipper.dart'; 3 | 4 | class LoginPage extends StatefulWidget { 5 | const LoginPage({super.key}); 6 | 7 | @override 8 | State createState() => _LoginPageState(); 9 | } 10 | 11 | class _LoginPageState extends State { 12 | late TextEditingController emailController; 13 | late TextEditingController passwordController; 14 | 15 | @override 16 | void initState() { 17 | emailController = TextEditingController(); 18 | passwordController = TextEditingController(); 19 | super.initState(); 20 | } 21 | 22 | @override 23 | void dispose() { 24 | emailController.dispose(); 25 | passwordController.dispose(); 26 | super.dispose(); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Scaffold( 32 | body: SingleChildScrollView( 33 | child: Column( 34 | children: [ 35 | SizedBox( 36 | height: MediaQuery.sizeOf(context).height * 0.7, 37 | width: double.infinity, 38 | child: _buildInputFields(), 39 | ), 40 | _buildSocialLogins(), 41 | ], 42 | ), 43 | ), 44 | ); 45 | } 46 | 47 | Widget _buildInputFields() { 48 | return ClipPath( 49 | clipper: CustomClipperWidget(), 50 | child: Container( 51 | decoration: const BoxDecoration( 52 | gradient: LinearGradient( 53 | colors: [ 54 | Colors.purple, 55 | Color.fromARGB(155, 20, 30, 230), 56 | ], 57 | begin: Alignment.topCenter, 58 | end: Alignment.bottomCenter, 59 | )), 60 | child: Padding( 61 | padding: const EdgeInsets.all(16.0), 62 | child: Column( 63 | children: [ 64 | const SizedBox(height: 60), 65 | const Text( 66 | "Sign in", 67 | style: TextStyle( 68 | color: Colors.white, 69 | fontSize: 35, 70 | fontWeight: FontWeight.w800, 71 | letterSpacing: 1, 72 | ), 73 | ), 74 | const SizedBox(height: 60), 75 | _buildTextField(emailController, Icons.person_outline, "Email"), 76 | const SizedBox(height: 20), 77 | _buildTextField( 78 | passwordController, Icons.info_outline, "Password", 79 | isPassword: true), 80 | const SizedBox(height: 40), 81 | ElevatedButton( 82 | onPressed: () { 83 | //Login Button Pressed 84 | String email = emailController.text.trim(); 85 | String password = passwordController.text.trim(); 86 | print("Email : $email Password : $password"); 87 | }, 88 | child: const Text("LOGIN"), 89 | ), 90 | const SizedBox(height: 20), 91 | TextButton( 92 | onPressed: () {}, 93 | child: const Text( 94 | "Forgot Password?", 95 | style: TextStyle( 96 | color: Colors.white70, 97 | fontSize: 17, 98 | ), 99 | ), 100 | ) 101 | ], 102 | ), 103 | ), 104 | ), 105 | ); 106 | } 107 | 108 | Widget _buildSocialLogins() { 109 | return Column( 110 | children: [ 111 | const Text( 112 | "Or sign in with", 113 | style: TextStyle(fontSize: 16), 114 | ), 115 | const SizedBox(height: 20), 116 | Padding( 117 | padding: const EdgeInsets.symmetric(horizontal: 40.0), 118 | child: Row( 119 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 120 | children: [ 121 | IconButton( 122 | onPressed: () {}, 123 | icon: Image.asset("assets/images/google.png"), 124 | iconSize: 60, 125 | ), 126 | IconButton( 127 | onPressed: () {}, 128 | icon: Image.asset("assets/images/facebook.png"), 129 | iconSize: 60, 130 | ), 131 | IconButton( 132 | onPressed: () {}, 133 | icon: Image.asset("assets/images/twitter.png"), 134 | iconSize: 60, 135 | ) 136 | ], 137 | ), 138 | ), 139 | ], 140 | ); 141 | } 142 | 143 | Widget _buildTextField( 144 | TextEditingController controller, IconData icon, String hint, 145 | {bool isPassword = false}) { 146 | return TextField( 147 | controller: controller, 148 | style: const TextStyle(color: Colors.white), 149 | decoration: InputDecoration( 150 | hintText: hint, 151 | hintStyle: const TextStyle(color: Colors.white), 152 | prefixIcon: Icon( 153 | icon, 154 | color: Colors.white, 155 | ), 156 | filled: true, 157 | fillColor: Colors.white.withOpacity(0.1), 158 | border: const OutlineInputBorder(borderSide: BorderSide.none), 159 | ), 160 | obscureText: isPassword, 161 | ); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /Notes_Simple/UI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Notes_Simple/UI.jpg -------------------------------------------------------------------------------- /Notes_Simple/notes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Notes { 4 | String title; 5 | String date; 6 | String content; 7 | 8 | Notes({required this.title, required this.date, required this.content}); 9 | 10 | static List getListOfNotes() { 11 | List list = []; 12 | list.add(Notes( 13 | title: "My seventh Note", 14 | date: "07/01/2021", 15 | content: "This is my very first note in my flutter application")); 16 | list.add(Notes( 17 | title: "My sixth Note", 18 | date: "06/01/2021", 19 | content: "This is my very first note in my flutter application")); 20 | list.add(Notes( 21 | title: "My fifth Note", 22 | date: "05/01/2021", 23 | content: "This is my very first note in my flutter application")); 24 | list.add(Notes( 25 | title: "My forth Note", 26 | date: "04/01/2021", 27 | content: "This is my very first note in my flutter application")); 28 | list.add(Notes( 29 | title: "My third Note", 30 | date: "03/01/2021", 31 | content: "This is my very first note in my flutter application")); 32 | list.add(Notes( 33 | title: "Meeting", 34 | date: "02/01/2021", 35 | content: "Meeting is posponed to 4th Feb")); 36 | list.add(Notes( 37 | title: "My first Note", 38 | date: "01/01/2021", 39 | content: "This is my very first note in my flutter application")); 40 | return list; 41 | } 42 | 43 | static List notesColor = [ 44 | Colors.red.shade100, 45 | Colors.green.shade100, 46 | Colors.blue.shade100, 47 | Colors.yellow.shade100, 48 | Colors.orange.shade100, 49 | Colors.pink.shade100, 50 | Colors.blueGrey.shade100, 51 | ]; 52 | } 53 | -------------------------------------------------------------------------------- /Notes_Simple/notes_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:notes_app/notes.dart'; 5 | 6 | class NotesPage extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text("My Notes"), 12 | centerTitle: true, 13 | backgroundColor: Colors.amber, 14 | ), 15 | body: GridView( 16 | gridDelegate: 17 | const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), 18 | children: gridChildren(), 19 | ), 20 | ); 21 | } 22 | 23 | List gridChildren() { 24 | List list = []; 25 | Notes.getListOfNotes().forEach((element) { 26 | list.add(getNoteCard(element)); 27 | }); 28 | return list; 29 | } 30 | 31 | Widget getNoteCard(Notes note) { 32 | //for random color 33 | int randomColor = Random().nextInt(Notes.notesColor.length - 1); 34 | 35 | return Container( 36 | padding: const EdgeInsets.all(8), 37 | margin: const EdgeInsets.all(8), 38 | decoration: BoxDecoration( 39 | borderRadius: BorderRadius.circular(8), 40 | color: Notes.notesColor[randomColor], 41 | ), 42 | child: Column( 43 | crossAxisAlignment: CrossAxisAlignment.start, 44 | children: [ 45 | Text( 46 | note.title, 47 | style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold), 48 | ), 49 | const SizedBox(height: 4), 50 | Text( 51 | note.date, 52 | style: const TextStyle(fontSize: 13, fontWeight: FontWeight.normal), 53 | ), 54 | const SizedBox(height: 8), 55 | Expanded( 56 | child: Text( 57 | note.content, 58 | style: 59 | const TextStyle(fontSize: 16, fontWeight: FontWeight.normal), 60 | ), 61 | ), 62 | ], 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fluttter_SinglePageUI 2 | 3 | All the single screen files to make an app 4 | 5 | 1. Login_Simple 6 | 2. SignUp_Simple 7 | 3. Notes_Simple 8 | 4. Login_Instagram_Clone 9 | -------------------------------------------------------------------------------- /SignUp_Simple/UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/SignUp_Simple/UI.png -------------------------------------------------------------------------------- /SignUp_Simple/signup.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class SignUpScreen extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return SafeArea( 9 | child: Scaffold( 10 | body: Container( 11 | margin: EdgeInsets.all(24), 12 | child: 13 | Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ 14 | _header(context), 15 | _inputFields(context), 16 | _loginInfo(context), 17 | ]), 18 | ), 19 | )); 20 | } 21 | 22 | _header(context) { 23 | return Column( 24 | children: [ 25 | Text( 26 | "Create Account", 27 | style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold), 28 | ), 29 | Text("Enter details to get started"), 30 | ], 31 | ); 32 | } 33 | 34 | _inputFields(context) { 35 | return Column( 36 | crossAxisAlignment: CrossAxisAlignment.stretch, 37 | children: [ 38 | TextField( 39 | decoration: InputDecoration( 40 | hintText: "Username", 41 | fillColor: Theme.of(context).primaryColor.withOpacity(0.1), 42 | filled: true, 43 | prefixIcon: Icon(Icons.person), 44 | border: OutlineInputBorder( 45 | borderRadius: BorderRadius.circular(18), 46 | borderSide: BorderSide.none), 47 | ), 48 | ), 49 | SizedBox( 50 | height: 10, 51 | ), 52 | TextField( 53 | decoration: InputDecoration( 54 | hintText: "Email id", 55 | fillColor: Theme.of(context).primaryColor.withOpacity(0.1), 56 | filled: true, 57 | prefixIcon: Icon(Icons.email_outlined), 58 | border: OutlineInputBorder( 59 | borderRadius: BorderRadius.circular(18), 60 | borderSide: BorderSide.none), 61 | ), 62 | ), 63 | SizedBox( 64 | height: 10, 65 | ), 66 | TextField( 67 | decoration: InputDecoration( 68 | hintText: "Password", 69 | fillColor: Theme.of(context).primaryColor.withOpacity(0.1), 70 | filled: true, 71 | prefixIcon: Icon(Icons.password_outlined), 72 | border: OutlineInputBorder( 73 | borderRadius: BorderRadius.circular(18), 74 | borderSide: BorderSide.none), 75 | ), 76 | obscureText: true, 77 | ), 78 | SizedBox( 79 | height: 10, 80 | ), 81 | TextField( 82 | decoration: InputDecoration( 83 | hintText: "Retype Password", 84 | fillColor: Theme.of(context).primaryColor.withOpacity(0.1), 85 | filled: true, 86 | prefixIcon: Icon(Icons.password_outlined), 87 | border: OutlineInputBorder( 88 | borderRadius: BorderRadius.circular(18), 89 | borderSide: BorderSide.none), 90 | ), 91 | obscureText: true, 92 | ), 93 | SizedBox( 94 | height: 10, 95 | ), 96 | ElevatedButton( 97 | onPressed: () {}, 98 | child: Text( 99 | "Sign Up", 100 | style: TextStyle(fontSize: 20), 101 | ), 102 | style: ElevatedButton.styleFrom( 103 | shape: StadiumBorder(), 104 | padding: EdgeInsets.symmetric(vertical: 16), 105 | ), 106 | ) 107 | ], 108 | ); 109 | } 110 | 111 | _loginInfo(context) { 112 | return Row( 113 | mainAxisAlignment: MainAxisAlignment.center, 114 | children: [ 115 | Text("Already have an account?"), 116 | TextButton(onPressed: () {}, child: Text("Login")) 117 | ], 118 | ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Snake_Game/Screenshot_1696233623.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bimalkaf/Flutter_SinglePages/df672526813fe16d46dc14882173ad98515ac04d/Snake_Game/Screenshot_1696233623.png -------------------------------------------------------------------------------- /Snake_Game/snake_game_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:math'; 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class SnakeGamePage extends StatefulWidget { 7 | const SnakeGamePage({super.key}); 8 | 9 | @override 10 | State createState() => _SnakeGamePageState(); 11 | } 12 | 13 | enum Direction { up, down, left, right } 14 | 15 | class _SnakeGamePageState extends State { 16 | int row = 20, column = 20; 17 | List borderList = []; 18 | List snakePosition = []; 19 | int snakeHead = 0; 20 | int score = 11; 21 | late Direction direction; 22 | late int foodPoistion; 23 | 24 | @override 25 | void initState() { 26 | startGame(); 27 | super.initState(); 28 | } 29 | 30 | void startGame() { 31 | makeBorder(); 32 | generateFood(); 33 | direction = Direction.right; 34 | snakePosition = [45, 44, 43]; 35 | snakeHead = snakePosition.first; 36 | Timer.periodic(const Duration(milliseconds: 300), (timer) { 37 | updateSnake(); 38 | if (checkCollision()) { 39 | timer.cancel(); 40 | showGameOverDialog(); 41 | } 42 | }); 43 | } 44 | 45 | void showGameOverDialog() { 46 | showDialog( 47 | context: context, 48 | barrierDismissible: false, 49 | builder: (context) { 50 | return AlertDialog( 51 | title: const Text("Game Over"), 52 | content: const Text("Your snake collided!"), 53 | actions: [ 54 | TextButton( 55 | onPressed: () { 56 | Navigator.of(context).pop(); 57 | startGame(); 58 | }, 59 | child: const Text("Restart")) 60 | ], 61 | ); 62 | }, 63 | ); 64 | } 65 | 66 | bool checkCollision() { 67 | //if snake collid with border 68 | if (borderList.contains(snakeHead)) return true; 69 | //if snake collid with itself 70 | if (snakePosition.sublist(1).contains(snakeHead)) return true; 71 | return false; 72 | } 73 | 74 | void generateFood() { 75 | foodPoistion = Random().nextInt(row * column); 76 | if (borderList.contains(foodPoistion)) { 77 | generateFood(); 78 | } 79 | } 80 | 81 | void updateSnake() { 82 | setState(() { 83 | switch (direction) { 84 | case Direction.up: 85 | snakePosition.insert(0, snakeHead - column); 86 | break; 87 | case Direction.down: 88 | snakePosition.insert(0, snakeHead + column); 89 | break; 90 | case Direction.right: 91 | snakePosition.insert(0, snakeHead + 1); 92 | break; 93 | case Direction.left: 94 | snakePosition.insert(0, snakeHead - 1); 95 | break; 96 | } 97 | }); 98 | 99 | if (snakeHead == foodPoistion) { 100 | score++; 101 | generateFood(); 102 | } else { 103 | snakePosition.removeLast(); 104 | } 105 | 106 | snakeHead = snakePosition.first; 107 | } 108 | 109 | @override 110 | Widget build(BuildContext context) { 111 | return Scaffold( 112 | body: Column( 113 | children: [Expanded(child: _buildGameView()), _buildGameControls()], 114 | ), 115 | ); 116 | } 117 | 118 | Widget _buildGameView() { 119 | return GridView.builder( 120 | gridDelegate: 121 | SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: column), 122 | itemBuilder: (context, index) { 123 | return Container( 124 | margin: const EdgeInsets.all(1), 125 | decoration: BoxDecoration( 126 | borderRadius: BorderRadius.circular(8), 127 | color: fillBoxColor(index)), 128 | ); 129 | }, 130 | itemCount: row * column, 131 | ); 132 | } 133 | 134 | Widget _buildGameControls() { 135 | return Container( 136 | padding: const EdgeInsets.all(20), 137 | width: double.infinity, 138 | child: Column( 139 | mainAxisAlignment: MainAxisAlignment.center, 140 | children: [ 141 | Text("Score : $score"), 142 | IconButton( 143 | onPressed: () { 144 | if (direction != Direction.down) direction = Direction.up; 145 | }, 146 | icon: const Icon(Icons.arrow_circle_up), 147 | iconSize: 100, 148 | ), 149 | Row( 150 | mainAxisAlignment: MainAxisAlignment.center, 151 | children: [ 152 | IconButton( 153 | onPressed: () { 154 | if (direction != Direction.right) direction = Direction.left; 155 | }, 156 | icon: const Icon(Icons.arrow_circle_left_outlined), 157 | iconSize: 100, 158 | ), 159 | const SizedBox(width: 100), 160 | IconButton( 161 | onPressed: () { 162 | if (direction != Direction.left) direction = Direction.right; 163 | }, 164 | icon: const Icon(Icons.arrow_circle_right_outlined), 165 | iconSize: 100, 166 | ), 167 | ], 168 | ), 169 | IconButton( 170 | onPressed: () { 171 | if (direction != Direction.up) direction = Direction.down; 172 | }, 173 | icon: const Icon(Icons.arrow_circle_down_outlined), 174 | iconSize: 100, 175 | ), 176 | ], 177 | ), 178 | ); 179 | } 180 | 181 | Color fillBoxColor(int index) { 182 | if (borderList.contains(index)) 183 | return Colors.yellow; 184 | else { 185 | if (snakePosition.contains(index)) { 186 | if (snakeHead == index) { 187 | return Colors.green; 188 | } else { 189 | return Colors.white.withOpacity(0.9); 190 | } 191 | } else { 192 | if (index == foodPoistion) { 193 | return Colors.red; 194 | } 195 | } 196 | } 197 | return Colors.grey.withOpacity(0.05); 198 | } 199 | 200 | makeBorder() { 201 | for (int i = 0; i < column; i++) { 202 | if (!borderList.contains(i)) borderList.add(i); 203 | } 204 | for (int i = 0; i < row * column; i = i + column) { 205 | if (!borderList.contains(i)) borderList.add(i); 206 | } 207 | for (int i = column - 1; i < row * column; i = i + column) { 208 | if (!borderList.contains(i)) borderList.add(i); 209 | } 210 | for (int i = (row * column) - column; i < row * column; i = i + 1) { 211 | if (!borderList.contains(i)) borderList.add(i); 212 | } 213 | } 214 | } 215 | --------------------------------------------------------------------------------