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