-
Notifications
You must be signed in to change notification settings - Fork 1
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
c64279a
commit 58ccdd8
Showing
3 changed files
with
98 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class LabeledSection extends StatelessWidget { | ||
const LabeledSection({ | ||
Key? key, | ||
required this.label, | ||
required this.child, | ||
this.backgroundColor = Colors.red, | ||
}) : super(key: key); | ||
|
||
final String label; | ||
final Widget child; | ||
final Color backgroundColor; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack( | ||
children: [ | ||
Container( | ||
width: double.infinity, | ||
margin: const EdgeInsets.fromLTRB(10, 30, 10, 10), | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
color: Colors.blueGrey, | ||
width: 1, | ||
), | ||
shape: BoxShape.rectangle, | ||
), | ||
child: Container( | ||
color: backgroundColor, | ||
child: child, | ||
), | ||
), | ||
Positioned( | ||
left: 10, | ||
top: 10, | ||
child: Container( | ||
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), | ||
color: backgroundColor, | ||
child: Text( | ||
label, | ||
style: const TextStyle( | ||
color: Colors.black, | ||
fontSize: 12, | ||
), | ||
), | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
example/lib/shared/modules/trivia/initial/trivia_initial_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../../components/labeled_section.dart'; | ||
import '../components/copy_join_link_view.dart'; | ||
import '../components/trivia_data_view.dart'; | ||
|
||
class TriviaInitialStatusView extends StatelessWidget { | ||
const TriviaInitialStatusView({ | ||
Key? key, | ||
required this.triviaId, | ||
required this.onCopyJoinLinkTap, | ||
}) : super(key: key); | ||
|
||
final String triviaId; | ||
final Function(String) onCopyJoinLinkTap; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
const joinLink = 'TODO: improve joinLink'; | ||
|
||
return LabeledSection( | ||
label: 'Initial', | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
const SizedBox(height: 50), | ||
const TriviaDataView( | ||
hostName: 'hostName', | ||
triviaName: 'triviaName', | ||
triviaDescription: 'triviaDescription', | ||
triviaMainQuestion: 'triviaMainQuestion', | ||
), | ||
CopyJoinLinkView( | ||
joinLink: joinLink, | ||
onCopyJoinLinkTap: (joinLink) { | ||
//TODO: Implement. | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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