mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2026-08-24 16:50:47 +00:00
Convert 17 multi-file apps to the validated pattern: lib/main.dart keeps only the MaterialApp bootstrap; a new lib/example.dart holds the full entry screen and focused example code, importing existing supporting files (screens/, tabs/, services/, models/, widgets/, utils/). Apps: analytics_integration, animation_example, biometrics, bottom_sheet, custom_home_drawer, google_signin, grid_layout, handling_routes, image_editor, scan_qr_code, statless_counter_app, using_bottom_nav_bar, using_custom_fonts, using_listview, using_listwheelscrollview, using_platform_adaptive, view_pdf_file
33 lines
928 B
Dart
33 lines
928 B
Dart
import 'package:analytics_integration/example.dart';
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
/// initialize your firebase project
|
|
await Firebase.initializeApp();
|
|
runApp(const FlutterAnalyticsApp());
|
|
}
|
|
|
|
class FlutterAnalyticsApp extends StatelessWidget {
|
|
const FlutterAnalyticsApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Flutter Analytics',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
|
),
|
|
|
|
/// this is used to observe navigation changes in the app
|
|
/// and sending data back to Firebase Analytics
|
|
navigatorObservers: <NavigatorObserver>[Example.observer],
|
|
home: const Example(),
|
|
);
|
|
}
|
|
}
|