Skip to content

Commit

Permalink
fixed #4 and #7
Browse files Browse the repository at this point in the history
  • Loading branch information
git-elliot committed Jan 18, 2022
1 parent 769d7b2 commit d0ba699
Show file tree
Hide file tree
Showing 14 changed files with 366 additions and 340 deletions.
12 changes: 6 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 30

lintOptions {
checkReleaseBuilds false
}
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand All @@ -44,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.fsociety.vernet"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down Expand Up @@ -78,6 +75,9 @@ android {
versionNameSuffix "-store"
}
}
lint {
checkReleaseBuilds false
}
}

flutter {
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:7.1.0-rc01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
#distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
4 changes: 2 additions & 2 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdk.dir=/Users/paras/Library/Android/sdk
flutter.sdk=/Users/paras/Development/flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=9
flutter.versionName=1.0.1
flutter.versionCode=10
1 change: 1 addition & 0 deletions lib/generated_plugin_registrant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Generated file. Do not edit.
//

// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars

import 'package:network_info_plus_web/network_info_plus_web.dart';
Expand Down
51 changes: 50 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import 'package:vernet/pages/location_consent_page.dart';
import 'helper/app_settings.dart';
import 'helper/consent_loader.dart';
import 'models/dark_theme_provider.dart';
import 'package:vernet/api/update_checker.dart';
import 'package:vernet/pages/settings_page.dart';

import 'pages/home_page.dart';

late AppSettings appSettings;
Expand Down Expand Up @@ -50,10 +53,56 @@ class _MyAppState extends State<MyApp> {
theme: themeChangeProvider.darkTheme
? ThemeData.dark()
: ThemeData.light(),
home: widget.allowed ? HomePage() : LocationConsentPage(),
home: widget.allowed ? TabBarPage() : LocationConsentPage(),
);
},
),
);
}
}

class TabBarPage extends StatefulWidget {
TabBarPage({Key? key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<TabBarPage> {
int _currentIndex = 0;
void onTabTapped(int index) {
setState(() {
_currentIndex = index;
});
}

@override
void initState() {
super.initState();
checkForUpdates(context);
}

@override
Widget build(BuildContext context) {
final List<Widget> _children = [HomePage(), SettingsPage()];
return Scaffold(
body: Container(
padding: MediaQuery.of(context).padding,
child: _children[_currentIndex],
),
bottomNavigationBar: BottomNavigationBar(
onTap: onTabTapped, // new
currentIndex: _currentIndex, // new
items: [
new BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
new BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Settings',
),
],
),
);
}
}
Loading

0 comments on commit d0ba699

Please sign in to comment.