-
Notifications
You must be signed in to change notification settings - Fork 2
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
40e8f1c
commit 64b7976
Showing
5 changed files
with
58 additions
and
10 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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:yaru/yaru.dart'; | ||
|
||
extension BuildContextX on BuildContext { | ||
bool get isLight => theme.brightness == Brightness.light; | ||
ThemeData get theme => Theme.of(this); | ||
MediaQueryData get mq => MediaQuery.of(this); | ||
Color get baseColor => theme.colorScheme.onSurface; | ||
Color get highlightColor => | ||
theme.colorScheme.onSurface.scale(lightness: isLight ? 0.6 : -0.4); | ||
} |
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,29 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'sub_page.dart'; | ||
|
||
class LegalPage extends StatelessWidget { | ||
const LegalPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SubPage( | ||
body: Center( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
const Text('Ubuntu is a registered trademark of Canonical Ltd'), | ||
const Text('Ubuntu Flutter Community is not Canonical Ltd'), | ||
] | ||
.map( | ||
(e) => Padding( | ||
padding: const EdgeInsets.only(bottom: 10), | ||
child: e, | ||
), | ||
) | ||
.toList(), | ||
), | ||
), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:yaru/yaru.dart'; | ||
|
||
import 'build_context_x.dart'; | ||
|
||
BoxDecoration scaffoldGradient(BuildContext context) { | ||
return BoxDecoration( | ||
gradient: LinearGradient( | ||
begin: Alignment.topLeft, | ||
end: Alignment.bottomRight, | ||
colors: [ | ||
const Color(0xFF77216F).scale(lightness: -0.8), | ||
YaruColors.orange.scale(lightness: -0.8), | ||
], | ||
colors: context.isLight | ||
? [ | ||
Colors.white, | ||
Colors.white.scale(lightness: -0.2), | ||
] | ||
: [ | ||
const Color(0xFF77216F).scale(lightness: -0.8), | ||
YaruColors.orange.scale(lightness: -0.8), | ||
], | ||
), | ||
); | ||
} |