Movator: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
Zeile 31: Zeile 31:


= 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>

Version vom 23. August 2022, 15:04 Uhr

Links

Erzeugen

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:$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

  • 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

get create page:file_select