Skip to content

Commit

Permalink
upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
kidozh committed Aug 17, 2024
1 parent deefb5d commit 69cf448
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/app/MainApp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import 'package:upgrader/upgrader.dart';
import '../main.dart';
import '../provider/SelectedTidNotifierProvider.dart';
import '../screen/TwoPaneEmptyScreen.dart';
import '../utility/CustomizeColor.dart';
import '../utility/TwoPaneScaffold.dart';
import '../utility/TwoPaneUtils.dart';
import '../widget/DiscuzNotificationAppbarIconWidget.dart';
Expand Down Expand Up @@ -130,6 +131,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
_loadPreference(context);
//_listenToChanges(context);
CustomizeColor.updateAndroidNavigationbar(context);
return Consumer<ThemeNotifierProvider>(
builder: (context, themeColorEntity, _) {
ThemeMode? themeMode = null;
Expand Down Expand Up @@ -373,8 +375,11 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
_checkAcceptVersionFlag(context);
setupInteractedMessage();
reportDiscuzListToAnalytics();

}



Future<void> _checkAcceptVersionFlag(BuildContext context) async {
String flag = await UserPreferencesUtils.getAcceptVersionCodeFlag();
PackageInfo packageInfo = await PackageInfo.fromPlatform();
Expand Down Expand Up @@ -556,6 +561,8 @@ class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
if (user == null && _bottomNavigationbarIndex >= 2) {
_bottomNavigationbarIndex = 0;
}
CustomizeColor.updateAndroidNavigationbarColorWithDashboard(context);


return PlatformScaffold(
//iosContentPadding: true,
Expand Down
2 changes: 2 additions & 0 deletions lib/page/DisplayForumSliverPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import 'package:share_plus/share_plus.dart';
import '../provider/DiscuzNotificationProvider.dart';
import '../provider/UserPreferenceNotifierProvider.dart';
import '../screen/TwoPaneEmptyScreen.dart';
import '../utility/CustomizeColor.dart';
import '../utility/EasyRefreshUtils.dart';
import '../utility/PostTextFieldUtils.dart';
import 'SettingPage.dart';
Expand Down Expand Up @@ -74,6 +75,7 @@ class DisplayForumAltSliverPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
CustomizeColor.updateAndroidNavigationbar(context);
// try ios
return DisplayForumSliverStatefulWidget(discuz, user, fid, onSelectTid: this.onSelectTid, forumTitle:this.forumTitle);
}
Expand Down
1 change: 1 addition & 0 deletions lib/page/DrawerPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ class DrawerState extends State<DrawerStatefulWidget> {

@override
Widget build(BuildContext context) {
CustomizeColor.updateAndroidNavigationbar(context);
return PlatformScaffold(
appBar: PlatformAppBar(
automaticallyImplyLeading: true,
Expand Down
1 change: 1 addition & 0 deletions lib/page/SettingPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:settings_ui/settings_ui.dart';
import 'package:url_launcher/url_launcher.dart';

import '../utility/AppPlatformIcons.dart';
import '../utility/CustomizeColor.dart';
import '../utility/PostTextFieldUtils.dart';
import 'ChooseThemeColorPage.dart';

Expand Down
3 changes: 3 additions & 0 deletions lib/page/ViewThreadSliverPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import 'package:discuz_flutter/provider/ReplyPostNotifierProvider.dart';
import 'package:discuz_flutter/screen/EmptyListScreen.dart';
import 'package:discuz_flutter/screen/ExtraFuncInThreadScreen.dart';
import 'package:discuz_flutter/screen/SmileyListScreen.dart';
import 'package:discuz_flutter/utility/CustomizeColor.dart';
import 'package:discuz_flutter/utility/NetworkUtils.dart';
import 'package:discuz_flutter/utility/PostTextFieldUtils.dart';
import 'package:discuz_flutter/utility/RewriteRuleUtils.dart';
Expand Down Expand Up @@ -157,6 +158,7 @@ class _ViewThreadSliverState extends State<ViewThreadStatefulSliverWidget> {
// set reply post as null
Provider.of<ReplyPostNotifierProvider>(context, listen: false)
.setPost(null);

}

void _loadDao() async {
Expand Down Expand Up @@ -729,6 +731,7 @@ class _ViewThreadSliverState extends State<ViewThreadStatefulSliverWidget> {

@override
Widget build(BuildContext context) {
CustomizeColor.updateAndroidNavigationbar(context);
return PlatformScaffold(
appBar: PlatformAppBar(
automaticallyImplyLeading: this.onClosed == null ? true : false,
Expand Down
2 changes: 1 addition & 1 deletion lib/screen/DashboardScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DashboardScreen extends StatelessWidget{

@override
Widget build(BuildContext context) {
CustomizeColor.updateAndroidNavigationbar(context);

return Consumer<DiscuzAndUserNotifier>(
builder: (BuildContext context, DiscuzAndUserNotifier value, Widget? child) {
if(value.discuz == null){
Expand Down
13 changes: 12 additions & 1 deletion lib/utility/CustomizeColor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ class CustomizeColor{
static void updateAndroidNavigationbar(BuildContext context){
if(Platform.isAndroid){
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).colorScheme.surfaceContainer,
systemNavigationBarColor: Theme.of(context).colorScheme.surface,
systemNavigationBarIconBrightness: Theme.of(context).brightness,
systemNavigationBarDividerColor: Colors.transparent
));
}
}


static void updateAndroidNavigationbarColorWithDashboard(BuildContext context){
if(Platform.isAndroid){
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Theme.of(context).colorScheme.primary,
systemNavigationBarIconBrightness: Theme.of(context).brightness,
systemNavigationBarDividerColor: Colors.transparent
));
Expand Down
2 changes: 1 addition & 1 deletion lib/utility/UserPreferencesUtils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ class UserPreferencesUtils{
static final String interfaceDynamicSchemeVariantPreferenceKey = "interfaceDynamicSchemeVariantPreferenceKey";
static Future<void> putInterfaceDynamicSchemeVariantPreference(DynamicSchemeVariant dynamicVariant) async{
SharedPreferences prefs = await SharedPreferences.getInstance();
String dynamicVariantString = "fidelity";
String dynamicVariantString = "totalSpot";
switch (dynamicVariant){

case DynamicSchemeVariant.tonalSpot:{
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.4.5+76
version: 1.4.6+77

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down

0 comments on commit 69cf448

Please sign in to comment.