View simple_flutter_example.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2018 The Flutter team. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
import 'package:english_words/english_words.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} |
View use-env-var.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Set color | |
id: random-color-generator | |
run: echo "SELECTED_COLOR=green" >> $GITHUB_OUTPUT | |
- name: Get color | |
run: echo "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}" |
View bump-version-based-on-labels.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump app version based on PR labels | |
# Workflow for every new feature/enhance/fix | |
on: | |
pull_request: | |
branches: | |
- dev | |
types: | |
- closed | |
jobs: | |
setup_dart_and_run_converter: |
View labels_to_version_parts.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
const List<String> options = ["major", "minor", "patch"]; | |
Future<void> main(List<String> labels) async { | |
List<String> versionParts = List.from(labels); | |
versionParts.removeWhere((e) => !options.contains(e)); | |
String parts = ""; | |
if (versionParts.isNotEmpty) { | |
parts = versionParts.join(","); | |
parts = "parts=bump:$parts"; |
View mini_view.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:developer'; | |
import 'package:flutter/material.dart'; | |
import 'package:mvc_rocket/mvc_rocket.dart'; | |
class MiniView extends StatelessWidget { | |
MiniView({Key? key, required this.title}) : super(key: key); | |
final String title; | |
// use mini for convert value to RocketValue | |
final RocketValue<String> mcString = "Initial value".mini; |
View controller_rocket.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside of object use rocket extension | |
RocketController().add("key",value,readOnly:true); // you can't edit it if readonly true | |
// or | |
// [add] return value | |
rocket.add<Type>("key",value); | |
// [get] return value | |
rocket.get<Type>("key"); | |
// [remove] | |
rocket.remove("key"); | |
// remove with condition |
View main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set it in first screen | |
const String baseUrl = 'https://jsonplaceholder.typicode.com'; | |
// create request object | |
RocketRequest request = RocketRequest(url: baseUrl); | |
// save it, for use it from any screen | |
rocket.add(rocketRequestKey, request); |
View mvcRocket_post_view.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:example/models/post_model.dart'; | |
import 'package:example/requests/post_request.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:mvc_rocket/mvc_rocket.dart'; | |
class PostExample extends StatelessWidget { | |
// Save your model to use on another screen | |
// readOnly means if you close and open this screen you will use same data without update it from Api |
View mvcRocket_post_request.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:example/models/post_model.dart'; | |
import 'package:mvc_rocket/mvc_rocket.dart'; | |
const String postsEndpoint = "posts"; | |
class PostRequests { | |
static Future getPosts(Post postModel) => | |
RocketController().get(rocketRequestKey).getObjData( | |
// endpoint | |
postsEndpoint, |
View mvcRocket_post_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:mvc_rocket/mvc_rocket.dart'; | |
const String postUserIdKey = "userId"; | |
const String postIdKey = "id"; | |
const String postTitleKey = "title"; | |
const String postBodyKey = "body"; | |
class Post extends RocketModel<Post> { | |
int? userId; | |
int? id; |
NewerOlder