You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
Dart
62 lines
1.9 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:tangheem/ui/common_appbar.dart';
|
|
import 'package:tangheem/ui/screens/home_screen.dart';
|
|
import 'package:tangheem/ui/screens/surah_screen.dart';
|
|
import 'package:tangheem/ui/screens/tangheem_screen.dart';
|
|
import 'classes/const.dart';
|
|
|
|
void main() {
|
|
runApp(Application());
|
|
}
|
|
|
|
class Application extends StatelessWidget {
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Tangheem',
|
|
theme: lightTheme(),
|
|
debugShowCheckedModeBanner: false,
|
|
initialRoute: HomeScreen.routeName,
|
|
onGenerateRoute: (settings) {
|
|
var className;
|
|
switch (settings.name) {
|
|
case HomeScreen.routeName:
|
|
className = CommonAppbar(showDrawer: true, child: HomeScreen());
|
|
break;
|
|
case TangheemScreen.routeName:
|
|
className = CommonAppbar(child: TangheemScreen());
|
|
break;
|
|
case SurahScreen.routeName:
|
|
String query = settings.arguments.toString();
|
|
className = CommonAppbar(child: SurahScreen(query: query));
|
|
break;
|
|
}
|
|
return goToNavigation(className);
|
|
});
|
|
}
|
|
|
|
PageRoute goToNavigation(var className) {
|
|
if (Platform.isIOS) {
|
|
return CupertinoPageRoute(builder: (context) => className);
|
|
}
|
|
return MaterialPageRoute(builder: (context) => className);
|
|
}
|
|
|
|
ThemeData lightTheme() {
|
|
return ThemeData(
|
|
fontFamily: 'DroidKufi',
|
|
brightness: Brightness.light,
|
|
backgroundColor: Const.secondaryWhite,
|
|
primarySwatch: Colors.blue,
|
|
primaryColor: Colors.white,
|
|
primaryColorBrightness: Brightness.light,
|
|
primaryColorLight: Colors.white,
|
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
|
);
|
|
}
|
|
}
|