Created
May 27, 2024 10:51
-
-
Save drpshtiwan/90622987cb07da7d944ad371b0f7d8c7 to your computer and use it in GitHub Desktop.
HSR Wireframe
This file contains 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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'HSR Credits App', | |
theme: ThemeData( | |
primarySwatch: Colors.green, | |
), | |
home: LoginScreen(), | |
); | |
} | |
} | |
class LoginScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('HSR Credits App'), | |
), | |
body: Padding( | |
padding: EdgeInsets.all(16.0), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Text( | |
'Welcome to HSR Credits', | |
style: TextStyle(fontSize: 24), | |
), | |
SizedBox(height: 20), | |
TextField( | |
decoration: InputDecoration(labelText: 'Email'), | |
), | |
TextField( | |
decoration: InputDecoration(labelText: 'Password'), | |
obscureText: true, | |
), | |
SizedBox(height: 20), | |
ElevatedButton( | |
onPressed: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => MainDashboard()), | |
); | |
}, | |
child: Text('Login'), | |
), | |
TextButton( | |
onPressed: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => RegistrationScreen()), | |
); | |
}, | |
child: Text('Sign Up'), | |
), | |
], | |
), | |
), | |
); | |
} | |
} | |
class RegistrationScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Register'), | |
), | |
body: Padding( | |
padding: EdgeInsets.all(16.0), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
TextField( | |
decoration: InputDecoration(labelText: 'Name'), | |
), | |
TextField( | |
decoration: InputDecoration(labelText: 'Email'), | |
), | |
TextField( | |
decoration: InputDecoration(labelText: 'Password'), | |
obscureText: true, | |
), | |
SizedBox(height: 20), | |
ElevatedButton( | |
onPressed: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => MainDashboard()), | |
); | |
}, | |
child: Text('Register'), | |
), | |
], | |
), | |
), | |
); | |
} | |
} | |
class MainDashboard extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Dashboard'), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Text( | |
'Hello, User!', | |
style: TextStyle(fontSize: 24), | |
), | |
SizedBox(height: 20), | |
Text( | |
'Current HSR Credit Balance: 100', | |
style: TextStyle(fontSize: 20), | |
), | |
], | |
), | |
), | |
bottomNavigationBar: BottomNavigationBar( | |
items: [ | |
BottomNavigationBarItem( | |
icon: Icon(Icons.home), | |
label: 'Home', | |
), | |
BottomNavigationBarItem( | |
icon: Icon(Icons.credit_card), | |
label: 'Buy Credits', | |
), | |
BottomNavigationBarItem( | |
icon: Icon(Icons.update), | |
label: 'Updates', | |
), | |
], | |
onTap: (index) { | |
if (index == 1) { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => BuyCreditsScreen()), | |
); | |
} else if (index == 2) { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => UpdatesScreen()), | |
); | |
} | |
}, | |
), | |
); | |
} | |
} | |
class BuyCreditsScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Buy HSR Credits'), | |
), | |
body: Padding( | |
padding: EdgeInsets.all(16.0), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
TextField( | |
decoration: InputDecoration(labelText: 'Enter Credits'), | |
), | |
DropdownButton<String>( | |
items: <String>['Fastpay', 'FIB'].map((String value) { | |
return DropdownMenuItem<String>( | |
value: value, | |
child: Text(value), | |
); | |
}).toList(), | |
onChanged: (_) {}, | |
hint: Text('Select Payment Method'), | |
), | |
SizedBox(height: 20), | |
ElevatedButton( | |
onPressed: () {}, | |
child: Text('Purchase'), | |
), | |
], | |
), | |
), | |
); | |
} | |
} | |
class UpdatesScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Latest Developments'), | |
), | |
body: ListView( | |
children: <Widget>[ | |
ListTile( | |
title: Text('Project 1'), | |
subtitle: Text('Details about Project 1...'), | |
trailing: Icon(Icons.more_vert), | |
onTap: () {}, | |
), | |
ListTile( | |
title: Text('Project 2'), | |
subtitle: Text('Details about Project 2...'), | |
trailing: Icon(Icons.more_vert), | |
onTap: () {}, | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment