Commit bc1bc4a3 authored by Dio Maulana's avatar Dio Maulana

add geo location permission

parent a6ea0422
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.excelso_attendance">
package="com.example.excelso_attendance"> <uses-permission android:name="android.permission.INTERNET"/>
<application <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
android:label="excelso_attendance" <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
android:name="${applicationName}" <application android:label="excelso_attendance" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. --> to determine the Window background behind the Flutter UI. -->
<meta-data <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
...@@ -27,8 +16,6 @@ ...@@ -27,8 +16,6 @@
</activity> </activity>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data <meta-data android:name="flutterEmbedding" android:value="2" />
android:name="flutterEmbedding"
android:value="2" />
</application> </application>
</manifest> </manifest>
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:excelso_attendance/helper/arguments/route_args.dart'; import 'package:excelso_attendance/helper/arguments/route_args.dart';
import 'package:excelso_attendance/helper/component/button.dart'; import 'package:excelso_attendance/helper/component/button.dart';
import 'package:excelso_attendance/helper/component/text_field.dart'; import 'package:excelso_attendance/helper/component/text_field.dart';
...@@ -11,29 +12,35 @@ import 'package:excelso_attendance/resource/style.dart'; ...@@ -11,29 +12,35 @@ import 'package:excelso_attendance/resource/style.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HomeView extends StatelessWidget { class HomeView extends StatelessWidget {
HomeView({super.key}); const HomeView({super.key});
final TextEditingController nikController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: ColorManager.backgroundColor, backgroundColor: ColorManager.backgroundColor,
body: ScreenResponsive( body: ScreenResponsive(
widget: BodyWidget(nikController: nikController), widget: const BodyWidget(),
widthScreen: MediaQuery.of(context).size.width, widthScreen: MediaQuery.of(context).size.width,
), ),
); );
} }
} }
class BodyWidget extends StatelessWidget { class BodyWidget extends StatefulWidget {
const BodyWidget({ const BodyWidget({
super.key, super.key,
required this.nikController,
}); });
final TextEditingController nikController; @override
State<BodyWidget> createState() => _BodyWidgetState();
}
class _BodyWidgetState extends State<BodyWidget> {
final List<String> suggestion = const ["TEST", "TEST2", "ABC"];
final GlobalKey<AutoCompleteTextFieldState<String>> autoCompleteKey =
GlobalKey();
final TextEditingController nikController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -228,6 +235,57 @@ class BodyWidget extends StatelessWidget { ...@@ -228,6 +235,57 @@ class BodyWidget extends StatelessWidget {
borderSideActive: true, borderSideActive: true,
hintText: "NIK", hintText: "NIK",
), ),
// child: AutoCompleteTextField(
// controller: nikController,
// itemSubmitted: (item) {
// nikController.text = item;
// },
// clearOnSubmit: false,
// key: autoCompleteKey,
// suggestions: suggestion,
// itemBuilder: (c, item) {
// return Container(
// padding: EdgeInsets.all(AppPadding.p20),
// child: Row(
// children: [
// Text(
// item,
// style: getRegularStyle(
// color: Colors.grey,
// ),
// )
// ],
// ),
// );
// },
// itemSorter: (a, b) {
// return a.compareTo(b);
// },
// itemFilter: (item, query) {
// return item.toString().startsWith(query.toLowerCase());
// },
// decoration: InputDecoration(
// hintText: "NIK",
// hintStyle: getRegularStyle(
// color: Colors.grey,
// ),
// enabledBorder: OutlineInputBorder(
// borderSide:
// BorderSide(width: 0.4, color: ColorManager.grey),
// borderRadius: BorderRadius.circular(5),
// ),
// focusedBorder: OutlineInputBorder(
// borderSide:
// BorderSide(width: 0.4, color: ColorManager.grey),
// borderRadius: BorderRadius.circular(5),
// ),
// disabledBorder: OutlineInputBorder(
// borderSide:
// BorderSide(width: 0.4, color: ColorManager.grey),
// borderRadius: BorderRadius.circular(5),
// ),
// ),
// ),
), ),
), ),
Container( Container(
......
...@@ -25,6 +25,14 @@ packages: ...@@ -25,6 +25,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.11.0" version: "2.11.0"
autocomplete_textfield:
dependency: "direct main"
description:
name: autocomplete_textfield
sha256: "8170e66d381c21623f1cfbb957ab9c6b5a45d9c50a6daac7fc57dbc3ba94abb4"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
......
...@@ -29,6 +29,7 @@ environment: ...@@ -29,6 +29,7 @@ environment:
# the latest version available on pub.dev. To see which dependencies have newer # the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`. # versions available, run `flutter pub outdated`.
dependencies: dependencies:
autocomplete_textfield: ^2.0.1
camera: ^0.10.5+2 camera: ^0.10.5+2
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
flutter: flutter:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment