Skip to content

Commit

Permalink
fix dio baseurl change
Browse files Browse the repository at this point in the history
  • Loading branch information
Perol committed Apr 12, 2019
1 parent 76da5c9 commit fbd02db
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "me.perol.play.konayan"
applicationId "me.perol.konayan"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
Expand Down
4 changes: 0 additions & 4 deletions lib/api/modules.dart

This file was deleted.

3 changes: 1 addition & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:konayan/notifier/db_notifier.dart';
import 'package:konayan/notifier/pref_notifier.dart';
import 'package:konayan/notifier/setting_notifier.dart';
import 'package:konayan/view/page/hello_page.dart';
import 'package:konayan/view/page/home_page.dart';
import 'package:provider/provider.dart';

Expand All @@ -24,7 +23,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch:value.option==0? Colors.deepOrange:Colors.deepPurple,
),
home:value.domain=='konachan.net'||value.domain== 'yande.re'? MyHomePage(title: 'Flutter Home Page'):HelloPage(),
home: MyHomePage(title: 'Flutter Home Page'),
), ),
notifier: PrefNotifier()..fetchData(),
),
Expand Down
1 change: 0 additions & 1 deletion lib/model/post.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import 'package:json_annotation/json_annotation.dart';
class Post{
int id;
String tags;
Expand Down
1 change: 0 additions & 1 deletion lib/notifier/db_notifier.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:konayan/model/tag.dart';
import 'package:konayan/service/sql_service.dart';
import 'package:objectdb/objectdb.dart';

Expand Down
3 changes: 1 addition & 2 deletions lib/notifier/detail_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';


class DetailNotifier extends ChangeNotifier {
final a = ['yande', 'konachan'];
Expand Down
1 change: 0 additions & 1 deletion lib/notifier/post_notifier.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:konayan/model/post.dart';
import 'package:konayan/service/konachan_service.dart';
import 'package:shared_preferences/shared_preferences.dart';

class PostNotifier extends ChangeNotifier {
List<Post> _posts;
Expand Down
3 changes: 1 addition & 2 deletions lib/notifier/setting_notifier.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:konayan/api/modules.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'package:konayan/service/konachan_service.dart';
class SettingNotifier extends ChangeNotifier {
String _storagePath;
String _domain = '';
Expand Down
1 change: 0 additions & 1 deletion lib/service/konachan_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:konayan/api/konachan_api.dart';
Expand Down
10 changes: 5 additions & 5 deletions lib/view/page/Konachan_post_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:konayan/notifier/post_notifier.dart';
import 'package:konayan/notifier/setting_notifier.dart';
import 'package:konayan/view/page/konachan_detail_page.dart';
import 'package:konayan/view/widget/super_drawer.dart';
import 'package:provider/provider.dart';
Expand All @@ -13,15 +14,16 @@ class KonachanPostPage extends StatefulWidget {
final String tag;
final List<String> allowList;
static const List<String> a = ['s', 'q', 'e'];
KonachanPostPage({Key key, this.tag, this.allowList = a}) : super(key: key);
int option=0;
KonachanPostPage({Key key, this.tag, this.allowList = a,this.option}) : super(key: key);
@override
State<StatefulWidget> createState() {
return _KonachanPostState();
}
}

class _KonachanPostState extends State<KonachanPostPage>
with AutomaticKeepAliveClientMixin {
{
ScrollController _scrollController;
PostNotifier _viewModel;
int page;
Expand Down Expand Up @@ -172,7 +174,5 @@ class _KonachanPostState extends State<KonachanPostPage>
);
}

@override
// TODO: implement wantKeepAlive
bool get wantKeepAlive => true;

}
1 change: 0 additions & 1 deletion lib/view/page/konachan_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:konayan/notifier/detail_notifier.dart';
import 'package:konayan/notifier/setting_notifier.dart';
import 'package:konayan/view/page/zoom_page.dart';
import 'package:konayan/view/widget/tag_view.dart';
import 'package:konayan/view/widget/toast.dart';
import 'package:provider/provider.dart';

class KonachanDetailPage extends StatefulWidget {
Expand Down
14 changes: 11 additions & 3 deletions lib/view/page/recommend_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ import 'package:flutter/material.dart';
import 'package:konayan/notifier/pref_notifier.dart';
import 'package:konayan/view/page/Konachan_post_page.dart';
import 'package:provider/provider.dart';
class RecommendPage extends StatelessWidget {
class RecommendPage extends StatefulWidget {
@override
_RecommendPageState createState() => _RecommendPageState();
}

class _RecommendPageState extends State<RecommendPage> with AutomaticKeepAliveClientMixin{
@override
Widget build(BuildContext context) {
var pref=Provider.of<PrefNotifier>(context);
return Builder(builder: (context){
if(pref.restrict.isNotEmpty){
return KonachanPostPage(tag: null,allowList: pref.restrict,);
return KonachanPostPage(tag: null,allowList: pref.restrict);
}
return Center(child: Text("?"),);
});
}
}

@override
bool get wantKeepAlive => true;
}
1 change: 0 additions & 1 deletion lib/view/page/setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class SettingPage extends StatefulWidget {
class _SettingPageState extends State<SettingPage> {
@override
void initState() {
// TODO: implement initState

super.initState();
}
Expand Down
1 change: 0 additions & 1 deletion lib/view/widget/search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class SearchView extends StatefulWidget {

@override
State<StatefulWidget> createState() {
// TODO: implement createState
return _SearchViewState();
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: A new Flutter project.
# 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.0.0+1
version: 1.0.2+3

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

0 comments on commit fbd02db

Please sign in to comment.