mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-07 17:33:22 +00:00
56 lines
1.5 KiB
Dart
56 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:simplex_chat/app_routes.dart';
|
|
import 'package:simplex_chat/constants.dart';
|
|
import 'package:simplex_chat/views/onBoarding/intro_view.dart';
|
|
import 'package:simplex_chat/views/setup_profile_view.dart';
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'SimpleX Chat',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.teal,
|
|
primaryColor: kPrimaryColor,
|
|
accentColor: kPrimaryColor,
|
|
),
|
|
builder: (context, widget) {
|
|
return ScrollConfiguration(
|
|
behavior: ScrollBehaviorModified(),
|
|
child: widget!,
|
|
);
|
|
},
|
|
initialRoute: AppRoutes.intro,
|
|
routes: <String, WidgetBuilder>{
|
|
AppRoutes.intro: (_) => IntroView(),
|
|
AppRoutes.setupProfile: (_) => SetupProfileView(),
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class ScrollBehaviorModified extends ScrollBehavior {
|
|
const ScrollBehaviorModified();
|
|
@override
|
|
ScrollPhysics getScrollPhysics(BuildContext context) {
|
|
switch (getPlatform(context)) {
|
|
case TargetPlatform.iOS:
|
|
case TargetPlatform.macOS:
|
|
case TargetPlatform.android:
|
|
return const BouncingScrollPhysics();
|
|
case TargetPlatform.fuchsia:
|
|
case TargetPlatform.linux:
|
|
case TargetPlatform.windows:
|
|
return const ClampingScrollPhysics();
|
|
}
|
|
}
|
|
}
|