Skip to content

Commit ebce9bd

Browse files
author
Muhammad Ali
committed
....
1 parent b84fc74 commit ebce9bd

File tree

12 files changed

+418
-301
lines changed

12 files changed

+418
-301
lines changed

android/app/build.gradle

+7-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (flutterVersionName == null) {
2727
}
2828

2929
android {
30-
namespace = "com.ncba.news.ncba_news"
30+
namespace = "com.ncba.news"
3131
compileSdk = flutter.compileSdkVersion
3232
ndkVersion = flutter.ndkVersion
3333

@@ -38,15 +38,19 @@ android {
3838

3939
defaultConfig {
4040
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId = "com.ncba.news.ncba_news"
41+
applicationId = "com.ncba.news"
4242
// You can update the following values to match your application needs.
4343
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
44-
minSdk = flutter.minSdkVersion
44+
minSdk = 23
4545
targetSdk = flutter.targetSdkVersion
4646
versionCode = flutterVersionCode.toInteger()
4747
versionName = flutterVersionName
4848
}
4949

50+
lintOptions {
51+
baseline file("lint-baseline.xml")
52+
}
53+
5054
buildTypes {
5155
release {
5256
// TODO: Add your own signing config for the release build.

android/app/lint-baseline.xml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<issues format="6" by="lint 7.3.0" type="baseline" client="gradle" dependencies="false" name="AGP (7.3.0)" variant="all" version="7.3.0">
3+
4+
<issue
5+
id="MissingClass"
6+
message="Class referenced in the manifest, `com.ncba.news.MainActivity`, was not found in the project or the libraries"
7+
errorLine1=" android:name=&quot;.MainActivity&quot;"
8+
errorLine2=" ~~~~~~~~~~~~~">
9+
<location
10+
file="src/main/AndroidManifest.xml"
11+
line="7"
12+
column="27"/>
13+
</issue>
14+
15+
<issue
16+
id="ObsoleteSdkInt"
17+
message="This folder configuration (`v21`) is unnecessary; `minSdkVersion` is 23. Merge all the resources in this folder into `drawable`.">
18+
<location
19+
file="src/main/res/drawable-v21"/>
20+
</issue>
21+
22+
</issues>

android/app/src/main/kotlin/com/ncba/news/ncba_news/MainActivity.kt renamed to android/app/src/main/kotlin/com/ncba/news/MainActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.ncba.news.ncba_news
1+
package com.ncba.news
22

33
import io.flutter.embedding.android.FlutterActivity
44

lib/app.dart

+66-62
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import 'package:flutter/material.dart';
22
import 'package:firebase_auth/firebase_auth.dart';
33
import 'package:ncba_news/app_sections/feed.dart';
4-
54
import 'app_screens/add_news.dart';
65
import 'app_screens/profile.dart';
76
import 'app_sections/admin.dart';
87

98
class MyHomePage extends StatefulWidget {
10-
const MyHomePage({Key? key}) : super(key: key);
9+
const MyHomePage({super.key});
1110

1211
@override
1312
State<MyHomePage> createState() => _MyHomePageState();
@@ -72,72 +71,78 @@ class _MyHomePageState extends State<MyHomePage> {
7271
return Scaffold(
7372
appBar: PreferredSize(
7473
preferredSize: const Size.fromHeight(100.0),
75-
child: Padding(
76-
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
77-
child: Row(
78-
children: [
79-
Expanded(
80-
child: TextField(
81-
onTap: () {
82-
setState(() {
83-
_searchBarExpanded = true;
84-
});
85-
},
86-
onTapOutside: (event) {
87-
setState(() {
88-
_searchBarExpanded = false;
89-
});
90-
},
91-
onSubmitted: (value) {
92-
setState(() {
93-
_searchBarExpanded = false;
94-
});
95-
},
96-
decoration: InputDecoration(
97-
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
98-
hintText: 'Search',
99-
suffixIcon: IconButton(
100-
onPressed: () {},
101-
icon: const Icon(Icons.search),
102-
),
103-
suffixIconConstraints: const BoxConstraints.tightFor(width: 50.0),
104-
filled: true,
105-
border: OutlineInputBorder(
106-
borderRadius: BorderRadius.circular(30),
107-
borderSide: BorderSide.none,
108-
),
109-
),
110-
),
111-
),
112-
_searchBarExpanded
113-
? Container()
114-
: Row(
74+
child: SafeArea(
75+
child: Container(
76+
color: Theme.of(context).appBarTheme.backgroundColor, // Set background color to avoid black overlay
77+
child: Padding(
78+
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
79+
child: Row(
11580
children: [
116-
const SizedBox(width: 5.0),
117-
Container(
118-
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 4.0),
119-
decoration: BoxDecoration(
120-
color: Colors.grey[200],
121-
borderRadius: BorderRadius.circular(30),
122-
),
123-
child: Row(
124-
children: [
125-
IconButton(
126-
onPressed: () {
127-
Navigator.push(context, MaterialPageRoute(builder: (context) => const Profile()));
128-
},
129-
icon: const Icon(Icons.account_circle_outlined),
81+
Expanded(
82+
child: TextField(
83+
onTap: () {
84+
setState(() {
85+
_searchBarExpanded = true;
86+
});
87+
},
88+
onTapOutside: (event) {
89+
setState(() {
90+
_searchBarExpanded = false;
91+
});
92+
},
93+
onSubmitted: (value) {
94+
setState(() {
95+
_searchBarExpanded = false;
96+
});
97+
},
98+
decoration: InputDecoration(
99+
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
100+
hintText: 'Search',
101+
suffixIcon: IconButton(
102+
onPressed: () {},
103+
icon: const Icon(Icons.search),
130104
),
131-
IconButton(
132-
onPressed: _signOut,
133-
icon: const Icon(Icons.logout),
105+
suffixIconConstraints: const BoxConstraints.tightFor(width: 50.0),
106+
filled: true,
107+
fillColor: Colors.grey[200], // Ensure the fill color is set
108+
border: OutlineInputBorder(
109+
borderRadius: BorderRadius.circular(30),
110+
borderSide: BorderSide.none,
134111
),
135-
],
112+
),
136113
),
137114
),
115+
_searchBarExpanded
116+
? Container()
117+
: Row(
118+
children: [
119+
const SizedBox(width: 5.0),
120+
Container(
121+
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 0.0),
122+
decoration: BoxDecoration(
123+
color: Colors.grey[200],
124+
borderRadius: BorderRadius.circular(30),
125+
),
126+
child: Row(
127+
children: [
128+
IconButton(
129+
onPressed: () {
130+
Navigator.push(context, MaterialPageRoute(builder: (context) => const Profile()));
131+
},
132+
icon: const Icon(Icons.account_circle_outlined),
133+
),
134+
IconButton(
135+
onPressed: _signOut,
136+
icon: const Icon(Icons.logout),
137+
),
138+
],
139+
),
140+
),
141+
],
142+
),
138143
],
139144
),
140-
],
145+
),
141146
),
142147
),
143148
),
@@ -164,7 +169,6 @@ class _MyHomePageState extends State<MyHomePage> {
164169
currentPageIndex = index;
165170
});
166171
},
167-
// selectedIconTheme: const IconThemeData(color: Colors.black),
168172
unselectedIconTheme: const IconThemeData(color: Colors.grey),
169173
selectedItemColor: Colors.black,
170174
items: [

0 commit comments

Comments
 (0)