Skip to content

Commit

Permalink
Created the Initial UI. Navigation to be done.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarikIshtar007 committed Sep 6, 2020
1 parent 0078da9 commit 91eb171
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 118 deletions.
45 changes: 45 additions & 0 deletions covid_tracker_flutter/.gitignore
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
/android/app/google-services.json

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added covid_tracker_flutter/assets/images/virus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 5 additions & 104 deletions covid_tracker_flutter/lib/main.dart
@@ -1,117 +1,18 @@
import 'package:covid_tracker_flutter/screens/splash.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);

// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.

// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".

final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}

@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
debugShowCheckedModeBanner: false,
home: SplashScreen(),
);
}
}
126 changes: 126 additions & 0 deletions covid_tracker_flutter/lib/screens/index.dart
@@ -0,0 +1,126 @@
import 'package:covid_tracker_flutter/screens/index_options.dart';
import 'package:covid_tracker_flutter/screens/login.dart';
import 'package:covid_tracker_flutter/screens/signup.dart';
import 'package:flutter/material.dart';

class IndexPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
var height = MediaQuery.of(context).size.height;
var width = MediaQuery.of(context).size.width;
return Scaffold(
body: Column(
children: [
Container(
height: height * 0.43,
child: Stack(
alignment: Alignment.topLeft,
children: [
Positioned(
bottom: height * 0.08,
right: width * 0.28,
child: Container(
height: height * 0.44,
width: height * 0.44,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomRight,
colors: [
Colors.red,
Colors.red[300].withOpacity(0.9)
])),
),
),
Positioned(
bottom: height * 0.05,
right: width * 0.35,
child: Container(
height: height * 0.42,
width: height * 0.42,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.centerRight,
colors: [Colors.blue[400], Colors.blue[900]]),
),
),
),
Positioned(
bottom: height * 0.12,
right: width * 0.47,
child: Container(
height: height * 0.4,
width: height * 0.4,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.blue[600],
Colors.blue,
Colors.blue[200].withAlpha(250)
],
)),
),
),
Positioned(
bottom: height * 0.05,
right: width * 0.55,
child: Container(
alignment: Alignment.topLeft,
width: width * 0.61,
height: height * 0.61,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage('assets/images/virus.png'),
fit: BoxFit.cover,
)),
),
),
Positioned(
top: height * 0.24,
left: width * 0.08,
child: Text(
'Welcome\nBack',
style: TextStyle(
letterSpacing: 0.9,
fontFamily: 'Aldrich',
color: Color(0xFFF0F0F0),
fontSize: 30,
shadows: [
Shadow(
blurRadius: 2,
color: Colors.black54,
offset: Offset(1.0, 1.0))
],
),
),
)
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 20),
height: height * 0.57,
width: width,
child: MaterialApp(
debugShowCheckedModeBanner: false,
initialRoute: '/',
routes: {
'/': (context) => IndexOptions(),
'/login': (context) => LoginScreen(),
'/signup': (context) => SignUpScreen(),
},
// home:
),
),
],
),
);
}
}
36 changes: 36 additions & 0 deletions covid_tracker_flutter/lib/screens/index_options.dart
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';

class IndexOptions extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: Container(
height: 100,
width: 400,
color: Colors.grey,
child: Text('Sign In'),
),
),
GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: Container(
height: 100,
width: 400,
color: Colors.green,
child: Text('Sign Up'),
),
),
],
),
);
}
}
12 changes: 12 additions & 0 deletions covid_tracker_flutter/lib/screens/login.dart
@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';

class LoginScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Text('containeer here\n This is the login screen.'),
),
);
}
}
15 changes: 15 additions & 0 deletions covid_tracker_flutter/lib/screens/signup.dart
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class SignUpScreen extends StatefulWidget {
@override
_SignUpScreenState createState() => _SignUpScreenState();
}

class _SignUpScreenState extends State<SignUpScreen> {
@override
Widget build(BuildContext context) {
return Container(
child: Text('SignUp Screen!!!!!!!!!'),
);
}
}

0 comments on commit 91eb171

Please sign in to comment.