-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d74e04
commit a0cb38a
Showing
10 changed files
with
548 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,88 @@ | ||
// Dart imports: | ||
import 'dart:async'; | ||
|
||
import 'package:camera/camera.dart'; | ||
// Flutter imports: | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
// Package imports: | ||
import 'package:camera/camera.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:flutter_statusbar_manager/flutter_statusbar_manager.dart'; | ||
|
||
// Project imports: | ||
import 'view/home_screen.dart'; | ||
|
||
class MyBehavior extends ScrollBehavior { | ||
@override | ||
Widget buildViewportChrome( | ||
BuildContext context, Widget child, AxisDirection axisDirection) { | ||
return child; | ||
} | ||
} | ||
|
||
List<CameraDescription> cameras; | ||
|
||
Future<void> main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
cameras = await availableCameras(); | ||
SystemChrome.setSystemUIOverlayStyle( | ||
SystemUiOverlayStyle( | ||
statusBarColor: Colors.white, | ||
statusBarIconBrightness: Brightness.light, | ||
statusBarBrightness: Brightness.light, | ||
systemNavigationBarColor: Colors.white, | ||
systemNavigationBarIconBrightness: Brightness.dark, | ||
), | ||
await FlutterStatusbarManager.setStyle(StatusBarStyle.DARK_CONTENT); | ||
await FlutterStatusbarManager.setColor( | ||
Colors.transparent, | ||
animated: true, | ||
); | ||
await FlutterStatusbarManager.setNavigationBarColor( | ||
Colors.transparent, | ||
animated: true, | ||
); | ||
runApp(MyApp()); | ||
} | ||
|
||
class MyApp extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
theme: ThemeData( | ||
primaryColor: Colors.black, | ||
accentColor: Color(0xffF92B5C), | ||
backgroundColor: Colors.white, | ||
visualDensity: VisualDensity.adaptivePlatformDensity, | ||
fontFamily: 'metropolis', | ||
brightness: Brightness.light, | ||
return ScreenUtilInit( | ||
designSize: Size(1080, 1920), | ||
allowFontScaling: true, | ||
builder: () => MaterialApp( | ||
theme: ThemeData( | ||
primaryColor: Colors.black, | ||
accentColor: Color(0xffF92B5C), | ||
backgroundColor: Colors.white, | ||
visualDensity: VisualDensity.adaptivePlatformDensity, | ||
fontFamily: 'metropolis', | ||
brightness: Brightness.light, | ||
textButtonTheme: TextButtonThemeData( | ||
style: ButtonStyle( | ||
backgroundColor: MaterialStateProperty.all(Colors.black), | ||
foregroundColor: MaterialStateProperty.all(Colors.white), | ||
padding: MaterialStateProperty.all( | ||
EdgeInsets.symmetric(vertical: 15, horizontal: 25), | ||
), | ||
shape: MaterialStateProperty.all( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
), | ||
), | ||
alignment: Alignment.center, | ||
enableFeedback: true, | ||
elevation: MaterialStateProperty.all(20), | ||
shadowColor: MaterialStateProperty.all(Colors.black12), | ||
), | ||
), | ||
), | ||
home: Home(cameras: cameras), | ||
debugShowCheckedModeBanner: false, | ||
builder: (context, child) { | ||
return MediaQuery( | ||
data: MediaQuery.of(context).copyWith(textScaleFactor: 0.9), | ||
child: ScrollConfiguration( | ||
behavior: MyBehavior(), | ||
child: child, | ||
), | ||
); | ||
}, | ||
), | ||
home: Home(cameras: cameras), | ||
debugShowCheckedModeBanner: false, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Flutter imports: | ||
import 'package:flutter/material.dart'; | ||
|
||
// Package imports: | ||
import 'package:boxicons_flutter/boxicons_flutter.dart'; | ||
import 'package:share/share.dart'; | ||
|
||
// Project imports: | ||
import '../../model/data.dart'; | ||
|
||
class MyAppBar extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
RichText( | ||
text: TextSpan( | ||
text: "Dizzy\n", | ||
style: TextStyle( | ||
color: Colors.black, | ||
fontFamily: "metropolis", | ||
fontWeight: FontWeight.w400, | ||
fontSize: 40, | ||
height: 1.1, | ||
), | ||
children: [ | ||
TextSpan( | ||
text: "Check", | ||
style: TextStyle( | ||
fontWeight: FontWeight.w700, | ||
fontSize: 45, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
IconButton( | ||
icon: Icon( | ||
Boxicons.bxShareAlt, | ||
size: 30, | ||
), | ||
iconSize: 30, | ||
padding: EdgeInsets.all(12), | ||
color: Colors.black, | ||
onPressed: () { | ||
Share.share('My latency is $avg ms.'); | ||
}, | ||
), | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.