diff --git a/covid_tracker_flutter/.gitignore b/covid_tracker_flutter/.gitignore new file mode 100644 index 0000000..100dbcd --- /dev/null +++ b/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 diff --git a/covid_tracker_flutter/assets/fonts/Aldrich-Regular.ttf b/covid_tracker_flutter/assets/fonts/Aldrich-Regular.ttf new file mode 100644 index 0000000..9748b03 Binary files /dev/null and b/covid_tracker_flutter/assets/fonts/Aldrich-Regular.ttf differ diff --git a/covid_tracker_flutter/assets/fonts/Montserrat-Bold.ttf b/covid_tracker_flutter/assets/fonts/Montserrat-Bold.ttf new file mode 100644 index 0000000..221819b Binary files /dev/null and b/covid_tracker_flutter/assets/fonts/Montserrat-Bold.ttf differ diff --git a/covid_tracker_flutter/assets/fonts/Montserrat-Light.ttf b/covid_tracker_flutter/assets/fonts/Montserrat-Light.ttf new file mode 100644 index 0000000..990857d Binary files /dev/null and b/covid_tracker_flutter/assets/fonts/Montserrat-Light.ttf differ diff --git a/covid_tracker_flutter/assets/fonts/Montserrat-Regular.ttf b/covid_tracker_flutter/assets/fonts/Montserrat-Regular.ttf new file mode 100644 index 0000000..8d443d5 Binary files /dev/null and b/covid_tracker_flutter/assets/fonts/Montserrat-Regular.ttf differ diff --git a/covid_tracker_flutter/assets/images/virus.png b/covid_tracker_flutter/assets/images/virus.png new file mode 100644 index 0000000..4c7e01d Binary files /dev/null and b/covid_tracker_flutter/assets/images/virus.png differ diff --git a/covid_tracker_flutter/assets/images/virus_banner.png b/covid_tracker_flutter/assets/images/virus_banner.png new file mode 100644 index 0000000..05b977a Binary files /dev/null and b/covid_tracker_flutter/assets/images/virus_banner.png differ diff --git a/covid_tracker_flutter/lib/main.dart b/covid_tracker_flutter/lib/main.dart index 11655b6..cf9aa49 100644 --- a/covid_tracker_flutter/lib/main.dart +++ b/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 { - 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: [ - 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(), ); } } diff --git a/covid_tracker_flutter/lib/screens/index.dart b/covid_tracker_flutter/lib/screens/index.dart new file mode 100644 index 0000000..616a501 --- /dev/null +++ b/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: + ), + ), + ], + ), + ); + } +} diff --git a/covid_tracker_flutter/lib/screens/index_options.dart b/covid_tracker_flutter/lib/screens/index_options.dart new file mode 100644 index 0000000..d19944f --- /dev/null +++ b/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'), + ), + ), + ], + ), + ); + } +} diff --git a/covid_tracker_flutter/lib/screens/login.dart b/covid_tracker_flutter/lib/screens/login.dart new file mode 100644 index 0000000..02eb473 --- /dev/null +++ b/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.'), + ), + ); + } +} diff --git a/covid_tracker_flutter/lib/screens/signup.dart b/covid_tracker_flutter/lib/screens/signup.dart new file mode 100644 index 0000000..e305ea1 --- /dev/null +++ b/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 { + @override + Widget build(BuildContext context) { + return Container( + child: Text('SignUp Screen!!!!!!!!!'), + ); + } +} \ No newline at end of file diff --git a/covid_tracker_flutter/lib/screens/splash.dart b/covid_tracker_flutter/lib/screens/splash.dart new file mode 100644 index 0000000..bd9f30a --- /dev/null +++ b/covid_tracker_flutter/lib/screens/splash.dart @@ -0,0 +1,85 @@ +import 'dart:async'; + +import 'package:covid_tracker_flutter/screens/index.dart'; +import 'package:flutter/material.dart'; + +class SplashScreen extends StatefulWidget { + @override + _SplashScreenState createState() => _SplashScreenState(); +} + +class _SplashScreenState extends State { + @override + void initState() { + super.initState(); + myTimer(); + } + + myTimer() async { + var duration = Duration(milliseconds: 3500); + return Timer(duration, routeNav); + } + + routeNav() { + Navigator.pushReplacement( + context, MaterialPageRoute(builder: (context) => IndexPage())); + } + + @override + Widget build(BuildContext context) { + var height = MediaQuery.of(context).size.height; + var width = MediaQuery.of(context).size.width; + return Scaffold( + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + child: Image.asset('assets/images/virus_banner.png'), + height: height * 0.58, + width: width * 0.8, + ), + Stack( + overflow: Overflow.visible, + alignment: Alignment.center, + children: [ + Positioned( + bottom: height * 0.08, + child: Text('COVID-19', + style: TextStyle( + fontFamily: 'Aldrich', + fontSize: 35, + color: Color(0xFF4F2E2E), + shadows: [ + Shadow( + offset: Offset(0.5, 0.5), + blurRadius: 3.0, + color: Color.fromARGB(120, 0, 0, 0)) + ], + fontWeight: FontWeight.bold), + textAlign: TextAlign.center), + ), + Positioned( + child: Text( + 'Tracker', + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'Aldrich', + fontSize: 35, + color: Color(0xFF4F2E2E), + shadows: [ + Shadow( + offset: Offset(0.5, 0.5), + blurRadius: 3.0, + color: Color.fromARGB(120, 0, 0, 0)) + ], + fontWeight: FontWeight.bold), + ), + ) + ], + ) + ], + ), + ); + } +} diff --git a/covid_tracker_flutter/pubspec.yaml b/covid_tracker_flutter/pubspec.yaml index 5ec3071..c3106fd 100644 --- a/covid_tracker_flutter/pubspec.yaml +++ b/covid_tracker_flutter/pubspec.yaml @@ -45,9 +45,8 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + assets: + - assets/images/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. @@ -60,17 +59,22 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 + fonts: + - family: Montserrat + fonts: + - asset: assets/fonts/Montserrat-Regular.ttf + - asset: assets/fonts/Montserrat-Bold.ttf + weight: 700 + - asset: assets/fonts/Montserrat-Light.ttf + weight: 300 + - family: Aldrich + fonts: + - asset: assets/fonts/Aldrich-Regular.ttf + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages