mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 04:49:21 +00:00
Simplify #Forez application configuration
This commit is contained in:
parent
d142a0de3b
commit
96b737de67
34
lib/forez/init.dart
Normal file
34
lib/forez/init.dart
Normal file
@ -0,0 +1,34 @@
|
||||
import 'package:comunic/forez/helpers/forez_group_helper.dart';
|
||||
import 'package:comunic/forez/tour/forez_tour_builder.dart';
|
||||
import 'package:comunic/forez/ui/routes/forez_route.dart';
|
||||
import 'package:comunic/models/config.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Forez initialization
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
class ForezConfig extends Config {
|
||||
ForezConfig({
|
||||
@required String apiServerName,
|
||||
@required String apiServerUri,
|
||||
@required bool apiServerSecure,
|
||||
@required String clientName,
|
||||
}) : super(
|
||||
apiServerName: apiServerName,
|
||||
apiServerUri: apiServerUri,
|
||||
apiServerSecure: apiServerSecure,
|
||||
clientName: clientName,
|
||||
splashBackgroundColor: Colors.green.shade900,
|
||||
primaryColor: Colors.green,
|
||||
primaryColorDark: Colors.green.shade900,
|
||||
appName: "#Forez",
|
||||
appQuickDescription: tr("Events organisation in Forez plain"),
|
||||
unreadConversationColor: Colors.green.shade900,
|
||||
defaultConversationColor: Colors.green.shade900,
|
||||
toursEntriesBuilder: buildTour,
|
||||
additionalLoading: () => ForezGroupHelper.refreshInfo(),
|
||||
mainRouteBuilder: (c, k) => ForezRoute(key: k),
|
||||
);
|
||||
}
|
@ -1,12 +1,8 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:comunic/forez/helpers/forez_group_helper.dart';
|
||||
import 'package:comunic/forez/tour/forez_tour_builder.dart';
|
||||
import 'package:comunic/forez/ui/routes/forez_route.dart';
|
||||
import 'package:comunic/forez/init.dart';
|
||||
import 'package:comunic/main.dart';
|
||||
import 'package:comunic/models/config.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Forez development configuration
|
||||
///
|
||||
@ -24,21 +20,11 @@ class MyHttpOverride extends HttpOverrides {
|
||||
}
|
||||
|
||||
void main() {
|
||||
Config.set(Config(
|
||||
Config.set(ForezConfig(
|
||||
apiServerName: "192.168.1.9:3000",
|
||||
apiServerUri: "/",
|
||||
apiServerSecure: false,
|
||||
clientName: "ForezFlutter",
|
||||
splashBackgroundColor: Colors.green.shade900,
|
||||
primaryColor: Colors.green,
|
||||
primaryColorDark: Colors.green.shade900,
|
||||
appName: "#Forez",
|
||||
appQuickDescription: tr("Events organisation in Forez plain"),
|
||||
unreadConversationColor: Colors.green.shade900,
|
||||
defaultConversationColor: Colors.green.shade900,
|
||||
toursEntriesBuilder: buildTour,
|
||||
additionalLoading: () => ForezGroupHelper.refreshInfo(),
|
||||
mainRouteBuilder: (c, k) => ForezRoute(key: k),
|
||||
));
|
||||
|
||||
HttpOverrides.global = new MyHttpOverride();
|
||||
|
Loading…
Reference in New Issue
Block a user