Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa08c1d173 | ||
|
|
1e873ea7be | ||
|
|
e8b1e45c81 | ||
|
|
b69d87374c | ||
|
|
48912c8d2e |
@@ -73,7 +73,7 @@
|
|||||||
<!-- <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>-->
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="bistro"
|
android:label="小酒馆"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
BIN
android/app/src/main/res/drawable-v21/background.png
Normal file
|
After Width: | Height: | Size: 900 KiB |
@@ -1,12 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Modify this file to customize your launch splash screen -->
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:drawable="?android:colorBackground" />
|
<item>
|
||||||
|
<bitmap android:gravity="fill" android:src="@drawable/background"/>
|
||||||
<!-- You can insert your own image assets here -->
|
</item>
|
||||||
<!-- <item>
|
</layer-list>
|
||||||
<bitmap
|
|
||||||
android:gravity="center"
|
|
||||||
android:src="@mipmap/launch_image" />
|
|
||||||
</item> -->
|
|
||||||
</layer-list>
|
|
||||||
BIN
android/app/src/main/res/drawable/background.png
Normal file
|
After Width: | Height: | Size: 900 KiB |
@@ -1,12 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Modify this file to customize your launch splash screen -->
|
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:drawable="@android:color/white" />
|
<item>
|
||||||
|
<bitmap android:gravity="fill" android:src="@drawable/background"/>
|
||||||
<!-- You can insert your own image assets here -->
|
</item>
|
||||||
<!-- <item>
|
</layer-list>
|
||||||
<bitmap
|
|
||||||
android:gravity="center"
|
|
||||||
android:src="@mipmap/launch_image" />
|
|
||||||
</item> -->
|
|
||||||
</layer-list>
|
|
||||||
18
android/app/src/main/res/values-v31/styles.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<item name="android:windowSplashScreenBackground">@drawable/launch_background</item>
|
||||||
|
<item name="android:forceDarkAllowed">false</item>
|
||||||
|
<item name="android:windowFullscreen">true</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -5,6 +5,8 @@
|
|||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
Flutter draws its first frame -->
|
Flutter draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
<item name="android:forceDarkAllowed">false</item>
|
||||||
|
<item name="android:windowFullscreen">true</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
This theme determines the color of the Android Window while your
|
This theme determines the color of the Android Window while your
|
||||||
@@ -15,4 +17,4 @@
|
|||||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
23
ios/Runner/Assets.xcassets/BrandingImage.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "BrandingImage.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "BrandingImage@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "BrandingImage@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
21
ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "background.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png
vendored
Normal file
|
After Width: | Height: | Size: 900 KiB |
@@ -1,23 +1,23 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "LaunchImage.png",
|
"filename" : "LaunchImage.png",
|
||||||
|
"idiom" : "universal",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "LaunchImage@2x.png",
|
"filename" : "LaunchImage@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "universal",
|
|
||||||
"filename" : "LaunchImage@3x.png",
|
"filename" : "LaunchImage@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"info" : {
|
"info" : {
|
||||||
"version" : 1,
|
"author" : "xcode",
|
||||||
"author" : "xcode"
|
"version" : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
@@ -16,13 +16,19 @@
|
|||||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI"/>
|
||||||
</imageView>
|
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"></imageView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="3T2-ad-Qdv"/>
|
||||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
<constraint firstItem="tWc-Dq-wcI" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="RPx-PI-7Xg"/>
|
||||||
|
<constraint firstItem="tWc-Dq-wcI" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="SdS-ul-q2q"/>
|
||||||
|
<constraint firstAttribute="trailing" secondItem="tWc-Dq-wcI" secondAttribute="trailing" id="Swv-Gf-Rwn"/>
|
||||||
|
<constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="TQA-XW-tRk"/>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="duK-uY-Gun"/>
|
||||||
|
<constraint firstItem="tWc-Dq-wcI" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="kV7-tw-vXt"/>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="xPn-NY-SIU"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
</viewController>
|
</viewController>
|
||||||
@@ -33,5 +39,6 @@
|
|||||||
</scenes>
|
</scenes>
|
||||||
<resources>
|
<resources>
|
||||||
<image name="LaunchImage" width="168" height="185"/>
|
<image name="LaunchImage" width="168" height="185"/>
|
||||||
|
<image name="LaunchBackground" width="1" height="1"/>
|
||||||
</resources>
|
</resources>
|
||||||
</document>
|
</document>
|
||||||
@@ -1,47 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Bistro</string>
|
<string>Bistro</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>bistro</string>
|
<string>小酒馆</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIMainStoryboardFile</key>
|
<key>UIMainStoryboardFile</key>
|
||||||
<string>Main</string>
|
<string>Main</string>
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
<array>
|
<array>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
<array>
|
<array>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false/>
|
||||||
</dict>
|
<key>UIStatusBarHidden</key>
|
||||||
</plist>
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -17,7 +17,7 @@ class _AppState extends State<App> {
|
|||||||
// TODO: implement build
|
// TODO: implement build
|
||||||
return LayoutScaffold(
|
return LayoutScaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('应用'),
|
title: const Text('满席'),
|
||||||
),
|
),
|
||||||
body: null,
|
body: null,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
|||||||
|
|
||||||
class Life extends StatefulWidget {
|
class Life extends StatefulWidget {
|
||||||
const Life({Key? key}) : super(key: key);
|
const Life({Key? key}) : super(key: key);
|
||||||
final title = '听说';
|
final title = '途说';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<Life> createState() => _LifeState();
|
State<Life> createState() => _LifeState();
|
||||||
|
|||||||
170
lib/main.dart
@@ -1,15 +1,21 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
//import 'common/access_control_filter.dart';
|
||||||
|
import 'package:flutter_native_splash/flutter_native_splash.dart'
|
||||||
|
if (dart.library.html) 'package:flutter_native_splash/flutter_native_splash_web.dart';
|
||||||
|
|
||||||
// import 'package:flutter_localizations/flutter_localizations.dart';
|
// import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
import 'life.dart';
|
import 'life.dart';
|
||||||
import 'news.dart';
|
|
||||||
import 'mine.dart';
|
import 'mine.dart';
|
||||||
|
import 'news.dart';
|
||||||
import 'router/router.dart';
|
import 'router/router.dart';
|
||||||
|
|
||||||
//import 'common/access_control_filter.dart';
|
void main() {
|
||||||
|
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||||
void main() => runApp(const Bistro());
|
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||||
|
runApp(const Bistro());
|
||||||
|
}
|
||||||
|
|
||||||
class Bistro extends StatelessWidget {
|
class Bistro extends StatelessWidget {
|
||||||
const Bistro({Key? key}) : super(key: key);
|
const Bistro({Key? key}) : super(key: key);
|
||||||
@@ -64,57 +70,85 @@ class BistroFrame extends StatefulWidget {
|
|||||||
|
|
||||||
class _BistroFrameState extends State<BistroFrame> {
|
class _BistroFrameState extends State<BistroFrame> {
|
||||||
late Widget _body;
|
late Widget _body;
|
||||||
int _index = 1;
|
int _index = 3;
|
||||||
|
|
||||||
|
static const List<Map<String, dynamic>> _iconList = [
|
||||||
|
{
|
||||||
|
"title": "满席",
|
||||||
|
"icon": Icons.storefront_outlined,
|
||||||
|
"display": true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "道听",
|
||||||
|
"icon": Icons.forum_outlined,
|
||||||
|
"display": true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"display": false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "途说",
|
||||||
|
"icon": Icons.supervisor_account_outlined,
|
||||||
|
"display": true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "在下",
|
||||||
|
"icon": Icons.person_outline,
|
||||||
|
"display": true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
initState() {
|
||||||
|
//页面初始化时要干的事
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
initialization();
|
||||||
|
}
|
||||||
|
|
||||||
void initData() {
|
void initData() {
|
||||||
//页面初始化时要干的事
|
|
||||||
_body = IndexedStack(
|
_body = IndexedStack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const App(),
|
|
||||||
const Life(),
|
|
||||||
const App(),
|
const App(),
|
||||||
News(),
|
News(),
|
||||||
|
News(),
|
||||||
|
const Life(),
|
||||||
const Mine(),
|
const Mine(),
|
||||||
],
|
],
|
||||||
index: _index,
|
index: _index,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initialization() async {
|
||||||
|
// This is where you can initialize the resources needed by your app while
|
||||||
|
// the splash screen is displayed. Remove the following example because
|
||||||
|
// delaying the user experience is a bad design practice!
|
||||||
|
print('ready in 3...');
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
print('ready in 2...');
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
print('ready in 1...');
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
print('go!');
|
||||||
|
FlutterNativeSplash.remove();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
|
List<Widget> bottomNavigationBarData = [];
|
||||||
|
for (var i = 0; i < 5; i++) {
|
||||||
|
Widget itemWidget = bottomAppBarItem(index: i);
|
||||||
|
bottomNavigationBarData.add(itemWidget);
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: _body,
|
body: _body,
|
||||||
bottomNavigationBar: BottomAppBar(
|
bottomNavigationBar: BottomAppBar(
|
||||||
shape: const CircularNotchedRectangle(),
|
shape: const CircularNotchedRectangle(),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: bottomNavigationBarData,
|
||||||
bottomAppBarItem(
|
|
||||||
index: 0,
|
|
||||||
icon: Icons.apps,
|
|
||||||
title: '应用',
|
|
||||||
),
|
|
||||||
bottomAppBarItem(
|
|
||||||
index: 1,
|
|
||||||
icon: Icons.forum,
|
|
||||||
title: '听说',
|
|
||||||
),
|
|
||||||
bottomAppBarItem(
|
|
||||||
index: 2,
|
|
||||||
isShow: false,
|
|
||||||
),
|
|
||||||
bottomAppBarItem(
|
|
||||||
index: 3,
|
|
||||||
icon: Icons.business,
|
|
||||||
title: '资讯',
|
|
||||||
),
|
|
||||||
bottomAppBarItem(
|
|
||||||
index: 4,
|
|
||||||
icon: Icons.perm_identity,
|
|
||||||
title: '我的',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -132,48 +166,52 @@ class _BistroFrameState extends State<BistroFrame> {
|
|||||||
|
|
||||||
Widget bottomAppBarItem({
|
Widget bottomAppBarItem({
|
||||||
required int index, // 序列
|
required int index, // 序列
|
||||||
IconData? icon, // 图标
|
|
||||||
String? title, // 标签
|
|
||||||
bool isShow = true, // 是否需要显示
|
|
||||||
}) {
|
}) {
|
||||||
|
Map<String, dynamic> item = _iconList[index];
|
||||||
|
|
||||||
//设置默认未选中的状态
|
//设置默认未选中的状态
|
||||||
double size = 11;
|
double size = 14;
|
||||||
Color color = Colors.black87;
|
Color color = Colors.black87;
|
||||||
|
bool isShow = item["display"];
|
||||||
|
|
||||||
TextStyle style = TextStyle(
|
TextStyle style = TextStyle(
|
||||||
fontSize: size,
|
fontSize: size,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (_index == index) {
|
|
||||||
//选中的话
|
|
||||||
size = 17;
|
|
||||||
color = Theme.of(context).primaryColor;
|
|
||||||
title = '';
|
|
||||||
style = const TextStyle(
|
|
||||||
fontSize: 0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Widget child;
|
Widget child;
|
||||||
if (isShow) {
|
if (!isShow) {
|
||||||
|
child = Container();
|
||||||
|
} else {
|
||||||
|
IconData? icon = item["default"];
|
||||||
|
String title = item["title"];
|
||||||
|
|
||||||
|
if (_index == index) {
|
||||||
|
//选中的话
|
||||||
|
color = Theme.of(context).primaryColor;
|
||||||
|
style = const TextStyle(
|
||||||
|
fontSize: 0,
|
||||||
|
);
|
||||||
|
icon = item["icon"];
|
||||||
|
}
|
||||||
|
|
||||||
child = GestureDetector(
|
child = GestureDetector(
|
||||||
child: Column(
|
child: icon != null
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
? SizedBox(
|
||||||
children: <Widget>[
|
width: 25.0,
|
||||||
SizedBox(
|
height: 23.0,
|
||||||
width: 25.0,
|
child: Icon(
|
||||||
height: 23.0,
|
icon,
|
||||||
child: Icon(
|
color: color,
|
||||||
icon,
|
size: size * 1.7,
|
||||||
color: color,
|
),
|
||||||
size: size * 1.7,
|
)
|
||||||
|
: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: style,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Text(
|
|
||||||
title!,
|
|
||||||
style: style,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (_index != index) {
|
if (_index != index) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -182,8 +220,6 @@ class _BistroFrameState extends State<BistroFrame> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
child = Container();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//构造返回的Widget
|
//构造返回的Widget
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Mine extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return LayoutScaffold(
|
return LayoutScaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('我的'),
|
title: const Text('在下'),
|
||||||
),
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class News extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return LayoutScaffold(
|
return LayoutScaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('资讯'),
|
title: const Text('道听'),
|
||||||
),
|
),
|
||||||
body: null,
|
body: null,
|
||||||
);
|
);
|
||||||
|
|||||||
37
pubspec.lock
@@ -15,6 +15,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.2"
|
version: "1.7.2"
|
||||||
|
archive:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: archive
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.1"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -216,6 +223,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "0.5.0"
|
||||||
|
flutter_native_splash:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_native_splash
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
flutter_staggered_grid_view:
|
flutter_staggered_grid_view:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -261,6 +275,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.0"
|
||||||
|
image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: image
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.3"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -393,7 +414,7 @@ packages:
|
|||||||
name: permission_handler
|
name: permission_handler
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.1.0"
|
version: "9.2.0"
|
||||||
permission_handler_android:
|
permission_handler_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -415,6 +436,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.7.0"
|
version: "3.7.0"
|
||||||
|
permission_handler_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: permission_handler_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.0"
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -616,6 +644,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
|
universal_io:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: universal_io
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
91
pubspec.yaml
@@ -52,9 +52,13 @@ dependencies:
|
|||||||
webview_flutter: ^2.8.0
|
webview_flutter: ^2.8.0
|
||||||
flutter_staggered_grid_view: ^0.6.1
|
flutter_staggered_grid_view: ^0.6.1
|
||||||
shared_preferences: ^2.0.13
|
shared_preferences: ^2.0.13
|
||||||
|
|
||||||
|
# http
|
||||||
dio: ^4.0.4
|
dio: ^4.0.4
|
||||||
dio_http_cache: ^0.3.0
|
dio_http_cache: ^0.3.0
|
||||||
|
|
||||||
|
# 启动页
|
||||||
|
flutter_native_splash: ^2.0.5
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@@ -87,6 +91,7 @@ flutter:
|
|||||||
- res/assets/images/dololo.jpg
|
- res/assets/images/dololo.jpg
|
||||||
- res/assets/images/big-dog.jpg
|
- res/assets/images/big-dog.jpg
|
||||||
- res/assets/images/fire.jpg
|
- res/assets/images/fire.jpg
|
||||||
|
- res/assets/images/Splash.png
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
# https://flutter.dev/assets-and-images/#resolution-aware.
|
# https://flutter.dev/assets-and-images/#resolution-aware.
|
||||||
@@ -102,7 +107,7 @@ flutter:
|
|||||||
fonts:
|
fonts:
|
||||||
- family: SongTi
|
- family: SongTi
|
||||||
fonts:
|
fonts:
|
||||||
- asset: res/assets/fonts/SourceHanSerifCN-Regular.ttf
|
- asset: res/assets/fonts/SourceHanSerifCN-Regular.ttf
|
||||||
- family: SongTiBold
|
- family: SongTiBold
|
||||||
fonts:
|
fonts:
|
||||||
- asset: res/assets/fonts/SourceHanSerifCN-Bold.ttf
|
- asset: res/assets/fonts/SourceHanSerifCN-Bold.ttf
|
||||||
@@ -112,3 +117,87 @@ flutter:
|
|||||||
#
|
#
|
||||||
# For details regarding fonts from package dependencies,
|
# For details regarding fonts from package dependencies,
|
||||||
# see https://flutter.dev/custom-fonts/#from-packages
|
# see https://flutter.dev/custom-fonts/#from-packages
|
||||||
|
|
||||||
|
flutter_native_splash:
|
||||||
|
# This package generates native code to customize Flutter's default white native splash screen
|
||||||
|
# with background color and splash image.
|
||||||
|
# Customize the parameters below, and run the following command in the terminal:
|
||||||
|
# flutter pub run flutter_native_splash:create
|
||||||
|
# To restore Flutter's default white splash screen, run the following command in the terminal:
|
||||||
|
# flutter pub run flutter_native_splash:remove
|
||||||
|
|
||||||
|
# color or background_image is the only required parameter. Use color to set the background
|
||||||
|
# of your splash screen to a solid color. Use background_image to set the background of your
|
||||||
|
# splash screen to a png image. This is useful for gradients. The image will be stretch to the
|
||||||
|
# size of the app. Only one parameter can be used, color and background_image cannot both be set.
|
||||||
|
# color: "#e1f5fe"
|
||||||
|
background_image: "res/assets/images/Splash.png"
|
||||||
|
|
||||||
|
# Optional parameters are listed below. To enable a parameter, uncomment the line by removing
|
||||||
|
# the leading # character.
|
||||||
|
|
||||||
|
# The image parameter allows you to specify an image used in the splash screen. It must be a
|
||||||
|
# png file and should be sized for 4x pixel density.
|
||||||
|
# image: assets/logo_lockup_flutter_vertical.png
|
||||||
|
|
||||||
|
# This property allows you to specify an image used as branding in the splash screen. It must be
|
||||||
|
# a png file. Currently, it is only supported for Android and iOS.
|
||||||
|
#branding: assets/dart.png
|
||||||
|
|
||||||
|
# Specify your branding image for dark mode.
|
||||||
|
#branding_dark: assets/dart_dark.png
|
||||||
|
|
||||||
|
# To position the branding image at the bottom of the screen you can use bottom, bottomRight,
|
||||||
|
# and bottomLeft. The default values is bottom if not specified or specified something else.
|
||||||
|
#
|
||||||
|
# Make sure this content mode value should not be similar to android_gravity value and
|
||||||
|
# ios_content_mode value.
|
||||||
|
#branding_mode: bottom
|
||||||
|
|
||||||
|
# The color_dark, background_image_dark, and image_dark are parameters that set the background
|
||||||
|
# and image when the device is in dark mode. If they are not specified, the app will use the
|
||||||
|
# parameters from above. If the image_dark parameter is specified, color_dark or
|
||||||
|
# background_image_dark must be specified. color_dark and background_image_dark cannot both be
|
||||||
|
# set.
|
||||||
|
# color_dark: "#042a49"
|
||||||
|
# background_image_dark: "assets/dark-background.png"
|
||||||
|
# image_dark: assets/logo_lockup_flutter_vertical_wht.png
|
||||||
|
|
||||||
|
# The android, ios and web parameters can be used to disable generating a splash screen on a given
|
||||||
|
# platform.
|
||||||
|
#android: false
|
||||||
|
#ios: false
|
||||||
|
#web: false
|
||||||
|
|
||||||
|
# The position of the splash image can be set with android_gravity, ios_content_mode, and
|
||||||
|
# web_image_mode parameters. All default to center.
|
||||||
|
#
|
||||||
|
# android_gravity can be one of the following Android Gravity (see
|
||||||
|
# https://developer.android.com/reference/android/view/Gravity): bottom, center,
|
||||||
|
# center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal,
|
||||||
|
# fill_vertical, left, right, start, or top.
|
||||||
|
#android_gravity: center
|
||||||
|
#
|
||||||
|
# ios_content_mode can be one of the following iOS UIView.ContentMode (see
|
||||||
|
# https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill,
|
||||||
|
# scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight,
|
||||||
|
# bottomLeft, or bottomRight.
|
||||||
|
#ios_content_mode: center
|
||||||
|
#
|
||||||
|
# web_image_mode can be one of the following modes: center, contain, stretch, and cover.
|
||||||
|
#web_image_mode: center
|
||||||
|
|
||||||
|
# To hide the notification bar, use the fullscreen parameter. Has no affect in web since web
|
||||||
|
# has no notification bar. Defaults to false.
|
||||||
|
# NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads.
|
||||||
|
# To show the notification bar, add the following code to your Flutter app:
|
||||||
|
# WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
# SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
|
||||||
|
fullscreen: true
|
||||||
|
|
||||||
|
# If you have changed the name(s) of your info.plist file(s), you can specify the filename(s)
|
||||||
|
# with the info_plist_files parameter. Remove only the # characters in the three lines below,
|
||||||
|
# do not remove any spaces:
|
||||||
|
#info_plist_files:
|
||||||
|
# - 'ios/Runner/Info-Debug.plist'
|
||||||
|
# - 'ios/Runner/Info-Release.plist'
|
||||||
|
|||||||
BIN
res/assets/images/Splash.png
Normal file
|
After Width: | Height: | Size: 900 KiB |
@@ -31,6 +31,9 @@
|
|||||||
|
|
||||||
<title>bistro</title>
|
<title>bistro</title>
|
||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
|
<script src="splash/splash.js"></script>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="splash/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- This script installs service_worker.js to provide PWA functionality to
|
<!-- This script installs service_worker.js to provide PWA functionality to
|
||||||
@@ -101,4 +104,4 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
BIN
web/splash/img/light-background.png
Normal file
|
After Width: | Height: | Size: 900 KiB |
7
web/splash/splash.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
function removeSplashFromWeb() {
|
||||||
|
const elem = document.getElementById("splash");
|
||||||
|
if (elem) {
|
||||||
|
elem.remove();
|
||||||
|
}
|
||||||
|
document.body.style.background = "transparent";
|
||||||
|
}
|
||||||
43
web/splash/style.css
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
body {
|
||||||
|
margin:0;
|
||||||
|
height:100%;
|
||||||
|
background: #000000;
|
||||||
|
background-image: url("img/light-background.png");
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
margin: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
-ms-transform: translate(-50%, -50%);
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contain {
|
||||||
|
display:block;
|
||||||
|
width:100%; height:100%;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stretch {
|
||||||
|
display:block;
|
||||||
|
width:100%; height:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover {
|
||||||
|
display:block;
|
||||||
|
width:100%; height:100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body {
|
||||||
|
margin:0;
|
||||||
|
height:100%;
|
||||||
|
background: #000000;
|
||||||
|
background-image: url("img/dark-background.png");
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||