forked from yaso_meth/mih-project
orientation v3
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:patient_manager/mih_env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
@@ -16,8 +15,5 @@ void main() async {
|
||||
);
|
||||
setUrlStrategy(PathUrlStrategy());
|
||||
FlutterNativeSplash.remove();
|
||||
SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp, DeviceOrientation.landscapeLeft])
|
||||
.then((value) => runApp(const MzanziInnovationHub()));
|
||||
//runApp(const MzanziInnovationHub());
|
||||
runApp(const MzanziInnovationHub());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:patient_manager/mih_env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
@@ -16,8 +15,5 @@ void main() async {
|
||||
);
|
||||
setUrlStrategy(PathUrlStrategy());
|
||||
FlutterNativeSplash.remove();
|
||||
SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp, DeviceOrientation.landscapeLeft])
|
||||
.then((value) => runApp(const MzanziInnovationHub()));
|
||||
//runApp(const MzanziInnovationHub());
|
||||
runApp(const MzanziInnovationHub());
|
||||
}
|
||||
|
||||
@@ -27,15 +27,29 @@ class _AuthCheckState extends State<AuthCheck> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: FutureBuilder(
|
||||
future: signedIn,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data == true) {
|
||||
return const MIHProfileGetter();
|
||||
} else {
|
||||
return const SignInOrRegister();
|
||||
}
|
||||
}),
|
||||
body: OrientationBuilder(
|
||||
builder: (BuildContext context, Orientation orientation) {
|
||||
// Return a widget tree based on the orientation
|
||||
return FutureBuilder(
|
||||
future: signedIn,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data == true) {
|
||||
return const MIHProfileGetter();
|
||||
} else {
|
||||
return const SignInOrRegister();
|
||||
}
|
||||
});
|
||||
},
|
||||
// child: FutureBuilder(
|
||||
// future: signedIn,
|
||||
// builder: (context, snapshot) {
|
||||
// if (snapshot.data == true) {
|
||||
// return const MIHProfileGetter();
|
||||
// } else {
|
||||
// return const SignInOrRegister();
|
||||
// }
|
||||
// }),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user