flutter_smartface 0.5.24
flutter_smartface: ^0.5.24 copied to clipboard
Smartface App FFI plugin project.
example/lib/main.dart
// Copyright 2024 Vísica AI Solutions. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smartface_example/alpha_page.dart';
import 'package:flutter_smartface_example/firebase_options.dart';
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: navigatorKey,
debugShowCheckedModeBanner: false,
title: 'Flutter Smartface Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSwatch(
primarySwatch: Colors.purple,
accentColor: Colors.purple[800],
),
brightness: Brightness.light,
primaryColor: Colors.purple[800],
fontFamily: 'Montserrat',
textTheme: const TextTheme(
titleLarge: TextStyle(fontSize: 36.0, fontWeight: FontWeight.bold),
bodyMedium: TextStyle(fontSize: 14.0, fontFamily: 'Hind'),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white,
backgroundColor: Colors.purple[800],
textStyle: const TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
),
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 12.0,
),
minimumSize: const Size.fromHeight(50),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
),
sliderTheme: SliderThemeData(
activeTrackColor: Colors.purple[400],
inactiveTrackColor: Colors.purple[100],
thumbColor: Colors.purple[600],
overlayColor:
Colors.purple[300]?.withOpacity(0.2), // Transparency slide circle
thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 12.0),
overlayShape: const RoundSliderOverlayShape(overlayRadius: 28.0),
),
inputDecorationTheme: InputDecorationTheme(
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(
color: Colors.purple,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(
color: Colors.red,
width: 2.0,
),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: const BorderSide(
color: Colors.red,
width: 2.0,
),
),
hintStyle: const TextStyle(
color: Colors.grey,
fontSize: 14.0,
),
),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: Colors.purple[800],
selectedItemColor: Colors.white,
unselectedItemColor: Colors.white70,
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600),
),
appBarTheme: AppBarTheme(
color: Colors.purple[800],
iconTheme: const IconThemeData(
color: Colors.white,
),
elevation: 0,
toolbarTextStyle: const TextTheme(
titleLarge: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
).bodyMedium,
titleTextStyle: const TextTheme(
titleLarge: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
).titleLarge,
),
),
home: const AlphaPage(),
);
}
}