adding packages

This commit is contained in:
2026-01-15 14:38:46 -08:00
parent ef86e3ab6a
commit 6869cf47e5
5253 changed files with 726695 additions and 34 deletions
+2
View File
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
+28
View File
@@ -0,0 +1,28 @@
name: github pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Install
run: flutter pub get
- name: Build
run: cd example && flutter build web
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./example/build/web
+7
View File
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/
.packages
.pub/
build/
+10
View File
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 9f35f6c3a69263266d4db5acfb3eb95fac08e7bd
channel: master
project_type: plugin
+15
View File
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"program": "example/lib/main.dart"
}
]
}
+9
View File
@@ -0,0 +1,9 @@
{
"cSpell.words": [
"horiz",
"localstorage",
"nullsafety",
"peaceiris",
"subosito"
]
}
+80
View File
@@ -0,0 +1,80 @@
## 1.1.2
* Cleaning up lint errors
- Slight refactoring
## 1.1.1-nullsafety
* Null Safety
## 1.1.0-nullsafety
* Null Safety
## 1.0.2 - 05.28.2019
* Adding `masterDetailOnMoreTab` which will show a splitview for tablets in landscape
* Updated Example
## 1.0.1 - 05.14.2019
* Upgrading Dependencies
## 1.0.0 - 05.04.2019
* Support for Dynamicly Generated Drawer on Desktop (Adaptive)
* Updated Example
* Fixing Bug in how data is stored on Desktop and Mobile
* Requires Flutter `master` Channel or Dart `sdk: ">=2.2.2 <3.0.0"`
## 0.3.1 - 04.06.2019
* Updating Example to be desktop aware
## 0.3.0 - 04.05.2019
* Persisting Index on More Tab
## 0.2.0
* Adding Material Options for `.adaptive` Scaffold
## 0.1.0
* Adding Color Options for More Tab
## 0.0.8
* Updating to Support More
## 0.0.7
* Adding Optional Tag if using multi sets of dynamic_tabs
## 0.0.6
* Removing Title Generator, now just uses child
* Removing Dependency for Platform Widgets
* Support for iOS 11 Large Titles
## 0.0.5
* Adding Necessary Routes for Cupertino Tab View
## 0.0.4
* Adding Feedback for When Drag will succeed
## 0.0.3
* Added 'maxTabs' to limit hoe many tabs to show before the edit tab.
* Thanks to "UnqleSquid" from Reddit
## 0.0.1
* Fixed Landscape View
* Adding Optional Title Widget
## 0.0.1
* Created Plugin.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Rody Davis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+33
View File
@@ -0,0 +1,33 @@
[![Buy Me A Coffee](https://img.shields.io/badge/Donate-Buy%20Me%20A%20Coffee-yellow.svg)](https://www.buymeacoffee.com/rodydavis)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSH3GVC49GNNJ)
![github pages](https://github.com/rodydavis/dynamic_tabs/workflows/github%20pages/badge.svg)
[![GitHub stars](https://img.shields.io/github/stars/rodydavis/dynamic_tabs?color=blue)](https://github.com/rodydavis/dynamic_tabs)
[![dynamic_tabs](https://img.shields.io/pub/v/dynamic_tabs.svg)](https://pub.dev/packages/dynamic_tabs)
# dynamic_tabs
A Flutter plugin for letting the user edit the bottom tabs like the Cupertino iTunes App.
Online demo [here](https://rodydavis.github.io/dynamic_tabs/)!
## Getting Started
- Set `persistIndex` to `true` for saving the index of the current tab to disk, every time the app launches it will open the last tab opened
- Tags must be set for each item and must be unique
- There are 2 Modes `DynamicTabScaffold.adaptive` and `DynamicTabScaffold`. The latter just show material
- When using `adaptive` mode the iOS Platform will be wrapped in a CupertinoTabBar and CupertinoTabView, this means that the navigation can be preserved per tab and that the nav bar will be shown still on push. On Android it will push the whole screen
- This widget allows you to use a stateless widget for navigation
- This supports Dark Mode
- If there are more than 5 Tabs there will be a 5th Tab Created Call "More" and it will show a list of the remaining tabs
- On the edit screen the user can reorder that tabs to the nav bar as they wish, this will also be saved to disk
- If Using `.adaptive` Cupertino Widgets are Required and YOu will have to provide the routes for the Navigator.
- You can set the max number of tabs
## Screenshots
![](https://github.com/rodydavis/plugins/blob/master/packages/dynamic_tabs/screenshots/1.PNG)
![](https://github.com/rodydavis/plugins/blob/master/packages/dynamic_tabs/screenshots/2.PNG)
![](https://github.com/rodydavis/plugins/blob/master/packages/dynamic_tabs/screenshots/3.PNG)
![](https://github.com/rodydavis/plugins/blob/master/packages/dynamic_tabs/screenshots/4.PNG)
![](https://github.com/rodydavis/plugins/blob/master/packages/dynamic_tabs/screenshots/5.PNG)
![](https://github.com/rodydavis/plugins/blob/master/packages/dynamic_tabs/screenshots/6.PNG)
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.8/","dependencies":[]}],"android":[{"name":"shared_preferences","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.8/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.2/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.0/","dependencies":[]},{"name":"shared_preferences_linux","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.0.2/","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.3/","dependencies":[]},{"name":"shared_preferences_windows","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.0.2/","dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.2/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2021-09-27 10:53:26.199987","version":"2.5.1"}
@@ -0,0 +1,70 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# Visual Studio Code related
.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
+10
View File
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 9f35f6c3a69263266d4db5acfb3eb95fac08e7bd
channel: master
project_type: app
+183
View File
@@ -0,0 +1,183 @@
# dynamic_tabs_example
``` dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:dynamic_tabs/dynamic_tabs.dart';
import 'package:flutter/foundation.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
home: HomeScreen(),
routes: _buildRoutes(context),
);
}
}
Map<String, WidgetBuilder> _buildRoutes(BuildContext context) =>
<String, WidgetBuilder>{
'/help': (BuildContext context) => RandomScreen(
color: Colors.redAccent,
title: "Info",
),
'/about': (BuildContext context) => RandomScreen(
color: Colors.amber,
title: "Account",
),
};
class HomeScreen extends StatefulWidget {
const HomeScreen({
Key key,
}) : super(key: key);
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return DynamicTabScaffold.adaptive(
routes: _buildRoutes(context),
persistIndex: true,
maxTabs: 4,
masterDetailOnMoreTab: true,
tabs: <DynamicTab>[
DynamicTab(
child: RandomScreen(
color: Colors.redAccent,
title: "Info",
),
tab: BottomNavigationBarItem(
label: "Info",
icon: Icon(Icons.info),
),
tag: "info", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.amber,
title: "Account",
),
tab: BottomNavigationBarItem(
label: "Account",
icon: Icon(Icons.account_circle),
),
tag: "account", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.blueGrey,
title: "Help",
),
tab: BottomNavigationBarItem(
label: "Help",
icon: Icon(Icons.help),
),
tag: "help", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.purple,
title: "Settings",
),
tab: BottomNavigationBarItem(
label: "Settings",
icon: Icon(Icons.settings),
),
tag: "settings", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.yellow,
title: "Theme",
),
tab: BottomNavigationBarItem(
label: "Theme",
icon: Icon(Icons.palette),
),
tag: "theme", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.grey,
title: "FAQ",
),
tab: BottomNavigationBarItem(
label: "FAQ",
icon: Icon(Icons.perm_contact_calendar),
),
tag: "faq", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.pink,
title: "Contacts",
),
tab: BottomNavigationBarItem(
label: "Contacts",
icon: Icon(Icons.people),
),
tag: "contacts", // Must Be Unique
),
],
);
}
}
class RandomScreen extends StatelessWidget {
RandomScreen({
@required this.title,
@required this.color,
});
final String title;
final Color color;
@override
Widget build(BuildContext context) {
if (defaultTargetPlatform == TargetPlatform.iOS) {
return CupertinoPageScaffold(
child: CustomScrollView(
slivers: <Widget>[
CupertinoSliverNavigationBar(
largeTitle: Text(title),
previousPageTitle: "More",
),
SliverToBoxAdapter(
child: Container(
color: color,
),
),
],
),
);
}
return CustomScrollView(
slivers: <Widget>[
SliverAppBar(
title: Text(title),
),
SliverFillRemaining(
child: Container(
color: color,
),
),
],
);
}
}
```
+11
View File
@@ -0,0 +1,11 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
@@ -0,0 +1,59 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
@@ -0,0 +1,41 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<application
android:label="example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="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
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
@@ -0,0 +1,6 @@
package com.example.example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
@@ -0,0 +1,12 @@
<?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">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
@@ -0,0 +1,12 @@
<?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">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -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 on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</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.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
@@ -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">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</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>
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
+31
View File
@@ -0,0 +1,31 @@
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
@@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
@@ -0,0 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
+11
View File
@@ -0,0 +1,11 @@
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
+32
View File
@@ -0,0 +1,32 @@
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
@@ -0,0 +1,26 @@
<?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">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
+41
View File
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
@@ -0,0 +1,471 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -0,0 +1,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">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,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">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,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">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,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">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
@@ -0,0 +1,13 @@
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
@@ -0,0 +1,122 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

@@ -0,0 +1,5 @@
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
+45
View File
@@ -0,0 +1,45 @@
<?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">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
@@ -0,0 +1 @@
#import "GeneratedPluginRegistrant.h"
@@ -0,0 +1,16 @@
//
// Generated file. Do not edit.
//
// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
SharedPreferencesPlugin.registerWith(registrar);
registrar.registerMessageHandler();
}
@@ -0,0 +1,178 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:dynamic_tabs/dynamic_tabs.dart';
import 'package:flutter/foundation.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
home: HomeScreen(),
routes: _buildRoutes(context),
);
}
}
Map<String, WidgetBuilder> _buildRoutes(BuildContext context) =>
<String, WidgetBuilder>{
'/help': (BuildContext context) => RandomScreen(
color: Colors.redAccent,
title: "Info",
),
'/about': (BuildContext context) => RandomScreen(
color: Colors.amber,
title: "Account",
),
};
class HomeScreen extends StatefulWidget {
const HomeScreen({
Key key,
}) : super(key: key);
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return DynamicTabScaffold.adaptive(
routes: _buildRoutes(context),
persistIndex: true,
maxTabs: 4,
masterDetailOnMoreTab: true,
tabs: <DynamicTab>[
DynamicTab(
child: RandomScreen(
color: Colors.redAccent,
title: "Info",
),
tab: BottomNavigationBarItem(
label: "Info",
icon: Icon(Icons.info),
),
tag: "info", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.amber,
title: "Account",
),
tab: BottomNavigationBarItem(
label: "Account",
icon: Icon(Icons.account_circle),
),
tag: "account", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.blueGrey,
title: "Help",
),
tab: BottomNavigationBarItem(
label: "Help",
icon: Icon(Icons.help),
),
tag: "help", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.purple,
title: "Settings",
),
tab: BottomNavigationBarItem(
label: "Settings",
icon: Icon(Icons.settings),
),
tag: "settings", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.yellow,
title: "Theme",
),
tab: BottomNavigationBarItem(
label: "Theme",
icon: Icon(Icons.palette),
),
tag: "theme", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.grey,
title: "FAQ",
),
tab: BottomNavigationBarItem(
label: "FAQ",
icon: Icon(Icons.perm_contact_calendar),
),
tag: "faq", // Must Be Unique
),
DynamicTab(
child: RandomScreen(
color: Colors.pink,
title: "Contacts",
),
tab: BottomNavigationBarItem(
label: "Contacts",
icon: Icon(Icons.people),
),
tag: "contacts", // Must Be Unique
),
],
);
}
}
class RandomScreen extends StatelessWidget {
RandomScreen({
@required this.title,
@required this.color,
});
final String title;
final Color color;
@override
Widget build(BuildContext context) {
if (defaultTargetPlatform == TargetPlatform.iOS) {
return CupertinoPageScaffold(
child: CustomScrollView(
slivers: <Widget>[
CupertinoSliverNavigationBar(
largeTitle: Text(title),
previousPageTitle: "More",
),
SliverToBoxAdapter(
child: Container(
color: color,
),
),
],
),
);
}
return CustomScrollView(
slivers: <Widget>[
SliverAppBar(
title: Text(title),
),
SliverFillRemaining(
child: Container(
color: color,
),
),
],
);
}
}
@@ -0,0 +1,20 @@
name: dynamic_tabs_example
description: Demonstrates how to use the dynamic_tabs plugin.
publish_to: "none"
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
cupertino_icons: ^0.1.2
flutter:
sdk: flutter
dev_dependencies:
dynamic_tabs:
path: ..
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

+33
View File
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta content="IE=Edge" http-equiv="X-UA-Compatible" />
<meta name="description" content="A new Flutter project." />
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="example" />
<link rel="apple-touch-icon" href="icons/Icon-192.png" />
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png" />
<title>example</title>
<link rel="manifest" href="manifest.json" />
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("flutter-first-frame", function () {
navigator.serviceWorker.register("flutter_service_worker.js");
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
+23
View File
@@ -0,0 +1,23 @@
{
"name": "example",
"short_name": "example",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
@@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
class DynamicTab {
const DynamicTab({
required this.child,
required this.tab,
required this.tag,
});
final Widget child;
final BottomNavigationBarItem tab;
/// Uniquie Tag used for storing the tab order on the device
final String tag;
}
@@ -0,0 +1 @@
export 'tab_state.dart';
@@ -0,0 +1,130 @@
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../classes/tab.dart';
class TabState extends ChangeNotifier {
int _currentIndex = 0;
List<DynamicTab>? _items;
int _maxTabs = 4;
bool _persistIndex = false;
late SharedPreferences _storage;
int get currentIndex => _currentIndex;
bool get persistIndex => _persistIndex;
int get maxTabs => _maxTabs;
void init(
String tag,
List<DynamicTab> values, {
bool persist = false,
int max = 4,
}) async {
_items = values;
_persistIndex = persist;
_maxTabs = max;
notifyListeners();
_storage = await SharedPreferences.getInstance();
_loadSavedTabs();
_loadIndex();
}
bool get isMoreTab => _currentIndex >= _maxTabs;
bool get showEditTab => (_items?.length ?? 0) > _maxTabs;
Widget get child => _items![_currentIndex].child;
void changeMaxTabs(int value) {
assert(value >= 2);
_maxTabs = value;
notifyListeners();
}
List<DynamicTab> get mainTabs => allTabs.take(_maxTabs).toList();
List<DynamicTab> get extraTabs => allTabs.skip(_maxTabs).toList();
List<DynamicTab> get allTabs => _items ?? [];
int get adjustedIndex => isMoreTab ? maxTabs : _currentIndex;
int get subIndex => isMoreTab ? _currentIndex - _maxTabs : _currentIndex;
void _loadSavedTabs() async {
List<String> _list = [];
try {
final _data = _storage.getStringList(tabsKey);
if (_data != null) {
_list = List.from(_data);
}
} catch (e) {
print("Couldn't read tabs: $e");
}
if (_list.length == _items!.length) {
changeTabOrder(_list);
}
}
void changeTabOrder(List<String> _list) {
List<String> _tabs = _list;
if (_tabs != null && _tabs.isNotEmpty) {
List<DynamicTab> _newOrder = [];
for (var item in _tabs) {
_newOrder.add(_items!.firstWhere((t) => t.tag == item));
}
_items = _newOrder;
notifyListeners();
}
_saveNewTabs();
}
void _saveNewTabs() async {
final _list = _items!.map((t) => t.tag).toList();
await _storage.setStringList(tabsKey, _list);
}
void changeTab(int value) {
_currentIndex = value;
notifyListeners();
_saveIndex();
}
void _loadIndex() {
if (_persistIndex) {
int _index = _storage.getInt(navKey);
if (_index != null) {
if (_index > _maxTabs) {
_index = 0;
}
_currentIndex = _index;
notifyListeners();
}
_saveIndex();
}
}
void _saveIndex() {
_storage.setInt(navKey, _currentIndex);
}
void reset() {
_storage.clear();
changeTabOrder(_items!.map((t) => t.tag).toList());
_currentIndex = 0;
_saveIndex();
}
String get navKey => 'nav-key';
String get tabsKey => 'tabs-key';
List<BottomNavigationBarItem> get tabs => showEditTab
? <BottomNavigationBarItem>[
...mainTabs.map((e) => e.tab).toList(),
const BottomNavigationBarItem(
label: 'More',
icon: Icon(Icons.more_horiz),
)
]
: <BottomNavigationBarItem>[...allTabs.map((e) => e.tab).toList()];
}
@@ -0,0 +1,222 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'data/classes/tab.dart';
import 'data/models/index.dart';
import 'ui/more_screen.dart';
import 'ui/platforms/cupertino.dart';
import 'ui/platforms/desktop.dart';
import 'ui/platforms/material.dart';
export 'data/classes/tab.dart';
bool isDesktop() =>
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.linux ||
defaultTargetPlatform == TargetPlatform.windows;
class DynamicTabScaffold extends StatelessWidget {
const DynamicTabScaffold({
required this.tabs,
this.backgroundColor,
this.persistIndex = false,
this.iconSize,
this.maxTabs = 4,
this.tag = "",
this.type = BottomNavigationBarType.fixed,
this.moreTabPrimaryColor,
this.moreTabAccentColor,
this.masterDetailOnMoreTab = false,
this.breakpoint = 720,
this.selectedColor,
}) : adaptive = false,
routes = null,
assert(tabs.length >= 2);
const DynamicTabScaffold.adaptive({
required this.tabs,
this.backgroundColor,
this.persistIndex = false,
this.maxTabs = 4,
this.tag = "",
required this.routes,
this.moreTabPrimaryColor,
this.masterDetailOnMoreTab = false,
this.breakpoint = 720,
this.moreTabAccentColor,
BottomNavigationBarType materialType = BottomNavigationBarType.fixed,
double? materialIconSize,
this.selectedColor,
}) : adaptive = true,
type = materialType,
iconSize = materialIconSize,
assert(tabs.length >= 2);
final bool adaptive;
final Color? backgroundColor;
final double breakpoint;
// Material Only
final double? iconSize;
final bool masterDetailOnMoreTab;
final int maxTabs;
final Color? moreTabAccentColor;
// final Color unselectedItemColor;
final Color? moreTabPrimaryColor;
final bool persistIndex;
final Map<String, WidgetBuilder>? routes;
final Color? selectedColor;
final List<DynamicTab> tabs;
// Unique Tag for each set of dynamic tabs
final String tag;
// final Color fixedColor;
final BottomNavigationBarType type;
@override
Widget build(BuildContext context) {
final _state = TabState();
_state.init(tag, tabs, max: maxTabs, persist: persistIndex);
return TabProvider(
state: _state,
child: Builder(
builder: (_) {
if (adaptive && defaultTargetPlatform == TargetPlatform.iOS) {
return CupertinoView(
selectedColor: selectedColor,
backgroundColor: backgroundColor,
routes: routes,
adaptive: adaptive,
maxTabs: maxTabs,
breakpoint: breakpoint,
masterDetailOnMoreTab: masterDetailOnMoreTab,
moreTabAccentColor: moreTabAccentColor,
moreTabPrimaryColor: moreTabPrimaryColor,
);
}
if (adaptive && isDesktop()) {
return DesktopView(
routes: routes,
breakpoint: breakpoint,
masterDetailOnMoreTab: masterDetailOnMoreTab,
adaptive: adaptive,
moreTabAccentColor: moreTabAccentColor,
moreTabPrimaryColor: moreTabPrimaryColor,
);
}
return MaterialView(
routes: routes,
breakpoint: breakpoint,
masterDetailOnMoreTab: masterDetailOnMoreTab,
adaptive: adaptive,
moreTabAccentColor: moreTabAccentColor,
moreTabPrimaryColor: moreTabPrimaryColor,
selectedColor: selectedColor,
maxTabs: maxTabs,
backgroundColor: backgroundColor,
type: type,
);
},
),
);
}
}
class ContentView extends StatelessWidget {
ContentView({
required this.adaptive,
required this.routes,
required this.moreTabAccentColor,
required this.moreTabPrimaryColor,
required this.breakpoint,
required this.masterDetailOnMoreTab,
});
final bool adaptive;
final Color? moreTabAccentColor;
final Color? moreTabPrimaryColor;
final Map<String, WidgetBuilder>? routes;
final bool masterDetailOnMoreTab;
final double breakpoint;
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
if (model.showEditTab && model.isMoreTab && !isDesktop()) {
if (adaptive && defaultTargetPlatform == TargetPlatform.iOS) {
return CupertinoTabView(
routes: routes,
builder: (BuildContext context) {
if (masterDetailOnMoreTab) {
return MoreTab.fluid(
breakpoint: breakpoint,
adaptive: adaptive,
primaryColor: moreTabPrimaryColor,
accentColor: moreTabAccentColor,
navigator: Navigator.of(context),
);
}
return MoreTab(
adaptive: adaptive,
primaryColor: moreTabPrimaryColor,
accentColor: moreTabAccentColor,
navigator: Navigator.of(context),
);
},
);
}
if (masterDetailOnMoreTab) {
return MoreTab.fluid(
primaryColor: moreTabPrimaryColor,
accentColor: moreTabAccentColor,
adaptive: adaptive,
breakpoint: breakpoint,
navigator: Navigator.of(context),
);
}
return MoreTab(
primaryColor: moreTabPrimaryColor,
accentColor: moreTabAccentColor,
adaptive: adaptive,
navigator: Navigator.of(context),
);
}
if (adaptive && defaultTargetPlatform == TargetPlatform.iOS) {
return CupertinoTabView(
routes: routes,
builder: (BuildContext context) => Material(child: model.child),
);
}
return model.child;
},
);
}
}
class TabProvider extends InheritedWidget {
const TabProvider({
Key? key,
required Widget child,
required this.state,
}) : super(key: key, child: child);
final TabState state;
static TabProvider? of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<TabProvider>();
}
@override
bool updateShouldNotify(TabProvider oldWidget) {
return state != oldWidget.state;
}
}
@@ -0,0 +1,94 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import '../../data/classes/tab.dart';
class GridTabItem extends StatelessWidget {
const GridTabItem({
Key? key,
required this.tab,
this.active = true,
this.adaptive = false,
this.draggable = false,
}) : super(key: key);
final DynamicTab tab;
final bool active;
final bool draggable;
final bool adaptive;
@override
Widget build(BuildContext context) {
final Icon _icon = tab.tab.icon as Icon;
final Text _title = Text(tab.tab.label!);
if (draggable) {
return Draggable(
feedback: DefaultTextStyle(
style: adaptive && defaultTargetPlatform == TargetPlatform.iOS
? CupertinoTheme.of(context).textTheme.textStyle
: Theme.of(context).textTheme.title!,
child: Container(
width: 120.0,
height: 80.0,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
_icon.icon,
size: 35.0,
),
AutoSizeText(
_title.data!,
maxLines: 1,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 30.0),
),
],
),
)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
_icon.icon,
color: active ? null : Colors.grey,
),
Text(
_title.data!,
textAlign: TextAlign.center,
style: active ? null : TextStyle(color: Colors.grey),
),
],
),
data: tab.tag,
);
}
if (!active) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
_icon.icon,
color: Colors.grey,
),
Text(
_title.data!,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey),
),
],
);
}
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
_icon,
_title,
],
);
}
}
@@ -0,0 +1,250 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../data/classes/tab.dart';
import 'common/grid_item.dart';
class EditScreen extends StatefulWidget {
const EditScreen({
this.adaptive = false,
required this.tabs,
required this.maxTabs,
});
final bool adaptive;
final List<DynamicTab> tabs;
final int maxTabs;
@override
_EditScreenState createState() => _EditScreenState();
}
class _EditScreenState extends State<EditScreen> {
List<DynamicTab>? _tabs;
@override
void initState() {
_tabs = widget.tabs;
super.initState();
}
@override
Widget build(BuildContext context) {
if (widget.adaptive && defaultTargetPlatform == TargetPlatform.iOS) {
return DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
transitionBetweenRoutes: false,
heroTag: 'more-tab',
trailing: CupertinoButton(
padding: EdgeInsets.all(0.0),
child: Text("Save"),
onPressed: () => _saveTabs(context),
),
),
child: LayoutBuilder(
builder: (context, constraints) {
return Column(
children: <Widget>[
Expanded(
child: _buildBody(context, constraints),
),
Container(
height: 100.0,
child: BottomEditableTabBar(
adaptive: widget.adaptive,
maxTabs: widget.maxTabs,
tabs: _tabs,
onChanged: (tabs) {
setState(() {
_tabs = tabs;
});
},
),
),
],
);
},
),
));
}
return DefaultTextStyle(
style: Theme.of(context).textTheme.display1!,
child: Scaffold(
appBar: AppBar(
actions: <Widget>[
IconButton(
icon: Icon(Icons.save),
onPressed: () => _saveTabs(context),
),
],
),
body: LayoutBuilder(
builder: (context, constraints) {
return Column(
children: <Widget>[
Expanded(
child: _buildBody(context, constraints),
),
Container(
height: 100.0,
child: BottomEditableTabBar(
adaptive: widget.adaptive,
maxTabs: widget.maxTabs,
tabs: _tabs,
onChanged: (tabs) {
setState(() {
_tabs = tabs;
});
},
),
),
],
);
},
),
));
}
Widget _buildBody(BuildContext context, BoxConstraints constraints) {
return Center(
child: SafeArea(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 20, bottom: 20.0),
child: Text(
"Drag the icons to\norganize tabs.",
style: Theme.of(context)
.textTheme
.headline4!
.copyWith(fontSize: 22.0),
textAlign: TextAlign.center,
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10.0),
child: GridView.count(
shrinkWrap: true,
crossAxisCount: (constraints.maxWidth / 100).round(),
children: _tabs!
.map(
(t) => GridTabItem(
active: _tabs!.indexOf(t) >= widget.maxTabs,
tab: t,
adaptive: widget.adaptive,
draggable: true,
),
)
.toList(),
),
),
)
],
),
),
);
}
void _saveTabs(BuildContext context) {
Navigator.of(context).pop(_tabs);
}
}
class BottomEditableTabBar extends StatefulWidget {
const BottomEditableTabBar({
required this.maxTabs,
required this.tabs,
required this.adaptive,
required this.onChanged,
});
final bool adaptive;
final int maxTabs;
final List<DynamicTab>? tabs;
final ValueChanged<List<DynamicTab>?> onChanged;
@override
_BottomEditableTabBarState createState() => _BottomEditableTabBarState();
}
class _BottomEditableTabBarState extends State<BottomEditableTabBar> {
List<DynamicTab>? _tabs;
int? _previewIndex;
@override
void initState() {
_tabs = widget.tabs;
super.initState();
}
@override
Widget build(BuildContext context) {
List<Widget> _children = [];
List<DynamicTab> _targets = _tabs!.take(widget.maxTabs).toList();
for (var t in _targets) {
_children.add(DragTarget<String>(
builder: (context, possible, rejected) {
print("Possible: $possible, Rejected: $rejected");
return GridTabItem(
tab: t,
active: _previewIndex == null
? true
: !(_targets.indexOf(t) == _previewIndex),
adaptive: widget.adaptive,
// draggable: true,
);
},
onWillAccept: (String? data) {
setState(() {
_previewIndex = _targets.indexOf(t);
});
return true;
},
onLeave: (data) {
setState(() {
_previewIndex = null;
});
},
onAccept: (String data) {
final DynamicTab _baseTab = _targets[_previewIndex!];
final DynamicTab _newTab = _tabs!.firstWhere((t) => t.tag == data);
final int _oldIndex = _tabs!.indexOf(_newTab);
_tabs!.removeAt(_previewIndex!);
_tabs!.insert(_previewIndex!, _newTab);
_tabs!.removeAt(_oldIndex);
_tabs!.insert(_oldIndex, _baseTab);
widget.onChanged(_tabs);
setState(() {
_previewIndex = null;
});
},
));
}
_children.add(GridTabItem(
tab: DynamicTab(
child: Container(),
tab: BottomNavigationBarItem(
icon: Icon(Icons.more_horiz),
title: Text("More"),
),
tag: "",
),
draggable: false,
active: false,
adaptive: widget.adaptive,
));
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: _children,
),
);
}
}
@@ -0,0 +1,276 @@
import 'package:cupertino_controllers/cupertino_controllers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../data/classes/tab.dart';
import '../data/models/index.dart';
import '../dynamic_tabs.dart';
import 'edit_screen.dart';
class MoreTab extends StatelessWidget {
const MoreTab({
this.adaptive = false,
required this.primaryColor,
required this.accentColor,
required this.navigator,
}) : breakpoint = null,
masterDetail = false;
const MoreTab.fluid({
this.adaptive = false,
required this.primaryColor,
required this.accentColor,
required this.navigator,
this.breakpoint = 720,
}) : masterDetail = true;
final bool adaptive;
final Color? primaryColor;
final Color? accentColor;
final NavigatorState navigator;
final bool masterDetail;
final double? breakpoint;
@override
Widget build(BuildContext context) {
final media = MediaQuery.of(context);
final _landscape = media.orientation == Orientation.landscape;
return LayoutBuilder(
builder: (context, constraints) {
final _expanded = masterDetail && constraints.maxWidth >= breakpoint!;
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
if (adaptive && defaultTargetPlatform == TargetPlatform.iOS) {
if (_landscape &&
masterDetail &&
constraints.maxWidth >= breakpoint!) {
return Row(
children: <Widget>[
Container(
width: 350,
child: CupertinoPage(
primaryColor: primaryColor,
accentColor: accentColor,
expanded: _expanded,
onEdit: () => _goToEditScreen(context, model),
onTap: (index) {
final _index =
model.allTabs.indexOf(model.extraTabs[index]);
model.changeTab(_index);
},
),
),
Expanded(child: model.child),
],
);
}
return CupertinoPage(
primaryColor: primaryColor,
accentColor: accentColor,
expanded: _expanded,
onEdit: () => _goToEditScreen(context, model),
onTap: (index) async {
final _index = model.allTabs.indexOf(model.extraTabs[index]);
model.changeTab(_index);
await navigator.push(
CupertinoPageRoute(
builder: (context) => model.child,
),
);
},
);
}
if (_landscape &&
masterDetail &&
constraints.maxWidth >= breakpoint!) {
return Row(
children: <Widget>[
Container(
width: 350,
child: new MaterialPage(
primaryColor: primaryColor,
accentColor: accentColor,
expanded: _expanded,
onEdit: () => _goToEditScreen(context, model),
onTap: model.changeTab,
),
),
Expanded(child: model.child),
],
);
}
return MaterialPage(
primaryColor: primaryColor,
accentColor: accentColor,
expanded: _expanded,
onEdit: () => _goToEditScreen(context, model),
onTap: (index) async {
final _index = model.allTabs.indexOf(model.extraTabs[index]);
model.changeTab(_index);
await navigator.push(
MaterialPageRoute(
builder: (context) {
return Material(child: model.child);
},
),
);
},
);
},
);
},
);
}
void _goToEditScreen(BuildContext context, TabState state) {
Navigator.of(context, rootNavigator: true)
.push<List<DynamicTab>>(MaterialPageRoute(
builder: (context) => EditScreen(
maxTabs: state.maxTabs,
adaptive: adaptive,
tabs: state.allTabs,
),
fullscreenDialog: true,
))
.then((newTabs) {
if (newTabs != null) {
final _list = newTabs.map((t) => t.tag).toList();
state.changeTabOrder(_list);
}
});
}
}
class MaterialPage extends StatelessWidget {
const MaterialPage({
Key? key,
required this.primaryColor,
required this.accentColor,
required this.expanded,
required this.onEdit,
required this.onTap,
}) : super(key: key);
final bool expanded;
final VoidCallback onEdit;
final ValueChanged<int> onTap;
final Color? primaryColor;
final Color? accentColor;
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
return Scaffold(
appBar: AppBar(
title: Text("More"),
actions: <Widget>[
IconButton(
icon: Icon(Icons.edit),
onPressed: onEdit,
),
],
),
body: SafeArea(
child: ListView.builder(
padding: EdgeInsets.all(0.0),
itemCount: model.extraTabs.length,
itemBuilder: (BuildContext context, int index) {
final i = model.extraTabs[index];
return ListTile(
leading: i.tab.icon,
title: i.tab.title,
selected: expanded ? index == model.subIndex : false,
trailing:
!expanded ? Icon(Icons.keyboard_arrow_right) : null,
onTap: () => onTap(index),
);
},
),
));
},
);
}
}
class CupertinoPage extends StatelessWidget {
const CupertinoPage({
Key? key,
required this.primaryColor,
required this.accentColor,
required this.onTap,
required this.onEdit,
required this.expanded,
}) : super(key: key);
final Color? primaryColor;
final Color? accentColor;
final ValueChanged<int> onTap;
final VoidCallback onEdit;
final bool expanded;
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
return CupertinoPageScaffold(
child: CustomScrollView(
slivers: <Widget>[
CupertinoSliverNavigationBar(
backgroundColor: primaryColor,
transitionBetweenRoutes: !expanded,
heroTag: Key('more-tab'),
largeTitle: Text("More"),
trailing: CupertinoButton(
child: Text("Edit"),
padding: EdgeInsets.all(0.0),
onPressed: onEdit,
),
),
SliverPadding(
padding: MediaQuery.of(context)
.removePadding(
removeTop: true,
removeLeft: true,
removeRight: true,
)
.padding,
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
final i = model.extraTabs[index];
final Icon _icon = i.tab.icon as Icon;
final Text _text = i.tab.title as Text;
return DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: CupertinoListTile(
leading: _icon.icon!,
title: _text,
selected:
expanded ? index == model.subIndex : false,
lastItem: false,
ios: CupertinoListTileData(
style: CupertinoCellStyle.subtitle,
accessory: expanded
? CupertinoAccessory.none
: CupertinoAccessory.disclosureIndicator,
),
onTap: () => onTap(index),
));
},
childCount: model.extraTabs.length,
),
),
),
],
),
);
},
);
}
}
@@ -0,0 +1,56 @@
import 'package:dynamic_tabs/dynamic_tabs.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class CupertinoView extends StatelessWidget {
const CupertinoView({
Key? key,
required this.selectedColor,
required this.maxTabs,
required this.backgroundColor,
required this.adaptive,
required this.routes,
required this.moreTabAccentColor,
required this.moreTabPrimaryColor,
required this.breakpoint,
required this.masterDetailOnMoreTab,
}) : super(key: key);
final bool adaptive;
final Color? backgroundColor;
final int maxTabs;
final Color? moreTabAccentColor;
final Color? moreTabPrimaryColor;
final Map<String, WidgetBuilder>? routes;
final Color? selectedColor;
final bool masterDetailOnMoreTab;
final double breakpoint;
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
return CupertinoTabScaffold(
tabBuilder: (BuildContext context, int index) {
return ContentView(
routes: routes,
adaptive: adaptive,
breakpoint: breakpoint,
masterDetailOnMoreTab: masterDetailOnMoreTab,
moreTabAccentColor: moreTabAccentColor,
moreTabPrimaryColor: moreTabPrimaryColor,
);
},
tabBar: CupertinoTabBar(
activeColor: selectedColor,
items: model.tabs,
currentIndex: model.adjustedIndex,
onTap: model.changeTab,
backgroundColor: backgroundColor,
),
);
},
);
}
}
@@ -0,0 +1,60 @@
import 'package:dynamic_tabs/dynamic_tabs.dart';
import 'package:flutter/material.dart';
class DesktopView extends StatelessWidget {
const DesktopView({
Key? key,
required this.routes,
required this.adaptive,
required this.moreTabAccentColor,
required this.moreTabPrimaryColor,
required this.breakpoint,
required this.masterDetailOnMoreTab,
}) : super(key: key);
final bool adaptive;
final Color? moreTabAccentColor;
final Color? moreTabPrimaryColor;
final Map? routes;
final bool masterDetailOnMoreTab;
final double breakpoint;
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
return Scaffold(
body: ContentView(
routes: routes as Map<String, Widget Function(BuildContext)>?,
adaptive: adaptive,
breakpoint: breakpoint,
masterDetailOnMoreTab: masterDetailOnMoreTab,
moreTabAccentColor: moreTabAccentColor,
moreTabPrimaryColor: moreTabPrimaryColor,
),
drawer: Drawer(
child: SafeArea(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
for (var i = 0; i < model.allTabs.length; i++) ...[
ListTile(
selected: i == model.currentIndex,
leading: model.allTabs[i].tab.icon,
title: Text(model.allTabs[i].tab.label ?? ''),
onTap: () {
model.changeTab(i);
},
),
],
],
),
),
),
),
);
},
);
}
}
@@ -0,0 +1,57 @@
import 'package:dynamic_tabs/dynamic_tabs.dart';
import 'package:flutter/material.dart';
class MaterialView extends StatelessWidget {
const MaterialView({
Key? key,
required this.routes,
required this.adaptive,
required this.moreTabAccentColor,
required this.moreTabPrimaryColor,
required this.selectedColor,
required this.maxTabs,
required this.backgroundColor,
required this.type,
required this.breakpoint,
required this.masterDetailOnMoreTab,
}) : super(key: key);
final bool adaptive;
final Color? backgroundColor;
final int maxTabs;
final Color? moreTabAccentColor;
final Color? moreTabPrimaryColor;
final Map? routes;
final Color? selectedColor;
final BottomNavigationBarType type;
final bool masterDetailOnMoreTab;
final double breakpoint;
@override
Widget build(BuildContext context) {
return Builder(
builder: (context) {
final model = TabProvider.of(context)!.state;
return Scaffold(
body: ContentView(
routes: routes as Map<String, Widget Function(BuildContext)>?,
adaptive: adaptive,
breakpoint: breakpoint,
masterDetailOnMoreTab: masterDetailOnMoreTab,
moreTabAccentColor: moreTabAccentColor,
moreTabPrimaryColor: moreTabPrimaryColor,
),
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: selectedColor,
items: model.tabs,
currentIndex: model.adjustedIndex,
onTap: model.changeTab,
fixedColor: backgroundColor ?? Theme.of(context).primaryColor,
type: type,
// unselectedItemColor: unselectedItemColor ?? Colors.grey,
),
);
},
);
}
}
+23
View File
@@ -0,0 +1,23 @@
name: dynamic_tabs
description: A Flutter plugin for letting the user edit the bottom tabs like the
Cupertino iTunes App.
version: 1.1.2
author: Rody Davis <rody.davis.jr@gmail.com>
homepage: https://github.com/rodydavis/plugins
repository: https://github.com/rodydavis/dynamic_tabs
environment:
sdk: ">=2.12.0-259.8.beta <3.0.0"
dependencies:
auto_size_text: ^2.1.0
cupertino_controllers: ^1.1.0
flutter:
sdk: flutter
shared_preferences: any
dev_dependencies:
flutter_test:
sdk: flutter
flutter: null
Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB