Skip to content

Commit

Permalink
Merge pull request #10 from Team-Optix-3749/barcode-scanner
Browse files Browse the repository at this point in the history
Barcode scanner
  • Loading branch information
rjawesome authored Dec 31, 2023
2 parents 88f8d2a + d0f2334 commit b22682e
Show file tree
Hide file tree
Showing 37 changed files with 639 additions and 306 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1.3.2
- uses: subosito/flutter-action@v2
- run: flutter pub get
- run: flutter build apk

41 changes: 19 additions & 22 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.0'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
Expand All @@ -27,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
16 changes: 11 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ class MyApp extends StatelessWidget {
],
);
return MultiProvider(
providers: [StreamProvider<firebase.User>.value(value: Auth.authState())],
child: Consumer<firebase.User>(
providers: [
StreamProvider<firebase.User?>.value(
value: Auth.authState(),
initialData: null,
)
],
child: Consumer<firebase.User?>(
builder: (context, user, child) {
if (user != null) {
return FutureProvider<firebase.IdTokenResult>(
return FutureProvider<firebase.IdTokenResult?>(
initialData: null,
create: (_) => user.getIdTokenResult(),
child: MaterialApp(
title: 'OptixToolkit',
Expand Down Expand Up @@ -66,8 +72,8 @@ class MyApp extends StatelessWidget {
class MainApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (Provider.of<firebase.User>(context) == null) return FormPage();
if (Provider.of<firebase.IdTokenResult>(context) == null) return Loading();
if (Provider.of<firebase.User?>(context) == null) return FormPage();
if (Provider.of<firebase.IdTokenResult?>(context) == null) return Loading();
return MyStatefulWidget();
}
}
2 changes: 1 addition & 1 deletion lib/services/Alert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:google_fonts/google_fonts.dart';

class Alert extends StatelessWidget {
final String alert;
const Alert({Key key, this.alert}) : super(key: key);
const Alert({Key? key, required this.alert}) : super(key: key);

static Future<void> showAlert(BuildContext context, String error) async {
return showDialog<void>(
Expand Down
2 changes: 1 addition & 1 deletion lib/services/Good.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:google_fonts/google_fonts.dart';

class Good extends StatelessWidget {
final String good;
const Good({Key key, this.good}) : super(key: key);
const Good({Key? key, required this.good}) : super(key: key);

static Future<void> showGood(BuildContext context, String good) async {
return showDialog<void>(
Expand Down
2 changes: 1 addition & 1 deletion lib/services/GoodPop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:google_fonts/google_fonts.dart';

class GoodPop extends StatelessWidget {
final String good;
const GoodPop({Key key, this.good}) : super(key: key);
const GoodPop({Key? key, required this.good}) : super(key: key);

static Future<void> showGood(BuildContext context, String good) async {
return showDialog<void>(
Expand Down
10 changes: 5 additions & 5 deletions lib/services/NavigationService.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ class NavigationService {
static final GlobalKey<NavigatorState> navigatorKey =
new GlobalKey<NavigatorState>();
static Future<dynamic> navigateTo(Route<Object> route) {
return navigatorKey.currentState.pushReplacement(route);
return navigatorKey.currentState!.pushReplacement(route);
}

static Future<dynamic> goTo(Route<Object> route) {
return navigatorKey.currentState.push(route);
return navigatorKey.currentState!.push(route);
}

static Future<dynamic> goToAndThen(Route<Object> route, Function f) {
return navigatorKey.currentState.push(route).then(f);
static Future<dynamic> goToAndThen(Route<Object> route, Function(Object?) f) {
return navigatorKey.currentState!.push(route).then(f);
}

static void pop() {
return navigatorKey.currentState.pop();
return navigatorKey.currentState!.pop();
}
}
Loading

0 comments on commit b22682e

Please sign in to comment.