Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the ShrineApp to run on latest Flutter version #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ShrineApp/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"alan_voice","path":"/Users/sergeyyuryev/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/alan_voice-2.4.0/","dependencies":["package_info"]},{"name":"package_info","path":"/Users/sergeyyuryev/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+17/","dependencies":[]}],"android":[{"name":"alan_voice","path":"/Users/sergeyyuryev/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/alan_voice-2.4.0/","dependencies":["package_info"]},{"name":"package_info","path":"/Users/sergeyyuryev/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+17/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"alan_voice","dependencies":["package_info"]},{"name":"package_info","dependencies":[]}],"date_created":"2021-10-19 15:54:15.651388","version":"1.20.4"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"alan_voice","path":"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\alan_voice-3.0.0\\\\","native_build":true,"dependencies":["package_info"]},{"name":"package_info","path":"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-2.0.2\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"alan_voice","path":"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\alan_voice-3.0.0\\\\","native_build":true,"dependencies":["package_info"]},{"name":"package_info","path":"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-2.0.2\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"package_info","path":"C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info-2.0.2\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"alan_voice","dependencies":["package_info"]},{"name":"package_info","dependencies":[]}],"date_created":"2023-01-13 10:17:27.991031","version":"3.3.9"}
16 changes: 13 additions & 3 deletions examples/ShrineApp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdkVersion 31
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down Expand Up @@ -68,6 +78,6 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="shrine"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
4 changes: 2 additions & 2 deletions examples/ShrineApp/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
16 changes: 7 additions & 9 deletions examples/ShrineApp/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/sergeyyuryev/Downloads/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/sergeyyuryev/Documents/Alan/alan-sdk-flutter/examples/ShrineApp"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_ROOT=C:\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\user\Desktop\Programming\Flutter\ShrineApp"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=/Users/sergeyyuryev/Downloads/flutter/bin/cache/artifacts/engine/ios-release"
export "FLUTTER_BUILD_NAME=1.0.7"
export "FLUTTER_BUILD_NUMBER=16"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=true"
export "PACKAGE_CONFIG=.packages"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
34 changes: 17 additions & 17 deletions examples/ShrineApp/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ ThemeData _buildShrineTheme() {
final ThemeData base = ThemeData.light();
return base.copyWith(
colorScheme: kShrineColorScheme,
accentColor: kShrineBrown900,
// accentColor: kShrineBrown900,
primaryColor: kShrinePink100,
buttonColor: kShrinePink100,
// buttonColor: kShrinePink100,
scaffoldBackgroundColor: kShrineBackgroundWhite,
cardColor: kShrineBackgroundWhite,
textSelectionColor: kShrinePink100,
// textSelectionColor: kShrinePink100,
errorColor: kShrineErrorRed,
buttonTheme: const ButtonThemeData(
colorScheme: kShrineColorScheme,
Expand All @@ -255,28 +255,28 @@ ThemeData _buildShrineTheme() {
const InputDecorationTheme(border: CutCornersBorder()),
textTheme: _buildShrineTextTheme(base.textTheme),
primaryTextTheme: _buildShrineTextTheme(base.primaryTextTheme),
accentTextTheme: _buildShrineTextTheme(base.accentTextTheme),
// accentTextTheme: _buildShrineTextTheme(base.accentTextTheme),
iconTheme: _customIconTheme(base.iconTheme),
);
}

TextTheme _buildShrineTextTheme(TextTheme base) {
return base
.copyWith(
headline: base.headline.copyWith(fontWeight: FontWeight.w500),
title: base.title.copyWith(fontSize: 18.0),
caption: base.caption.copyWith(
fontWeight: FontWeight.w400,
fontSize: 14.0,
),
body2: base.body2.copyWith(
headlineLarge: base.headlineLarge.copyWith(fontWeight: FontWeight.w500),
titleLarge: base.titleLarge.copyWith(fontSize: 18.0),
// caption: base.caption.copyWith(
// fontWeight: FontWeight.w400,
// fontSize: 14.0,
// ),
bodyLarge: base.bodyLarge.copyWith(
fontWeight: FontWeight.w500,
fontSize: 16.0,
),
button: base.button.copyWith(
fontWeight: FontWeight.w500,
fontSize: 14.0,
),
// button: base.button.copyWith(
// fontWeight: FontWeight.w500,
// fontSize: 14.0,
// ),
)
.apply(
fontFamily: 'Rubik',
Expand All @@ -287,9 +287,9 @@ TextTheme _buildShrineTextTheme(TextTheme base) {

const ColorScheme kShrineColorScheme = ColorScheme(
primary: kShrinePink100,
primaryVariant: kShrineBrown900,
// primaryVariant: kShrineBrown900,
secondary: kShrinePink50,
secondaryVariant: kShrineBrown900,
// secondaryVariant: kShrineBrown900,
surface: kShrineSurfaceWhite,
background: kShrineBackgroundWhite,
error: kShrineErrorRed,
Expand Down
7 changes: 3 additions & 4 deletions examples/ShrineApp/lib/backdrop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:Shrine/model/dispatcher.dart';
import 'package:shrine/model/dispatcher.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
// import 'package:meta/meta.dart';
import 'package:package_info/package_info.dart';
import 'package:scoped_model/scoped_model.dart';
import 'login.dart';
import 'model/app_state_model.dart';

const Cubic _kAccelerateCurve = Cubic(0.548, 0.0, 0.757, 0.464);
Expand Down Expand Up @@ -85,7 +84,7 @@ class _BackdropTitle extends AnimatedWidget {
);

return DefaultTextStyle(
style: Theme.of(context).primaryTextTheme.title,
style: Theme.of(context).primaryTextTheme.titleLarge,
softWrap: false,
overflow: TextOverflow.ellipsis,
child: Row(children: <Widget>[
Expand Down
4 changes: 2 additions & 2 deletions examples/ShrineApp/lib/category_menu_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CategoryMenuPage extends StatelessWidget {
SizedBox(height: 16.0),
Text(
categoryString,
style: theme.textTheme.body2,
style: theme.textTheme.bodyText1,
textAlign: TextAlign.center,
),
SizedBox(height: 14.0),
Expand All @@ -61,7 +61,7 @@ class CategoryMenuPage extends StatelessWidget {
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Text(
categoryString,
style: theme.textTheme.body2
style: theme.textTheme.bodyText2
.copyWith(color: kShrineBrown900.withAlpha(153)),
textAlign: TextAlign.center,
),
Expand Down
2 changes: 1 addition & 1 deletion examples/ShrineApp/lib/expanding_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ExpandingBottomSheet extends StatefulWidget {
assert(isNullOk != null);
assert(context != null);
final _ExpandingBottomSheetState result = context
.ancestorStateOfType(const TypeMatcher<_ExpandingBottomSheetState>());
.findAncestorStateOfType();
if (isNullOk || result != null) {
return result;
}
Expand Down
40 changes: 23 additions & 17 deletions examples/ShrineApp/lib/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _LoginPageState extends State<LoginPage> {
const SizedBox(height: 16.0),
Text(
'SHRINE',
style: Theme.of(context).textTheme.headline,
style: Theme.of(context).textTheme.bodyLarge,
),
],
),
Expand All @@ -65,25 +65,31 @@ class _LoginPageState extends State<LoginPage> {
),
ButtonBar(
children: <Widget>[
FlatButton(
child: const Text('CANCEL'),
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(7.0))
),
child: TextButton(
child: const Text('CANCEL'),
onPressed: () {
_usernameController.clear();
_passwordController.clear();
},
),
onPressed: () {
_usernameController.clear();
_passwordController.clear();
},
),
RaisedButton(
child: const Text('NEXT'),
elevation: 8.0,
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(7.0))
),
child: ElevatedButton(
child: const Text('NEXT'),
style: ElevatedButton.styleFrom(
textStyle: const TextStyle(fontSize: 20),
),
onPressed: () {
Navigator.pop(context);
},
),
onPressed: () {
Navigator.pop(context);
},
),
],
),
Expand Down
4 changes: 2 additions & 2 deletions examples/ShrineApp/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import 'app.dart';
import 'model/app_state_model.dart';

void main() {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
// SystemChrome.setPreferredOrientations(
// [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);

var model = AppStateModel();
model.loadProducts();
Expand Down
31 changes: 16 additions & 15 deletions examples/ShrineApp/lib/shopping_cart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
),
Text(
'CART',
style: localTheme.textTheme.subhead
style: localTheme.textTheme.subtitle1
.copyWith(fontWeight: FontWeight.w600),
),
const SizedBox(width: 16.0),
Expand All @@ -88,20 +88,21 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
bottom: 16.0,
left: 16.0,
right: 16.0,
child: RaisedButton(
shape: const BeveledRectangleBorder(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
color: kShrinePink100,
),
color: kShrinePink100,
splashColor: kShrineBrown600,
child: const Padding(
padding: EdgeInsets.symmetric(vertical: 12.0),
child: Text('CLEAR CART'),
child: ElevatedButton(
child: const Padding(
padding: EdgeInsets.symmetric(vertical: 12.0),
child: Text('CLEAR CART'),
),
onPressed: () {
model.clearCart();
ExpandingBottomSheet.of(context).close();
},
),
onPressed: () {
model.clearCart();
ExpandingBottomSheet.of(context).close();
},
),
),
],
Expand Down Expand Up @@ -138,8 +139,8 @@ class _ShoppingCartSummaryState extends State<ShoppingCartSummary> {
@override
Widget build(BuildContext context) {
final smallAmountStyle =
Theme.of(context).textTheme.body1.copyWith(color: kShrineBrown600);
final largeAmountStyle = Theme.of(context).textTheme.display1;
Theme.of(context).textTheme.bodyText1.copyWith(color: kShrineBrown600);
final largeAmountStyle = Theme.of(context).textTheme.displaySmall;
final formatter = NumberFormat.simpleCurrency(
decimalDigits: 2, locale: Localizations.localeOf(context).toString());

Expand Down Expand Up @@ -286,7 +287,7 @@ class ShoppingCartRow extends StatelessWidget {
),
Text(
product.name,
style: localTheme.textTheme.subhead
style: localTheme.textTheme.subtitle1
.copyWith(fontWeight: FontWeight.w600),
),
],
Expand Down
2 changes: 1 addition & 1 deletion examples/ShrineApp/lib/supplemental/asymmetric_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:Shrine/model/dispatcher.dart';
import 'package:shrine/model/dispatcher.dart';
import 'package:flutter/material.dart';

import '../model/product.dart';
Expand Down
Loading