This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Positioned positionedPageView( | |
BuildContext context, PointsCompleted completed) { | |
return Positioned( | |
height: context.dynamicHeight(0.12), | |
bottom: 0, | |
right: 0, | |
left: -context.dynamicWidth(0.1), | |
child: PageView.builder( | |
onPageChanged: (value) { | |
context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<SingleChildWidget> providerItems = [ Provider.value(value: CustomMarkerManager())}] | |
class CustomMarkerManager extends CustomMarker { | |
Map<int, BitmapDescriptor> _markers = {}; | |
Future<BitmapDescriptor> getCustomMarker({ | |
int value, | |
Color clusterColor, | |
Color textColor, | |
int width, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget buildScaffoldBody() => Scaffold( | |
key: scaffoldKey, | |
body: BlocConsumer<PointsCubit, PointsState>( | |
listener: (context, state) { | |
if (state.runtimeType == PointsError) { | |
scaffoldKey.currentState | |
.showSnackBar(SnackBar(content: Text("Error"))); | |
} | |
}, | |
builder: (context, state) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> initMapControllerMarkers(GoogleMapController controller, | |
BuildContext context, List<Coordinate> coordinates) async { | |
CustomMarkerManager markerManager = context.read<CustomMarkerManager>(); | |
for (var i = 0; i < coordinates.length; i++) { | |
final icon = await markerManager.getCustomMarker( | |
value: i, | |
clusterColor: Colors.orange, | |
textColor: Colors.white, | |
width: _markersWidth); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class LineState extends Equatable { | |
final GoogleMapController controller; | |
final int currentIndex; | |
LineState(this.controller, this.currentIndex); | |
} | |
class MapsMarkerChange extends LineState { | |
MapsMarkerChange(GoogleMapController controller, int currentIndex) | |
: super(controller, currentIndex); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class IMapService { | |
final INetworkManager service; | |
final GlobalKey<ScaffoldState> scaffoldKey; | |
IMapService(this.service, this.scaffoldKey); | |
Future<List<Coordinate>> getAllPoints(); | |
Future<ClusterCoordinate> getClusterPoints(); | |
void showErrorMessage(IErrorModel response) { | |
if (this.scaffoldKey != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegexConstants { | |
static RegexConstants _instance; | |
static RegexConstants get instance { | |
if (_instance == null) { | |
_instance = RegexConstants._init(); | |
} | |
return _instance; | |
} | |
RegexConstants._init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListView _buildListview(AsyncSnapshot<List<GiyimModel>> snapshot) { | |
return ListView.builder( | |
itemCount: snapshot.data.length, | |
itemBuilder: (BuildContext context, int index) { | |
GiyimModel item = snapshot.data[index]; | |
return Container( | |
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15), | |
decoration: BoxDecoration( | |
color: Colors.white, | |
borderRadius: BorderRadius.circular(6), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:statemanagement/bloc/cats_cubit.dart'; | |
import 'package:statemanagement/bloc/cats_repository.dart'; | |
import 'package:statemanagement/bloc/cats_state.dart'; | |
class BlocCatsView extends StatefulWidget { | |
@override | |
_BlocCatsViewState createState() => _BlocCatsViewState(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension HomePresenter: HomeViewOutputs { | |
func viewDidLoad() { | |
view?.configure(entities: HomeEntities(entryEntity: HomeEntryEntity(language: "vb"))) | |
entites.catApiState = .loading | |
view?.indicatorView(animate: true) | |
dependencies.interactor.fetchCats() | |
view?.setupTableViewCell() | |
} | |
} |