Skip to content

Commit

Permalink
final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SayujSujeev committed Oct 22, 2020
1 parent 398c070 commit 0ca9ec5
Show file tree
Hide file tree
Showing 14 changed files with 954 additions and 100 deletions.
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
105 changes: 5 additions & 100 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:drink_order_app_ui/screens/home/home_screen.dart';
import 'package:flutter/material.dart';

void main() {
Expand All @@ -9,109 +10,13 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Dem',
title: 'Drink Order App',
debugShowCheckedModeBanner: false,
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'),
home: HomeScreen(),
);
}
}

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.
);
}
}
}
112 changes: 112 additions & 0 deletions lib/screens/detail/components/background.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import 'package:drink_order_app_ui/constants/constants.dart';
import 'package:drink_order_app_ui/constants/custom_icons_icons.dart';
import 'package:flutter/material.dart';

class Background extends StatefulWidget {
final String drinkImageUrl;

Background(this.drinkImageUrl);

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

class _BackgroundState extends State<Background> {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;

return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
height: size.height * 0.55,
width: size.width,
image: AssetImage(widget.drinkImageUrl),
fit: BoxFit.cover,
),
Padding(
padding: EdgeInsets.only(bottom: appPadding, left: appPadding * 1.5),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Total Order',
style: TextStyle(
color: white,
fontSize: 18,
),
),
SizedBox(
height: size.height * 0.02,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Column(
children: [
Stack(
children: [
Icon(
CustomIcons.cocktails,
color: white.withOpacity(0.4),
size: 30,
),
Positioned(
right: 0,
child: Container(
height: size.height * 0.025,
width: size.width * 0.05,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: grey_dark.withOpacity(0.8)),
child: Center(
child: Text(
'3',
style: TextStyle(color: white),
),
),
),
)
],
),
SizedBox(
height: size.height * 0.01,
),
Text(
'Total Drinks',
style: TextStyle(
color: white.withOpacity(0.4), fontSize: 10.0),
)
],
),
SizedBox(
width: size.height * 0.1,
),
Column(
children: [
Text(
'\$32',
style: TextStyle(color: white,fontSize: 24,fontWeight: FontWeight.bold),
),
SizedBox(
height: size.height * 0.01,
),
Text(
'Total Price',
style: TextStyle(
color: white.withOpacity(0.4), fontSize: 10.0),
)
],
)
],
)
],
),
)
],
);
}
}
32 changes: 32 additions & 0 deletions lib/screens/detail/components/curve_clipper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';

class CurveClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
Path path = Path();
path.lineTo(0, size.height * 0.7);
Offset curvePoint1 = Offset(0, size.height * 0.78);
Offset centerPoint = Offset(size.width * 0.075, size.height * 0.8);
path.quadraticBezierTo(
curvePoint1.dx, curvePoint1.dy, centerPoint.dx, centerPoint.dy);

path.lineTo(size.width * 0.925, size.height);

Offset curvePoint2 = Offset(size.width, size.height);
Offset endPoint = Offset(size.width, size.height * 0.9);

path.quadraticBezierTo(
curvePoint2.dx, curvePoint2.dy, endPoint.dx, endPoint.dy);

path.lineTo(size.width, 0);

path.close();
return path;
}

@override
bool shouldReclip(covariant CustomClipper oldClipper) {
return false;
}

}
28 changes: 28 additions & 0 deletions lib/screens/detail/components/custom_back_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:drink_order_app_ui/constants/constants.dart';
import 'package:flutter/material.dart';

class CustomBackButton extends StatelessWidget {
@override
Widget build(BuildContext context) {

Size size = MediaQuery.of(context).size;

return GestureDetector(
onTap: () => {
Navigator.pop(context),
},
child: Padding(
padding: const EdgeInsets.only(left: appPadding,top: appPadding * 1.5),
child: Container(
height: size.height * 0.075,
width: size.width * 0.15,
decoration: BoxDecoration(
color: grey_dark,
borderRadius: BorderRadius.circular(20.0),
),
child: Icon(Icons.arrow_back_ios,color: white,size: 25.0,),
),
),
);
}
}
Loading

0 comments on commit 0ca9ec5

Please sign in to comment.