Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated UI, fixed bugs and refactored code #45

Merged
merged 16 commits into from
Jan 12, 2022
356 changes: 187 additions & 169 deletions lib/components/create_join_dialog.dart

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions lib/components/dialog_boxes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class DialogBoxes {
buttonWidth: 8.w,
onTap: () => Navigator.of(context).pop(false),
text: 'No',
textSize: 18.0,
),
HikeButton(
buttonHeight: 2.5.h,
Expand All @@ -35,6 +36,7 @@ class DialogBoxes {
navigationService.removeAllAndPush('/main', '/');
},
text: 'Yes',
textSize: 18.0,
),
],
);
Expand All @@ -58,19 +60,21 @@ class DialogBoxes {
children: <Widget>[
Text(
'Change Beacon Duration',
style: TextStyle(color: kYellow, fontSize: 12),
style:
TextStyle(color: kYellow, fontSize: 14.0),
),
],
),
),
),
SizedBox(
height: 30,
height: 3.h,
),
Flexible(
child: HikeButton(
buttonWidth: 48,
buttonWidth: optbwidth,
text: 'Done',
textSize: 18.0,
textColor: Colors.white,
buttonColor: kYellow,
onTap: () {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/hike_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HikeButton extends StatelessWidget {
this.buttonColor = kYellow,
this.text,
this.textColor = Colors.white,
this.buttonWidth = 32,
this.buttonWidth = 32, //button sizes have been defined in constants.dart
this.buttonHeight = 32,
this.textSize = 18});

Expand Down
15 changes: 10 additions & 5 deletions lib/components/hike_screen_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:share/share.dart';
import 'package:sizer/sizer.dart';

class HikeScreenWidget {
static copyPasskey(String passkey) {
Expand All @@ -24,7 +25,7 @@ class HikeScreenWidget {
context: context,
builder: (context) => Dialog(
child: Container(
height: 400,
height: 35.h,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 32, vertical: 16),
Expand All @@ -40,11 +41,13 @@ class HikeScreenWidget {
),
),
SizedBox(
height: 30,
height: 3.h,
),
Flexible(
child: HikeButton(
textSize: 20,
buttonHeight: optbheight,
buttonWidth: optbwidth,
textSize: 18,
text: 'Generate URL',
textColor: Colors.white,
buttonColor: kYellow,
Expand All @@ -54,11 +57,13 @@ class HikeScreenWidget {
}),
),
SizedBox(
height: 10,
height: 1.h,
),
Flexible(
child: HikeButton(
textSize: 20,
buttonHeight: optbheight * 1,
buttonWidth: optbwidth,
textSize: 18,
text: 'Copy Passkey',
textColor: Colors.white,
buttonColor: kYellow,
Expand Down
22 changes: 12 additions & 10 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,20 @@ void main() async {
await Hive.openBox<User>('currentUser');
await Hive.openBox<Beacon>('beacons');
setupLocator();
runApp(OverlaySupport(
child: Sizer(
builder: (context, orientation, deviceType) => MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Beacon',
navigatorKey: navigationService.navigatorKey,
theme: ThemeData(fontFamily: 'FuturaBold'),
initialRoute: '/',
onGenerateRoute: router.generateRoute,
runApp(
OverlaySupport(
child: Sizer(
builder: (context, orientation, deviceType) => MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Beacon',
navigatorKey: navigationService.navigatorKey,
theme: ThemeData(fontFamily: 'FuturaBold'),
initialRoute: '/',
onGenerateRoute: router.generateRoute,
),
),
),
));
);
}

class DemoPageView extends StatelessWidget {
Expand Down
10 changes: 10 additions & 0 deletions lib/utilities/constants.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:sizer/sizer.dart';

const Color kYellow = Color(0xFFFDBB2C);
const Color kBlue = Color(0xFF222375);
const Color kLightBlue = Color(0xFFE8F1F8);
const Color kBlack = Color(0xFF343434);
const Color shimmerSkeletonColor = Color(0xff4e4f91);
const Color hintColor = Colors.black54; // Hint Text Color
const double CAMERA_ZOOM = 15;
const double CAMERA_TILT = 80;
const double CAMERA_BEARING = 30;

// Button Sizings
final double labelsize = 20;
final double hintsize = 18;
final double homebheight = 4.45.h;
final double homebwidth = 3.w;
final double optbheight = 3.5.h;
final double optbwidth = 8.w;

class AppConstants {
static Future<LatLng> getLocation() async {
bool serviceEnabled;
Expand Down
2 changes: 1 addition & 1 deletion lib/view_model/home_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class HomeViewModel extends BaseModel {
}
//Snackbar is displayed by joinBeacon itself on any error or trying to join expired beacon.
} else {
navigationService.showSnackBar('Enter valid passkey');
navigationService.showSnackBar('Enter Valid Passkey');
}
}

Expand Down
Loading