initial rod app
This commit is contained in:
108
lib/data/location_data.dart
Normal file
108
lib/data/location_data.dart
Normal file
@ -0,0 +1,108 @@
|
||||
String location_line_date = """
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "MultiLineString",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
135.495586,
|
||||
34.701824
|
||||
],
|
||||
[
|
||||
136.491222,
|
||||
35.447526
|
||||
],
|
||||
[
|
||||
137.184305,
|
||||
35.265174
|
||||
],
|
||||
[
|
||||
137.50248,
|
||||
35.859283
|
||||
]
|
||||
]
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"location_id": -1,
|
||||
"location_name": "fdsfsd",
|
||||
"category": "dsfds",
|
||||
"zip": "74120",
|
||||
"address": "567 Bridge Street Tulsa Oklahoma 74120",
|
||||
"prefecture": "fdfs",
|
||||
"area": "fsdfs",
|
||||
"city": "Ho",
|
||||
"photos": "dfs",
|
||||
"videos": "fsdfsd",
|
||||
"webcontents": "fsdfsd",
|
||||
"status": "sdfs",
|
||||
"portal": "fdsfsd",
|
||||
"group": "fdsfsd",
|
||||
"phone": "+94773051841",
|
||||
"fax": "fdsfds",
|
||||
"email": "info@initappz.com",
|
||||
"facility": "fdsfds",
|
||||
"remark": "fdfs",
|
||||
"tags": null,
|
||||
"parammeters": "fsdfsd",
|
||||
"created_at": "2022-03-10T01:23:44.717905+09:00",
|
||||
"last_updated_at": "2022-03-10T01:23:44.717922+09:00",
|
||||
"last_updated_user": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "MultiLineString",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
135.928001,
|
||||
34.233306
|
||||
],
|
||||
[
|
||||
135.998211,
|
||||
34.649591
|
||||
],
|
||||
[
|
||||
136.167984,
|
||||
35.085641
|
||||
]
|
||||
]
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"location_id": 2,
|
||||
"location_name": "fdsfsd",
|
||||
"category": "dsfds",
|
||||
"zip": "32400",
|
||||
"address": "Akkaraipattu 02",
|
||||
"prefecture": "fdfs",
|
||||
"area": "fsdfs",
|
||||
"city": "Akkaraipattu",
|
||||
"photos": "dfs",
|
||||
"videos": "fsdfsd",
|
||||
"webcontents": "fsdfsd",
|
||||
"status": "sdfs",
|
||||
"portal": "fdsfsd",
|
||||
"group": "fdsfsd",
|
||||
"phone": "773051841",
|
||||
"fax": "fdsfds",
|
||||
"email": "admin@front.lk",
|
||||
"facility": "fdsfds",
|
||||
"remark": "fdfs",
|
||||
"tags": "fdsfsd",
|
||||
"parammeters": "fsdfsd",
|
||||
"created_at": "2022-03-10T01:46:58.157320+09:00",
|
||||
"last_updated_at": "2022-03-10T01:46:58.157336+09:00",
|
||||
"last_updated_user": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}""";
|
||||
43
lib/main.dart
Normal file
43
lib/main.dart
Normal file
@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:rogapp/pages/home/home_binding.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/utils/string_values.dart';
|
||||
import 'package:rogapp/utils/util_controller.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
UtilController utilController = Get.put(UtilController());
|
||||
return GetMaterialApp(
|
||||
translations: StringValues(),
|
||||
locale: const Locale('ja', 'JP'),
|
||||
fallbackLocale: const Locale('en', 'US'),
|
||||
title: 'ROGAINING',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||
textTheme: GoogleFonts.muliTextTheme(),
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
defaultTransition: Transition.cupertino,
|
||||
opaqueRoute: Get.isOpaqueRouteDefault,
|
||||
popGesture: Get.isPopGestureEnable,
|
||||
transitionDuration: Duration(milliseconds: 230),
|
||||
initialBinding: HomeBinding(),
|
||||
initialRoute: AppPages.MAP,
|
||||
getPages: AppPages.routes,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
0
lib/pages/drawer/drawer_binding.dart
Normal file
0
lib/pages/drawer/drawer_binding.dart
Normal file
20
lib/pages/drawer/drawer_controller.dart
Normal file
20
lib/pages/drawer/drawer_controller.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class LayerDrawerController extends GetxController {
|
||||
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
30
lib/pages/drawer/drawer_page.dart
Normal file
30
lib/pages/drawer/drawer_page.dart
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DrawerPage extends StatelessWidget {
|
||||
const DrawerPage({ Key? key }) : super(key: key);
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
// Add a ListView to the drawer. This ensures the user can scroll
|
||||
// through the options in the drawer if there isn't enough vertical
|
||||
// space to fit everything.
|
||||
child: ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (context, i){
|
||||
return Obx(() =>
|
||||
CheckboxListTile(
|
||||
value: true,
|
||||
title: Text("Title"),
|
||||
onChanged: (val){
|
||||
}
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
12
lib/pages/home/home_binding.dart
Normal file
12
lib/pages/home/home_binding.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get_instance/src/bindings_interface.dart';
|
||||
import 'package:get/get_instance/src/extension_instance.dart';
|
||||
import 'package:rogapp/pages/home/home_controller.dart';
|
||||
|
||||
|
||||
class HomeBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.put<HomeController>(HomeController());
|
||||
}
|
||||
}
|
||||
31
lib/pages/home/home_controller.dart
Normal file
31
lib/pages/home/home_controller.dart
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/services/location_service.dart';
|
||||
|
||||
class HomeController extends GetxController {
|
||||
|
||||
List<GeoJsonFeatureCollection> locations = <GeoJsonFeatureCollection>[].obs;
|
||||
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
LocationService.loadLocations().then((value){
|
||||
locations.add(value!);
|
||||
});
|
||||
}
|
||||
|
||||
GeoJsonFeature? getFeatureForLatLong(double lat, double long){
|
||||
if(locations.length > 0){
|
||||
for(GeoJsonFeature i in locations[0].collection){
|
||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||
if(p.geoSerie!.geoPoints[0].latitude == lat && p.geoSerie!.geoPoints[0].longitude == long){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
103
lib/pages/home/home_page.dart
Normal file
103
lib/pages/home/home_page.dart
Normal file
@ -0,0 +1,103 @@
|
||||
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/drawer/drawer_page.dart';
|
||||
import 'package:rogapp/pages/home/home_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/location_line_service.dart';
|
||||
import 'package:rogapp/services/location_polygon_service.dart';
|
||||
import 'package:rogapp/services/location_service.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
|
||||
|
||||
class HomePage extends GetView<HomeController> {
|
||||
|
||||
final HomeController homeController = Get.find<HomeController>();
|
||||
|
||||
Image getImage(int index){
|
||||
if(homeController.locations[0].collection[index].properties!["photos"] == null || homeController.locations[0].collection[index].properties!["photos"] == ""){
|
||||
return Image(image: AssetImage('assets/images/empty_image.png'));
|
||||
}
|
||||
else{
|
||||
return Image(image: NetworkImage(homeController.locations[0].collection[index].properties!["photos"]));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
drawer: DrawerPage(),
|
||||
appBar: AppBar(
|
||||
title: Text("app_title".tr),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.map),
|
||||
onPressed: (){
|
||||
//print(homeController.locations.length);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
onPressed: (){
|
||||
Get.toNamed(AppPages.MAP);
|
||||
},
|
||||
tooltip: 'Increment',
|
||||
child: new Icon(Icons.document_scanner),
|
||||
elevation: 4.0,
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(child: IconButton(icon: Icon(Icons.camera_enhance), onPressed: (){},),),
|
||||
Expanded(child: IconButton(icon: Icon(Icons.arrow_back_ios), onPressed: (){}),),
|
||||
Expanded(child: new Text('')),
|
||||
Expanded(child: IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: (){}),),
|
||||
Expanded(child: IconButton(icon: Icon(Icons.travel_explore), onPressed: (){}),),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
body:Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 50.0,
|
||||
color: Colors.amber,
|
||||
),
|
||||
Expanded(
|
||||
child: Obx(() =>
|
||||
homeController.locations.length > 0 ?
|
||||
ListView.builder(
|
||||
itemCount: homeController.locations[0].collection.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (_, index){
|
||||
return Card(
|
||||
child: ListTile(
|
||||
onTap: (){
|
||||
GeoJsonFeature gf = homeController.locations[0].collection[index];
|
||||
|
||||
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) => BottomSheetWidget(pt: gf),
|
||||
);
|
||||
},
|
||||
leading: getImage(index),
|
||||
title: Text(homeController.locations[0].collection[index].properties!['location_name']),
|
||||
subtitle: Text(homeController.locations[0].collection[index].properties!['category']),
|
||||
),
|
||||
);
|
||||
},
|
||||
) : Container(width: 0, height: 0,),
|
||||
)
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
0
lib/pages/map/map_controller.dart
Normal file
0
lib/pages/map/map_controller.dart
Normal file
136
lib/pages/map/map_page.dart
Normal file
136
lib/pages/map/map_page.dart
Normal file
@ -0,0 +1,136 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/plugin_api.dart';
|
||||
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_state_manager/get_state_manager.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/pages/drawer/drawer_page.dart';
|
||||
import 'package:rogapp/pages/home/home_controller.dart';
|
||||
import 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/widgets/base_layer_widget.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
|
||||
|
||||
|
||||
class MapPage extends StatelessWidget {
|
||||
MapPage({ Key? key }) : super(key: key);
|
||||
|
||||
final HomeController homeController = Get.find<HomeController>();
|
||||
|
||||
final MapController mapController = MapController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final PopupController _popupController = PopupController();
|
||||
|
||||
|
||||
return Scaffold(
|
||||
drawer: DrawerPage(),
|
||||
appBar: AppBar(
|
||||
title: Text("app_title".tr),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.map),
|
||||
onPressed: () => {print("action")},
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(child: IconButton(icon: Icon(Icons.camera_enhance), onPressed: (){},),),
|
||||
Expanded(child: IconButton(icon: Icon(Icons.arrow_back_ios), onPressed: (){}),),
|
||||
Expanded(child: new Text('')),
|
||||
Expanded(child: IconButton(icon: Icon(Icons.arrow_forward_ios), onPressed: (){}),),
|
||||
Expanded(child: IconButton(icon: Icon(Icons.travel_explore), onPressed: (){}),),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
onPressed: (){
|
||||
Get.toNamed(AppPages.INITIAL);
|
||||
},
|
||||
tooltip: 'Increment',
|
||||
child: new Icon(Icons.document_scanner),
|
||||
elevation: 4.0,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
body: SafeArea(
|
||||
child: Obx(() =>
|
||||
Stack(
|
||||
children: [
|
||||
FlutterMap(
|
||||
mapController: mapController,
|
||||
options: MapOptions(
|
||||
center: LatLng(37.15319600454702, 139.58765950528198),
|
||||
zoom: 6,
|
||||
maxZoom: 20,
|
||||
plugins: [
|
||||
MarkerClusterPlugin(),
|
||||
],
|
||||
onTap: (_, __) =>
|
||||
_popupController
|
||||
.hideAllPopups(), // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
BaseLayer(),
|
||||
LocationMarkerLayerWidget(),
|
||||
homeController.locations.length > 0 ?
|
||||
MarkerClusterLayerWidget(
|
||||
options: MarkerClusterLayerOptions(
|
||||
spiderfyCircleRadius: 80,
|
||||
spiderfySpiralDistanceMultiplier: 2,
|
||||
circleSpiralSwitchover: 12,
|
||||
maxClusterRadius: 20,
|
||||
rotate: true,
|
||||
onMarkerTap: (marker) => showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (context) => BottomSheetWidget(pt: homeController.getFeatureForLatLong(marker.point.latitude, marker.point.longitude),),
|
||||
),
|
||||
size: Size(40, 40),
|
||||
anchor: AnchorPos.align(AnchorAlign.center),
|
||||
fitBoundsOptions: const FitBoundsOptions(
|
||||
padding: EdgeInsets.all(50),
|
||||
maxZoom: 15,
|
||||
),
|
||||
markers:homeController.locations[0].collection.map((i) {
|
||||
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
|
||||
return Marker(
|
||||
anchorPos: AnchorPos.align(AnchorAlign.center),
|
||||
height: 70.0,
|
||||
width: 70.0,
|
||||
point: LatLng(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude),
|
||||
builder: (ctx) => Icon(Icons.pin_drop),
|
||||
);
|
||||
}).toList(),
|
||||
builder: (context, markers) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
color: Colors.blue),
|
||||
child: Center(
|
||||
child: Text(
|
||||
markers.length.toString(),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
): Container(height:0,width: 0),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
24
lib/routes/app_pages.dart
Normal file
24
lib/routes/app_pages.dart
Normal file
@ -0,0 +1,24 @@
|
||||
import 'package:get/get_navigation/src/routes/get_route.dart';
|
||||
import 'package:rogapp/pages/home/home_binding.dart';
|
||||
import 'package:rogapp/pages/home/home_page.dart';
|
||||
import 'package:rogapp/pages/map/map_page.dart';
|
||||
|
||||
|
||||
part 'app_routes.dart';
|
||||
|
||||
class AppPages {
|
||||
static const INITIAL = Routes.HOME;
|
||||
static const MAP = Routes.MAP;
|
||||
|
||||
static final routes = [
|
||||
GetPage(
|
||||
name: Routes.HOME,
|
||||
page: () => HomePage(),
|
||||
binding: HomeBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.MAP,
|
||||
page: () => MapPage()
|
||||
)
|
||||
];
|
||||
}
|
||||
7
lib/routes/app_routes.dart
Normal file
7
lib/routes/app_routes.dart
Normal file
@ -0,0 +1,7 @@
|
||||
part of 'app_pages.dart';
|
||||
|
||||
abstract class Routes {
|
||||
// Main Menu Route
|
||||
static const HOME = '/';
|
||||
static const MAP = '/map';
|
||||
}
|
||||
32
lib/services/location_line_service.dart
Normal file
32
lib/services/location_line_service.dart
Normal file
@ -0,0 +1,32 @@
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class LocationLineService{
|
||||
|
||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||
final geo = GeoJson();
|
||||
GeoJsonFeature? fs;
|
||||
|
||||
String url = 'http://localhost:8100/api/location_line/';
|
||||
final response = await http.get(Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
geo.processedFeatures.listen((fst) {
|
||||
fs = fst;
|
||||
});
|
||||
|
||||
await geo.parse(response.body, verbose:true);
|
||||
|
||||
return fs;
|
||||
|
||||
} else {
|
||||
throw Exception('Failed to create album.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
32
lib/services/location_polygon_service.dart
Normal file
32
lib/services/location_polygon_service.dart
Normal file
@ -0,0 +1,32 @@
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class LocationPolygonervice{
|
||||
|
||||
static Future<GeoJsonFeature?> loadLocationLines() async {
|
||||
final geo = GeoJson();
|
||||
GeoJsonFeature? fs;
|
||||
|
||||
String url = 'http://localhost:8100/api/location_polygon/';
|
||||
final response = await http.get(Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
geo.processedFeatures.listen((fst) {
|
||||
fs = fst;
|
||||
});
|
||||
|
||||
await geo.parse(response.body, verbose:true);
|
||||
|
||||
return fs;
|
||||
|
||||
} else {
|
||||
throw Exception('Failed to create album.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
35
lib/services/location_service.dart
Normal file
35
lib/services/location_service.dart
Normal file
@ -0,0 +1,35 @@
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class LocationService{
|
||||
|
||||
static Future<GeoJsonFeatureCollection?> loadLocations() async {
|
||||
final geo = GeoJson();
|
||||
GeoJsonFeatureCollection? fs;
|
||||
print("#### feature collection ####");
|
||||
String url = 'http://container.intranet.sumasen.net:8100/api/location/';
|
||||
final response = await http.get(Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
// geo.processedFeatures.listen((fst) {
|
||||
// fs = fst;
|
||||
// });
|
||||
|
||||
|
||||
return featuresFromGeoJson(response.body);
|
||||
// await geo.parse(response.body, verbose:true);
|
||||
|
||||
// return fs;
|
||||
|
||||
// } else {
|
||||
// throw Exception('Failed to create album.');
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
14
lib/utils/string_values.dart
Normal file
14
lib/utils/string_values.dart
Normal file
@ -0,0 +1,14 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class StringValues extends Translations{
|
||||
@override
|
||||
// TODO: implement keys
|
||||
Map<String, Map<String, String>> get keys => {
|
||||
'en_US': {
|
||||
'app_title': '- Rogaining -'
|
||||
},
|
||||
'ja_JP': {
|
||||
'app_title': '旅行工程表'
|
||||
},
|
||||
};
|
||||
}
|
||||
9
lib/utils/util_controller.dart
Normal file
9
lib/utils/util_controller.dart
Normal file
@ -0,0 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class UtilController extends GetxController{
|
||||
void changeLanguage(var lang, var cnty){
|
||||
var locale = Locale(lang, cnty);
|
||||
Get.updateLocale(locale);
|
||||
}
|
||||
}
|
||||
17
lib/widgets/base_layer_widget.dart
Normal file
17
lib/widgets/base_layer_widget.dart
Normal file
@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
|
||||
class BaseLayer extends StatelessWidget {
|
||||
const BaseLayer({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TileLayerWidget(
|
||||
options: TileLayerOptions(
|
||||
backgroundColor: Colors.transparent,
|
||||
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
subdomains: ['a', 'b', 'c'],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
59
lib/widgets/bottom_sheet_widget.dart
Normal file
59
lib/widgets/bottom_sheet_widget.dart
Normal file
@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
|
||||
class BottomSheetWidget extends StatelessWidget {
|
||||
//const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
|
||||
|
||||
GeoJsonFeature? pt;
|
||||
|
||||
BottomSheetWidget({this.pt});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
||||
),
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 35.0,
|
||||
alignment: Alignment.center,
|
||||
color: Colors.black12,
|
||||
child: Text(pt!.properties!["location_name"], style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed:(){
|
||||
//homeController.incidents.remove(incident);
|
||||
Navigator.pop(context);
|
||||
//popupController.hideAllPopups();
|
||||
},
|
||||
icon: Icon(Icons.delete_outlined)
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user