ocg_location 0.0.13 ocg_location: ^0.0.13 copied to clipboard
A new Flutter package project.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ocg_location/ocg_location.dart';
import 'config/app_config.dart';
import 'screens/home_screen.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
LocationRepository locationRepository =
LocationGoogleRepository(AppConfig.GOOGLE_API_KEY);
return MultiBlocProvider(
providers: [
BlocProvider<LocationCurrentBloc>(
create: (context) => LocationCurrentBloc(locationRepository),
),
BlocProvider<LocationSearchBloc>(
create: (context) => LocationSearchBloc(locationRepository),
),
BlocProvider<LocationDetailBloc>(
create: (context) => LocationDetailBloc(locationRepository),
)
],
child: MaterialApp(
title: 'Location Demo',
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomeScreen(),
),
);
}
}