Skip to content
Merged
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
File renamed without changes.
34 changes: 34 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PODS:
- Flutter (1.0.0)
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios"

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9

PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a

COCOAPODS: 1.9.3
71 changes: 71 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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 */; };
98D03AC8BD0EB475973728E4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03715CDAED8CFDE3AEA71199 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -29,32 +30,56 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
03715CDAED8CFDE3AEA71199 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
171537F7682C238A232F6BCC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; 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>"; };
7FA0B0E8A3A23E79DE9F2470 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.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>"; };
BA2F0552EA5A958FC7EF6EBA /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
98D03AC8BD0EB475973728E4 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
601926BF140CCFC1D114815A /* Pods */ = {
isa = PBXGroup;
children = (
7FA0B0E8A3A23E79DE9F2470 /* Pods-Runner.debug.xcconfig */,
BA2F0552EA5A958FC7EF6EBA /* Pods-Runner.release.xcconfig */,
171537F7682C238A232F6BCC /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
6153A895178271A935C4DE89 /* Frameworks */ = {
isa = PBXGroup;
children = (
03715CDAED8CFDE3AEA71199 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
Expand All @@ -72,6 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
601926BF140CCFC1D114815A /* Pods */,
6153A895178271A935C4DE89 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -105,12 +132,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
CCCA04282C9E58583AA58C1F /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
8FF5D6EEFEAF7A9CAB609868 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -183,6 +212,26 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
8FF5D6EEFEAF7A9CAB609868 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -197,6 +246,28 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
CCCA04282C9E58583AA58C1F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
3 changes: 3 additions & 0 deletions ios/Runner.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/core/base/view/base_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class _BaseViewState<T extends Store> extends State<BaseView<T>> {
T model;
@override
void initState() {
model = widget.viewModel;
widget.onModelReady(model);
super.initState();
}
Expand Down
Empty file.
19 changes: 19 additions & 0 deletions lib/core/components/button/icon_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';

import 'normal_button.dart';

class IconNormalButton extends StatelessWidget {
final VoidCallback onPressed;
final IconData icon;

const IconNormalButton({Key key, this.onPressed, @required this.icon}) : super(key: key);
@override
Widget build(BuildContext context) {
return NormalButton(
onPressed: this.onPressed,
child: Center(
child: Icon(icon),
),
);
}
}
18 changes: 18 additions & 0 deletions lib/core/components/button/normal_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';

class NormalButton extends StatelessWidget {
final Widget child;

final VoidCallback onPressed;

const NormalButton({Key key, this.child, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return RaisedButton(
padding: EdgeInsets.all(15),
elevation: 10,
onPressed: this.onPressed,
child: child,
);
}
}
19 changes: 19 additions & 0 deletions lib/core/components/button/title_text_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';

import 'normal_button.dart';

class TitleTextButton extends StatelessWidget {
final VoidCallback onPressed;
final String text;

const TitleTextButton({Key key, this.onPressed, @required this.text}) : super(key: key);
@override
Widget build(BuildContext context) {
return NormalButton(
onPressed: this.onPressed,
child: Center(
child: Text(text),
),
);
}
}
22 changes: 22 additions & 0 deletions lib/core/components/column/form_column.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:flutter/material.dart';

class FormColumn extends StatelessWidget {
final List<Widget> children;

const FormColumn({Key key, this.children}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
Spacer(flex: 1),
Expanded(
flex: 8,
child: Column(
children: this.children,
),
),
Spacer(flex: 1),
],
);
}
}
45 changes: 45 additions & 0 deletions lib/core/components/list-view/indicator_list_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'package:flutter/material.dart';

import '../../extension/context_extension.dart';

class IndactorListView extends StatelessWidget {
final int itemCount;

final int currentIndex;

final Widget Function(int index) onListItem;

const IndactorListView({Key key, this.itemCount, this.onListItem, this.currentIndex}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: itemCount,
shrinkWrap: true,
itemBuilder: (context, index) => buildPadding(context, index),
);
}

Padding buildPadding(BuildContext context, int index) {
return Padding(
padding: context.paddingLow,
child: buildCircleAvatar(index, context),
);
}

CircleAvatar buildCircleAvatar(int index, BuildContext context) {
return CircleAvatar(
backgroundColor: isCurrentIndex(index) ? Colors.black12 : Colors.blue,
radius: isCurrentIndex(index) ? context.width * 0.03 : context.width * 0.015,
child: AnimatedOpacity(
opacity: opacityValue(index),
duration: context.normalDuration,
child: onListItem(index),
),
);
}

double opacityValue(int index) => isCurrentIndex(index) ? 1 : 0;

bool isCurrentIndex(int index) => currentIndex == index;
}
11 changes: 11 additions & 0 deletions lib/core/extension/context_extension.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:math';

import 'package:flutter/material.dart';

extension ContextExtension on BuildContext {
Expand Down Expand Up @@ -26,3 +28,12 @@ extension PaddingExtension on BuildContext {
EdgeInsets get paddingMedium => EdgeInsets.all(mediumValue);
EdgeInsets get paddingHigh => EdgeInsets.all(highValue);
}

extension PageExtension on BuildContext {
Color get randomColor => Colors.primaries[Random().nextInt(17)];
}

extension DurationExtension on BuildContext {
Duration get lowDuration => Duration(milliseconds: 500);
Duration get normalDuration => Duration(seconds: 1);
}
5 changes: 4 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:fluttermvvmtemplate/view/authenticate/login/view/login_view.dart';
import 'package:fluttermvvmtemplate/view/authenticate/onboard/view/on_board_view.dart';
import 'package:provider/provider.dart';

import 'core/constants/app/app_constants.dart';
Expand All @@ -12,6 +14,7 @@ import 'core/init/notifier/theme_notifer.dart';
import 'view/authenticate/test/view/test_view.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
LocaleManager.prefrencesInit();
runApp(MultiProvider(
providers: [...ApplicationProvider.instance.dependItems],
Expand All @@ -27,7 +30,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: Provider.of<ThemeNotifier>(context, listen: false).currentTheme,
home: TestsView(),
home: OnBoardView(),
onGenerateRoute: NavigationRoute.instance.generateRoute,
navigatorKey: NavigationService.instance.navigatorKey,
);
Expand Down
31 changes: 31 additions & 0 deletions lib/view/_widgets/button/face_book_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:fluttermvvmtemplate/core/components/button/title_text_button.dart';

class FaceBookButton extends StatelessWidget {
final Function(FaceBookModel data, {String errorMessage}) onComplete;

const FaceBookButton({Key key, this.onComplete}) : super(key: key);

@override
Widget build(BuildContext context) {
return TitleTextButton(
text: "Facebbok login",
onPressed: () {
final isLengthSixCharacter = "asdasdasd".length == 6;

if (isLengthSixCharacter) {
this.onComplete(FaceBookModel("asdasd", "ASdasd"));
} else {
this.onComplete(null, errorMessage: "Facebook user not found");
}
},
);
}
}

class FaceBookModel {
final String token;
final String mail;

FaceBookModel(this.token, this.mail);
}
Loading