This file contains hidden or 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 RouteManager implements IRouteManager { | |
@override | |
double calculateDistance(LatLng cordinate, LatLng secondCordinate) { | |
return (distanceBetween( | |
cordinate.latitude, cordinate.longitude, secondCordinate.latitude, secondCordinate.longitude)) | |
.roundToDouble() / | |
1000; | |
} | |
} |
This file contains hidden or 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 PointsCompleted extends PointsState { | |
final List<Coordinate> coordinates; | |
final int selectedItem; | |
PointsCompleted(this.coordinates, {this.selectedItem}); | |
PointsCompleted copyWith({ | |
List<Coordinate> coordinates, | |
int selectedItem, |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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), |