mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 16:46:51 +08:00
Stop using deprecated methods
This commit is contained in:
@ -95,7 +95,7 @@ class EditorBottomBar extends StatelessWidget {
|
||||
icon: const Icon(Icons.undo),
|
||||
onPressed: undoAllowed ? onUndoSelected : null,
|
||||
),
|
||||
FlatButton.icon(
|
||||
TextButton.icon(
|
||||
icon: const Icon(Icons.folder),
|
||||
label: Text(parentFolder.publicName),
|
||||
onPressed: () {
|
||||
|
@ -15,14 +15,19 @@ class PurchaseThankYouScreen extends StatelessWidget {
|
||||
style: textTheme.headline4,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
RaisedButton(
|
||||
child: const Text("Back"),
|
||||
color: theme.primaryColor,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(64.0, 16.0, 64.0, 16.0),
|
||||
)
|
||||
child: ElevatedButton(
|
||||
child: const Text("Back"),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all<Color>(
|
||||
Theme.of(context).primaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
);
|
||||
|
@ -43,11 +43,16 @@ class PurchaseButton extends StatelessWidget {
|
||||
text = tr("widgets.PurchaseButton.fail");
|
||||
}
|
||||
|
||||
return RaisedButton(
|
||||
child: Text(text, textAlign: TextAlign.center),
|
||||
color: Theme.of(context).primaryColor,
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(32.0, 16.0, 32.0, 16.0),
|
||||
onPressed: product != null ? () => _reportExceptions(context) : null,
|
||||
child: ElevatedButton(
|
||||
child: Text(text, textAlign: TextAlign.center),
|
||||
onPressed: product != null ? () => _reportExceptions(context) : null,
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.all<Color>(Theme.of(context).primaryColor),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -102,14 +102,17 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
||||
bottomBar = SizedBox(
|
||||
width: double.infinity,
|
||||
height: _bottomBarHeight,
|
||||
child: RaisedButton(
|
||||
child: ElevatedButton(
|
||||
key: const ValueKey("GetStarted"),
|
||||
child: Text(
|
||||
tr("OnBoarding.getStarted"),
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.button,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all<Color>(
|
||||
Theme.of(context).primaryColor),
|
||||
),
|
||||
onPressed: _finish,
|
||||
),
|
||||
);
|
||||
|
@ -254,13 +254,16 @@ class Button extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
child: ElevatedButton(
|
||||
child: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.button,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.all<Color>(Theme.of(context).primaryColor),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
),
|
||||
);
|
||||
@ -277,13 +280,15 @@ class RedButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
child: ElevatedButton(
|
||||
child: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.button,
|
||||
),
|
||||
color: Colors.red,
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
),
|
||||
);
|
||||
|
@ -21,27 +21,33 @@ class GitHostSetupButton extends StatelessWidget {
|
||||
if (iconUrl == null) {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
child: ElevatedButton(
|
||||
child: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.button,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all<Color>(
|
||||
Theme.of(context).primaryColor),
|
||||
),
|
||||
onPressed: _onPressedWithAnalytics,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: RaisedButton.icon(
|
||||
child: ElevatedButton.icon(
|
||||
label: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.button,
|
||||
),
|
||||
icon: Image.asset(iconUrl!, width: 32, height: 32),
|
||||
color: Theme.of(context).primaryColor,
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all<Color>(
|
||||
Theme.of(context).primaryColor),
|
||||
),
|
||||
onPressed: _onPressedWithAnalytics,
|
||||
),
|
||||
);
|
||||
|
@ -73,7 +73,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
||||
|
||||
UserInfo? _userInfo;
|
||||
|
||||
Widget? _buildPage(BuildContext context, int pos) {
|
||||
Widget _buildPage(BuildContext context, int pos) {
|
||||
assert(_pageCount >= 1);
|
||||
|
||||
if (pos == 0) {
|
||||
@ -350,16 +350,16 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
||||
}
|
||||
|
||||
assert(_pageChoice[0] != PageChoice0.CustomProvider);
|
||||
|
||||
assert(false, "Pos is $pos");
|
||||
return null;
|
||||
|
||||
return Container();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pageView = PageView.builder(
|
||||
controller: pageController,
|
||||
itemBuilder: _buildPage as Widget Function(BuildContext, int),
|
||||
itemBuilder: _buildPage,
|
||||
itemCount: _pageCount,
|
||||
onPageChanged: (int pageNum) {
|
||||
setState(() {
|
||||
|
Reference in New Issue
Block a user