Movator: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
= Links =
= Links =
* [[Flutter]]
* [[Flutter]]
* [[GetX]]


= Erzeugen =
= Erzeugen =
Zeile 6: Zeile 7:
PROJ=sortator
PROJ=sortator
cd /home/ws/flutter
cd /home/ws/flutter
mkdir $PROJ
flutter pub global activate get_cli
# Pfad muss $HOME/.pub-cache/bin enthalten!
PATH=$HOME/.pub-cache/bin:$PATH
get create project:$PROJ
# Fragen beantworten, Alternativen mit Rauf-/Runter-Tasten auswählen.
 
cd $PROJ
cd $PROJ
flutter create --project-name=$PROJ --platforms=linux,android --template=app \
flutter config --enable-linux-desktop
  --description="Moves and renames files into different target directories" .
flutter pub global activate path
mkdir lib/models lib/controllers lib/screens
flutter pub global activate dart_bones
vi pubspec.yaml
# dependencies:
#  g: ^4.6.5
flutter get pub
</syntaxhighlight>
</syntaxhighlight>


Zeile 30: Zeile 32:


= Modul erstellen =
= Modul erstellen =
* create a file models\sortator.dart
<syntaxhighlight lang=bash>
<syntaxhighlight lang=dart>
get create page:file_select
class Sortator {
  final List<String> targetDirectories = [];
  final List<String> categories = [];
}
</syntaxhighlight>
* create a file lib/controller/sortator_controller.dart
<syntaxhighlight lang=dart>
import 'package:get/get.dart';
import '../controllers/sortator.dart';
class SortatorController extends GetxController {
  final sortator = Sortator().obs;
}
</syntaxhighlight>
* create a file lib/screens/sortator_screen.dart
<syntaxhighlight lang=dart>
import 'package:flutter/material.dart';
 
class SortatorScreen extends GetxController {
  final sortator = Sortator().obs;
}
</syntaxhighlight>
</syntaxhighlight>

Aktuelle Version vom 24. August 2022, 16:18 Uhr

Links[Bearbeiten]

Erzeugen[Bearbeiten]

PROJ=sortator
cd /home/ws/flutter
flutter pub global activate get_cli
# Pfad muss $HOME/.pub-cache/bin enthalten!
PATH=$HOME/.pub-cache/bin:$PATH
get create project:$PROJ
# Fragen beantworten, Alternativen mit Rauf-/Runter-Tasten auswählen.

cd $PROJ
flutter config --enable-linux-desktop
flutter pub global activate path
flutter pub global activate dart_bones

Startseite festlegen[Bearbeiten]

  • change lib/main.dart:
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'screens/sortator_screen.dart';
void main() {
  runApp(GetMaterialApp(
    home: SortatorScreen(),));
}

Modul erstellen[Bearbeiten]

get create page:file_select