Skip to content

Instantly share code, notes, and snippets.

@Suleman-Elahi
Created December 5, 2023 11:22
Show Gist options
  • Save Suleman-Elahi/fe15dbb8152224d667d9eec27481e1a1 to your computer and use it in GitHub Desktop.
Save Suleman-Elahi/fe15dbb8152224d667d9eec27481e1a1 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: LoginScreen(),
theme: ThemeData(
colorScheme: ColorScheme.fromSwatch().copyWith(
primary: Colors.red,
secondary: Colors.redAccent,
),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
backgroundColor: Colors.redAccent,
primary: Colors.white,
),
),
),
);
}
}
class LoginScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.red,
body: SafeArea(
child: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.pause,
size: 64.0,
color: Colors.white,
),
SizedBox(height: 16.0),
Text(
'Server Name',
style: TextStyle(
color: Colors.white,
fontSize: 24.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 32.0),
Text(
'Please provide your server credentials',
style: TextStyle(
color: Colors.white70,
fontSize: 16.0,
),
textAlign: TextAlign.center,
),
SizedBox(height: 16.0),
TextField(
decoration: InputDecoration(
hintText: 'Username',
filled: true,
fillColor: Colors.white,
),
),
SizedBox(height: 8.0),
TextField(
decoration: InputDecoration(
hintText: 'Password',
filled: true,
fillColor: Colors.white,
),
obscureText: true,
),
SizedBox(height: 24.0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: TextButton(
onPressed: () {},
child: Text('Cancel'),
),
),
SizedBox(width: 16.0),
Expanded(
child: TextButton(
onPressed: () {},
child: Text('Login'),
),
),
],
),
TextButton(
onPressed: () {},
child: Text(
'Forget Password',
style: TextStyle(
color: Colors.white70,
),
),
),
],
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment