simpleboilerplates / flutter Goto Github PK
View Code? Open in Web Editor NEWA boilerplate project for Flutter using RiverPod, Dio, go_router, Freezed and generated with very_good_cli
License: MIT License
A boilerplate project for Flutter using RiverPod, Dio, go_router, Freezed and generated with very_good_cli
License: MIT License
Like:
lib
--app
--state
*** app_start_state.dart
--feature
--auth
--model
*** auth_state.dart
--feature
--home
--state
*** books_state.dart
***home_state.dart
I am trying to learn Riverpod and code structure but those got me confused.
Thanks for your time.
Cheers
in web/index.html
the line
<script src="app.dart.js" type="application/javascript"></script>
has to be changed to
<script src="main.dart.js" type="application/javascript"></script>
at a very quick skim 'Avoid writing scripts with Derry' sounds like you suggest avoiding derry itself.
Suggest changing to something like 'Use Derry to avoid writing your own scripts' or similar
[flutter_starter](master)$ flutter run --flavor development --target lib/main_development.dart -d chrome
Running "flutter pub get" in flutter_starter... 15.0s
Launching lib/main_development.dart on Chrome in debug mode...
Error: unable to find directory entry in pubspec.yaml:
/Users/bartonhammond/bible/code/flutter_starter/assets/image/
../../../.pub-cache/hosted/pub.dartlang.org/auto_route-3.1.3/lib/src/router/prov
ider/auto_route_information_provider.dart:28:8: Error: The method
'AutoRouteInformationProvider.routerReportsNewRouteInformation' doesn't have the
named parameter 'type' of overridden method
'RouteInformationProvider.routerReportsNewRouteInformation'.
void routerReportsNewRouteInformation(RouteInformation routeInformation,
^
../../../tools/flutter/packages/flutter/lib/src/widgets/router.dart:1329:8:
Context: This is the overridden method ('routerReportsNewRouteInformation').
void routerReportsNewRouteInformation(RouteInformation routeInformation,
{required RouteInformationReportingType type}) {}
^
../../../.pub-cache/hosted/pub.dartlang.org/auto_route-3.1.3/lib/src/router/cont
roller/auto_router_delegate.dart:26:43: Error: Required named parameter 'type'
must be provided.
?.routerReportsNewRouteInformation(
^
Waiting for connection from debug service on Chrome... 25.3s
Failed to compile application.
Hi. Im new to AutoRoute, I cant figure out how to make more pages with this boilerplate.
So I made something liek this.
@AdaptiveAutoRouter(
replaceInRouteName: 'Page,Route',
routes: <AutoRoute>[
//RedirectRoute(path: '*', redirectTo: '/'),
AutoRoute(page: AppStartPage, initial: true),
AutoRoute(
path: '/home',
page: HomePage,
children: <AutoRoute>[
AutoRoute<FieldInfoPage>(
name: 'FieldInfoRoute',
path: 'fieldInfo',
page: FieldInfoPage,
),
],
),
signInRouter,
signUpRouter,
],
)
But the problem here is that after flutters "hot reload" it triggers the AppStartPage, and opens the HomePage again.
How do I make it so it doesn't open HomePage everytime it reloads?
In Terminal : derry clean
In Terminal : derry watch
[email protected]+1 watch
$ flutter pub run build_runner watch --delete-conflicting-outputs
Unhandled exception:
Bad state: Unable to generate package graph, no .../Flutter-master/.dart_tool/flutter_gen/pubspec.yaml
found.
#0 _pubspecForPath (package:build_runner_core/src/package_graph/package_graph.dart:232:5)
#1 _parsePackageDependencies (package:build_runner_core/src/package_graph/package_graph.dart:206:21)
#2 PackageGraph.forPath (package:build_runner_core/src/package_graph/package_graph.dart:101:33)
#3 main (file:///Users/.pub-cache/hosted/pub.dev/build_runner-2.3.3/bin/build_runner.dart:27:30)
//------------------------------------------------
I'm Using
derry --version === 1.5
flutter --version
'Flutter 3.7.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c07f788888 (3 months ago) • 2023-02-22 17:52:33 -0600
Engine • revision 0f359063c4
Tools • Dart 2.19.2 • DevTools 2.20.1
Flutter Biolerplate project
Tried using different commands:
flutter build appbundle --release --flavor production -t lib/main_production.dart
flutter build appbundle --flavor production -t lib/main_production.dart
but Playstore showing
You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode.
Also
// buildTypes {
// release {
// signingConfig signingConfigs.release
// minifyEnabled true
// useProguard true
// proguardFiles getDefaultProguardFile('proguard-android.txt')
// }
// debug {
// signingConfig signingConfigs.debug
// }
// }
giving issue when project built.
Need solution, with which i can have playstore build ready asap.
See code !!
Originally posted by @Surajdivate in #10 (comment)
Hi, Can i know what is username and password for login?
Thanks for this Boilerplate ,i am currently using it on app that will soon go to production .
I think HomeState is unnecessary bcoz (HomeState.loggedOut() can fit in to AuthState.
@freezed
class AuthState with _$AuthState {
const factory AuthState.initial() = _Initial;
const factory AuthState.loading() = _Loading;
const factory AuthState.loggedIn() = _LoggedIn;
const factory AuthState.loggedOut() = _LoggedOut;
const factory AuthState.error(AppException error) = _Error;
}
Cheers
Assets.env.envProduction is loaded in main_development.
Flutter/lib/main_development.dart
Line 7 in ebb35fc
The signup and sign in requests work fine on Android virtual device. But no trace of requests when run in chrome browser.
Any insight will be helpful.
Thanks for this project, but I would expect a boilerplate project to have at least a few simple tests. Why not add a few?
On launch of this project into VSCode, it shows 129 problems, I believe most of these to be information or warnings, but was wondering it was worth trying to fix most of them ?
[flutter-boilerpplate] flutter pub get
Running "flutter pub get" in flutter-boilerpplate...
Because boilerplate depends on intl ^0.17.0 which doesn't match any versions, version solving failed.
pub get failed (1; Because boilerplate depends on intl ^0.17.0 which doesn't match any versions, version solving failed.)
exit code 1
dependency_overrides:
intl: any
solved it with the above dependency but can we have an updated version of the boilerplate on v2?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.
literally just running the project in here
https://github.com/SimpleBoilerplates/Flutter
Expected results:
not to crash. I have already ran flutter doctor and flutter pub get, and here are those outputs
flutter.bat doctor --verbose
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
• Flutter version 1.12.13+hotfix.8 at C:\Users\sqandil\Downloads\flutter_windows_v1.12.13+hotfix.8-stable\src\flutter
• Framework revision 0b8abb4 (10 days ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\sqandil\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.42.1)
• VS Code at C:\Users\sqandil\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.8.1
[√] Connected device (1 available)
• SM A105G • RR8M60E8ZQH • android-arm • Android 9 (API 28)
• No issues found!
Process finished with exit code 0
and here is the flutter pub get
--no-color packages get
Running "flutter pub get" in HandAppPrototype... 1.0s
Process finished with exit code 0
Actual results:
I/flutter (24244): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter (24244): The following assertion was thrown building MyApp: I/flutter (24244): MediaQuery.of() called with a context that does not contain a MediaQuery. I/flutter (24244): No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of(). I/flutter (24244): This can happen because you do not have a WidgetsApp or MaterialApp widget (those widgets introduce I/flutter (24244): a MediaQuery), or it can happen if the context you use comes from a widget above those widgets. I/flutter (24244): The context used was: I/flutter (24244): Scaffold I/flutter (24244): I/flutter (24244): The relevant error-causing widget was: I/flutter (24244): MyApp file:///C:/Users/sqandil/AndroidStudioProjects/handapp/lib/main.dart:13:10 I/flutter (24244): I/flutter (24244): When the exception was thrown, this was the stack: I/flutter (24244): #0 MediaQuery.of (package:flutter/src/widgets/media_query.dart:799:5) I/flutter (24244): #1 ScaffoldState.didChangeDependencies (package:flutter/src/material/scaffold.dart:2094:50) I/flutter (24244): #2 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4482:12) I/flutter (24244): #3 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4307:5) I/flutter (24244): #4 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3297:14) I/flutter (24244): #5 Element.updateChild (package:flutter/src/widgets/framework.dart:3091:12) I/flutter (24244): #6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4349:16) I/flutter (24244): #7 Element.rebuild (package:flutter/src/widgets/framework.dart:4053:5) I/flutter (24244): #8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4312:5) I/flutter (24244): #9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4307:5) I/flutter (24244): #10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3297:14) I/flutter (24244): #11 Element.updateChild (package:flutter/src/widgets/framework.dart:3091:12) I/flutter (24244): #12 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1054:16) I/flutter (24244): #13 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1025:5) I/flutter (24244): #14 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:968:17) I/flutter (24244): #15 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2512:19) I/flutter (24244): #16 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:967:13) I/flutter (24244): #17 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:848:7) I/flutter (24244): #18 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:830:7) I/flutter (24244): #27 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19) I/flutter (24244): #28 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5) I/flutter (24244): #29 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12) I/flutter (24244): (elided 8 frames from package dart:async and package dart:async-patch) I/flutter (24244): I/flutter (24244): ════════════════════════════════════════════════════════════════════════════════════════════════════ I/flutter (24303): AppStarted I/flutter (24303): Transition { currentState: AuthenticationUninitialized, event: AppStarted, nextState: AuthenticationUnauthenticated }
please consider adding usage instructions, I didn't understand how to use it via mason or whatever and looking at mason didn't really yield useful results, nor very_good_ci's issues
This flutter template only shows how to work with StateNotifierProvider
where the state is a model.
What is an example of when to use ChangeNotifierProvider
and can we include it in this boilerplate?
I am willing to do a PR here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.