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:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override |
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:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override |
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
// read image path | |
loadJson({String assetsPath='assets/AssetManifest.json'}) async { | |
final imageAssets = await rootBundle.loadString(assetsPath); | |
List<WallpaperModel> wallpaperModel = (json.decode(imageAssets) as List).map((e) => WallpaperModel.fromJson(e)).toList(); | |
wallpaperModel.forEach((element) => print(element.imagePath)); | |
} |
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:convert'; | |
import 'dart:io'; | |
void main() async { | |
assetsGenerator(); | |
} | |
void assetsGenerator({String assetsDir='/assets/images/'}) async { | |
var assetsPaths = Directory(Directory.current.path + assetsDir); |
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
// login page dart | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Colors.white, | |
body: SingleChildScrollView( | |
child: Container( | |
constraints: BoxConstraints( | |
maxHeight: MediaQuery.of(context).size.height, | |
maxWidth: MediaQuery.of(context).size.width), | |
decoration: BoxDecoration( |
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
├── Makefile | |
├── manage.py | |
├── projects | |
│ ├── blog | |
│ │ ├── api | |
│ │ │ ├── __init__.py | |
│ │ │ ├── routes.py | |
│ │ │ └── views.py | |
│ │ ├── __init__.py | |
│ │ └── models.py |
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 os | |
from flask import Flask | |
from flask_mongoengine import MongoEngine | |
from projects.blog.api.routes import blog_api_blueprint | |
db = MongoEngine() | |
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 mongoengine as me | |
from datetime import datetime | |
class Posts(me.Document): | |
title: str = me.StringField(required=True, max_length=200) | |
contents: str = me.StringField(required=True) | |
created_on = me.DateTimeField(default=datetime.now()) |
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 os | |
class BaseConfig: | |
TESTING: bool = False | |
SECRET_KEY: str = '@Flaskr-MongoSeCretKeyS' | |
DEBUG: bool = False | |
class DevelopmentConfig(BaseConfig): | |
MONGODB_SETTINGS: dict = { |
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
run-dev: | |
export FLASK_APP=manage.py && export FLASK_ENV=development && export APP_SETTINGS='projects.config.DevelopmentConfig' && flask run |
OlderNewer