Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
3rd Party Integration Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Nov 5, 2021
1 parent b9e3d10 commit 53436a2
Show file tree
Hide file tree
Showing 36 changed files with 2,489 additions and 2,322 deletions.
Binary file added assets/images/grab/delicious.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/grab/grab_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/grab/grab_2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions lib/components/buttons.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import "package:flutter/material.dart";
import "package:flutter_gen/gen_l10n/app_localizations.dart";
import "package:food_busters/styles/styles.dart";

Widget backHomeBtn(BuildContext context, AppLocalizations text) =>
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(
text.back_to_home,
style: const TextStyle(fontSize: 18),
),
style: loginRegisterBtn,
);
import "package:flutter/material.dart";
import "package:flutter_gen/gen_l10n/app_localizations.dart";
import "package:food_busters/styles/styles.dart";

Widget backHomeBtn(BuildContext context, AppLocalizations text) =>
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(
text.back_to_home,
style: const TextStyle(fontSize: 18),
),
style: loginRegisterBtn,
);
118 changes: 59 additions & 59 deletions lib/components/exchange_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
import "package:flutter/material.dart";
import "package:flutter_gen/gen_l10n/app_localizations.dart";
import "package:food_busters/styles/styles.dart";

AlertDialog exchangeSuccess(
AppLocalizations text,
BuildContext context, {
bool showQR = false,
}) =>
AlertDialog(
title: Text(text.exchange.toUpperCase(), textAlign: TextAlign.center),
backgroundColor: lightGreen,
content: showQR
? Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(text.exchange_complete),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Image.asset("assets/images/dummy_QR.png"),
),
Text(text.use_this_qr, style: const TextStyle(fontSize: 12)),
],
)
: Text(text.exchange_complete),
actions: [
TextButton(
child: Text(
text.window_close,
style: const TextStyle(
color: Colors.black,
),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);

AlertDialog exchangeFailed(AppLocalizations text, BuildContext context) =>
AlertDialog(
title: Text(text.exchange.toUpperCase(), textAlign: TextAlign.center),
backgroundColor: rose,
content: Text(text.exchange_failed),
actions: [
TextButton(
child: Text(
text.window_close,
style: const TextStyle(
color: Colors.black,
),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
import "package:flutter/material.dart";
import "package:flutter_gen/gen_l10n/app_localizations.dart";
import "package:food_busters/styles/styles.dart";

AlertDialog exchangeSuccess(
AppLocalizations text,
BuildContext context, {
bool showQR = false,
}) =>
AlertDialog(
title: Text(text.exchange.toUpperCase(), textAlign: TextAlign.center),
backgroundColor: lightGreen,
content: showQR
? Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(text.exchange_complete),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Image.asset("assets/images/dummy_QR.png"),
),
Text(text.use_this_qr, style: const TextStyle(fontSize: 12)),
],
)
: Text(text.exchange_complete),
actions: [
TextButton(
child: Text(
text.window_close,
style: const TextStyle(
color: Colors.black,
),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);

AlertDialog exchangeFailed(AppLocalizations text, BuildContext context) =>
AlertDialog(
title: Text(text.exchange.toUpperCase(), textAlign: TextAlign.center),
backgroundColor: rose,
content: Text(text.exchange_failed),
actions: [
TextButton(
child: Text(
text.window_close,
style: const TextStyle(
color: Colors.black,
),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
82 changes: 41 additions & 41 deletions lib/components/green_leaves.dart
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import "package:flutter/material.dart";

List<Widget> greenLeaves(int count) {
List<Widget> widgets = [];
for (int i = 0; i < count; i++) {
widgets.add(leaf);
}
return widgets;
}

List<Widget> bigGreenLeaves(int count) {
List<Widget> widgets = [];
for (int i = 0; i < count; i++) {
widgets.add(bigLeaf);
}
return widgets;
}

final leaf = Container(
height: 30,
width: 30,
decoration: const BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/leaf.png"),
),
),
);

final bigLeaf = Container(
height: 60,
width: 60,
decoration: const BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/leaf.png"),
),
),
);
import "package:flutter/material.dart";

List<Widget> greenLeaves(int count) {
List<Widget> widgets = [];
for (int i = 0; i < count; i++) {
widgets.add(leaf);
}
return widgets;
}

List<Widget> bigGreenLeaves(int count) {
List<Widget> widgets = [];
for (int i = 0; i < count; i++) {
widgets.add(bigLeaf);
}
return widgets;
}

final leaf = Container(
height: 30,
width: 30,
decoration: const BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/leaf.png"),
),
),
);

final bigLeaf = Container(
height: 60,
width: 60,
decoration: const BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/images/leaf.png"),
),
),
);
8 changes: 4 additions & 4 deletions lib/data/delay.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// * Simulate Server Request
Future<void> serverRequest() async {
await Future.delayed(const Duration(milliseconds: 1000));
}
// * Simulate Server Request
Future<void> serverRequest() async {
await Future.delayed(const Duration(milliseconds: 1000));
}
Loading

0 comments on commit 53436a2

Please sign in to comment.