-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8235bb4
commit fb2b669
Showing
8 changed files
with
140 additions
and
72 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:dart_wormhole_gui/constants/app_constants.dart'; | ||
import 'package:dart_wormhole_gui/views/widgets/Heading.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class DTDropAFile extends StatelessWidget { | ||
DTDropAFile(); | ||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Heading( | ||
title: DROP_HERE, | ||
textAlign: TextAlign.center, | ||
textStyle: TextStyle( | ||
fontSize: 40.0, | ||
fontFamily: Theme.of(context).textTheme.headline1?.fontFamily, | ||
color: Theme.of(context).textTheme.headline1?.color, | ||
), | ||
// key: Key('Timing_Progress'), | ||
), | ||
], | ||
); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:dart_wormhole_gui/views/desktop/send/widgets/DTSelectAFile.dart'; | ||
import 'package:dart_wormhole_gui/views/shared/util.dart'; | ||
import 'package:dart_wormhole_william/client/file.dart' as f; | ||
import 'package:desktop_drop/desktop_drop.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'DTDropAFile.dart'; | ||
|
||
class DTSelectOrDropAFile extends StatefulWidget { | ||
final Future<void> Function() onFileSelected; | ||
final Future<void> Function(f.File) onFileDropped; | ||
bool dragEntered = false; | ||
DTSelectOrDropAFile( | ||
{Key? key, required this.onFileSelected, required this.onFileDropped}) | ||
: super(key: key); | ||
|
||
@override | ||
State<DTSelectOrDropAFile> createState() => _DTSelectOrDropAFile(); | ||
} | ||
|
||
class _DTSelectOrDropAFile extends State<DTSelectOrDropAFile> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
color: widget.dragEntered | ||
? Color(0xff3A2655) | ||
: Theme.of(context).dialogBackgroundColor, | ||
child: DropTarget( | ||
onDragDone: (detail) async { | ||
await widget.onFileDropped(detail.files.first.readOnlyFile()); | ||
}, | ||
onDragEntered: (detail) async { | ||
this.setState(() { | ||
widget.dragEntered = true; | ||
}); | ||
}, | ||
onDragExited: (detail) async { | ||
this.setState(() { | ||
widget.dragEntered = false; | ||
}); | ||
}, | ||
child: widget.dragEntered | ||
? DTDropAFile() | ||
: DTSelectAFile(widget.onFileSelected), | ||
), | ||
); | ||
} | ||
} |
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
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